:root {
  --bg: #eaf6f4;
  --grid: rgba(106, 151, 151, 0.14);
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #14b8a6;
  --brand-dark: #0f766e;
  --brand-soft: #d1fae5;
  --accent: #3b82f6;
  --danger: #dc2626;
  --ok: #0f766e;
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.05), 0 20px 35px rgba(15, 23, 42, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(150deg, #edf8f6 0%, #f5fbfa 55%, #f6fbff 100%);
}

html:not(.preauth) #bootSplash {
  display: none;
}

html.preauth #bootSplash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(20, 184, 166, 0.14), transparent 36%),
    radial-gradient(circle at 82% 16%, rgba(59, 130, 246, 0.12), transparent 34%),
    linear-gradient(150deg, #edf8f6 0%, #f5fbfa 55%, #f6fbff 100%);
}

.boot-splash-card {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.boot-splash-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #bfece6;
  border-top-color: #14b8a6;
  animation: boot-spin 0.8s linear infinite;
}

.boot-splash-text {
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

@keyframes boot-spin {
  to { transform: rotate(360deg); }
}

html.preauth #authScreen {
  display: none !important;
}

html.preauth #appShell {
  visibility: hidden;
}

html.preauth #appShell.hidden {
  display: grid !important;
}

.hidden { display: none !important; }

.auth-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.55;
}

.auth-wrap {
  position: relative;
  width: min(1240px, 100%);
  min-height: 700px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(420px, 0.8fr);
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 30px;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(7px);
  overflow: hidden;
  z-index: 1;
}

.auth-marketing {
  padding: 52px 50px 42px;
  background:
    radial-gradient(circle at 10% 10%, rgba(20, 184, 166, 0.24), transparent 42%),
    radial-gradient(circle at 94% 10%, rgba(59, 130, 246, 0.2), transparent 38%),
    linear-gradient(160deg, #e4f8f4 0%, #f4f9ff 72%, #fff 100%);
}

.brand {
  text-align: left;
  margin-bottom: 18px;
}

.brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: 1px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--brand-dark);
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1;
  color: #0f9f8f;
  letter-spacing: 0.8px;
}

.brand p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.marketing-title {
  margin: 24px 0 0;
  font-size: 42px;
  line-height: 1.12;
  color: #0b3f47;
  letter-spacing: -0.8px;
}

.marketing-subtitle {
  margin: 14px 0 0;
  color: #486173;
  font-size: 16px;
  max-width: 600px;
}

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

.marketing-card {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(183, 215, 236, 0.65);
  border-radius: 18px;
  padding: 16px 16px 15px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.marketing-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
  color: #113144;
  margin-bottom: 6px;
}

.marketing-card p {
  margin: 0;
  color: #526373;
  font-size: 13px;
  line-height: 1.45;
}

.marketing-stats {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.marketing-stats span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #bfecde;
  background: #f0fdf8;
  color: #0f766e;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
}

.auth-panel {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
}

.auth-lang {
  display: flex;
  justify-content: flex-end;
  margin: 2px 0 14px;
}

.auth-lang .lang-toggle {
  min-width: 156px;
  border-color: #cfe4ed;
}

.auth-lang .lang-menu {
  min-width: 218px;
  z-index: 60;
}

.auth-card {
  margin: 10px 0 auto;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(211, 226, 239, 0.8);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.09);
  border-radius: 24px;
  padding: 30px 28px 22px;
  backdrop-filter: blur(8px);
}

.auth-head h2 {
  margin: 0;
  font-size: 32px;
  text-align: left;
  letter-spacing: -0.3px;
}

.auth-head p {
  margin: 8px 0 0;
  text-align: left;
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 8px;
}

.auth-form label {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
}

.auth-form input,
textarea,
select,
.base-url input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

.auth-form input:focus,
textarea:focus,
select:focus,
.base-url input:focus {
  outline: none;
  border-color: #2dd4bf;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

button {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 9px 13px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: #0f172a;
}

button:hover { border-color: #94a3b8; }

.btn-primary {
  background: linear-gradient(100deg, #14b8a6, #0f766e);
  border-color: transparent;
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.02);
}

.text-btn {
  border: none;
  background: transparent;
  color: #0f766e;
  padding: 0;
}

.auth-switch {
  margin-top: 14px;
  text-align: left;
  color: var(--muted);
  display: flex;
  justify-content: flex-start;
  gap: 6px;
}

.auth-legal-note {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

.auth-legal-note a {
  color: #0f766e;
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 118, 110, 0.24);
}

.auth-legal-note a:hover {
  color: #0f5f59;
  border-bottom-color: rgba(15, 95, 89, 0.4);
}

.app-shell {
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: rgba(255, 255, 255, 0.78);
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  padding: 8px 10px 16px;
  margin-bottom: 4px;
  order: 0;
}

.logo-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(45deg, #34d399, #0ea5e9);
}

.sidebar-logo {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
}

.nav-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  margin-bottom: 5px;
  color: #334155;
}

.nav-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-label {
  line-height: 1.1;
}

.nav-btn:hover { background: #f1f5f9; }
.nav-btn:hover .nav-icon { color: #0f766e; }

.nav-btn.active {
  color: #0f766e;
  border-color: #99f6e4;
  background: #ecfeff;
}

.nav-btn.active .nav-icon { color: #0f766e; }

.nav-btn:disabled,
.nav-btn.nav-btn-disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.nav-btn:disabled:hover,
.nav-btn.nav-btn-disabled:hover {
  background: transparent;
}

.nav-btn:disabled .nav-icon,
.nav-btn.nav-btn-disabled .nav-icon {
  color: #94a3b8;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 14px 8px 4px;
  order: 999;
}

.base-url label {
  font-size: 12px;
  color: var(--muted);
}

.base-url button {
  width: 100%;
  margin-top: 8px;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 78px;
  background: rgba(248, 252, 252, 0.8);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar h2 {
  margin: 0;
  font-size: 23px;
}

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

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-tools {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.top-tool-btn {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid #9cc8ff;
  background: #f5faff;
  color: #2563eb;
  position: relative;
}

.top-tool-btn:hover {
  background: #ebf3ff;
}

.top-tool-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
}

.top-tool-icon svg {
  width: 100%;
  height: 100%;
}

.top-tool-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 4px;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  color: #ffffff;
  background: #ef4444;
  border: 2px solid #ffffff;
}

.top-doc-btn {
  height: 48px;
  border-radius: 14px;
  border: 1px solid #d6e2ed;
  background: #ffffff;
  color: #334155;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.top-doc-btn:hover {
  background: #f8fbff;
  color: #0f766e;
}

.top-notice-panel {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 86vw);
  max-height: min(68vh, 620px);
  border-radius: 16px;
  border: 1px solid #dbe6f0;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  z-index: 80;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.top-notice-head {
  padding: 12px 14px;
  border-bottom: 1px solid #ebf1f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-notice-head strong {
  font-size: 16px;
  color: #0f172a;
}

.top-notice-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #d7e2ee;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: #64748b;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-notice-close:hover {
  color: #334155;
  border-color: #bfd0e0;
  background: #f2f7fd;
}

.top-notice-list {
  padding: 10px 12px 12px;
  overflow: auto;
  display: grid;
  gap: 10px;
  align-content: start;
  background: #f8fbff;
}

.top-notice-empty {
  text-align: center;
  color: #7c8ca2;
  padding: 22px 10px;
  font-size: 14px;
}

.top-notice-item {
  border: 1px solid #e3ebf4;
  background: #ffffff;
  border-radius: 14px;
  padding: 10px 11px;
  display: grid;
  gap: 6px;
}

.top-notice-item.level-important {
  border-color: #fde68a;
  background: linear-gradient(180deg, #fffdf1 0%, #ffffff 100%);
}

.top-notice-item.level-force {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff7f7 0%, #ffffff 100%);
}

.top-notice-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.top-notice-item-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 14px;
}

.top-notice-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #64748b;
  font-size: 12px;
}

.top-notice-item-content {
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.top-notice-item-actions {
  display: flex;
  justify-content: flex-end;
}

.top-notice-ack-btn {
  height: 30px;
  border-radius: 9px;
  border: 1px solid #9bded6;
  background: #ebf9f7;
  color: #0f766e;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.top-notice-read-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  border: 1px solid #dbe5ef;
  color: #64748b;
}

.lang-dropdown {
  position: relative;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 142px;
  justify-content: space-between;
  border: 1px solid #dbe7ee;
  border-radius: 12px;
  background: #fff;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
}

.lang-caret {
  color: #64748b;
  font-size: 12px;
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #dbe7ee;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  z-index: 40;
}

.lang-menu.open {
  display: block;
}

.lang-option {
  width: 100%;
  border: none;
  border-radius: 0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 18px;
  font-weight: 500;
  color: #334155;
}

.lang-option + .lang-option {
  border-top: 1px solid #e9eff5;
}

.lang-option:hover {
  background: #f8fafc;
}

.lang-option.active {
  background: #ecfeff;
  color: #0f766e;
}

.lang-check {
  opacity: 0;
  color: #14b8a6;
  font-weight: 700;
}

.lang-option.active .lang-check {
  opacity: 1;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
}

.content {
  padding: 16px;
}

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

.metric {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.metric-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
}

.metric-icon svg {
  width: 24px;
  height: 24px;
}

.icon-balance { background: #ccf5e3; color: #0f766e; }
.icon-key { background: #dbeafe; color: #2563eb; }
.icon-input { background: #fef3c7; color: #d97706; }
.icon-output { background: #ddd6fe; color: #7c3aed; }
.icon-request { background: #dcfce7; color: #16a34a; }
.icon-cost { background: #f3e8ff; color: #9333ea; }
.icon-user { background: #fee2e2; color: #e11d48; }
.icon-recharge { background: #cffafe; color: #0e7490; }

.metric-meta {
  min-width: 0;
}

.metric-title {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}

.metric strong {
  margin-top: 4px;
  display: block;
  font-size: 42px;
  letter-spacing: -0.5px;
  line-height: 1.1;
  font-weight: 700;
}

.metric-sub {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 14px;
}

.panel {
  margin-top: 12px;
  background: #fff;
  border: 1px solid #e6eef5;
  border-radius: var(--radius);
  padding: 14px;
}

.panel h3 {
  margin: 0 0 12px;
}

.usage-panel {
  min-height: calc(100vh - 220px);
  display: flex;
  flex-direction: column;
}

.usage-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.usage-search-btn {
  min-width: 90px;
  height: 42px;
  border-radius: 12px;
  padding: 0 12px;
  border: 1px solid #cfe0ec;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
  color: #0f766e;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.usage-search-btn:hover {
  transform: translateY(-1px);
  border-color: #bcd4e4;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.1);
}

.usage-search-btn:active {
  transform: translateY(0);
}

.usage-range-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.usage-range-dropdown {
  position: relative;
}

.trend-range-toggle.usage-range-toggle {
  min-width: 188px;
  height: 42px;
  font-size: 15px;
  border-radius: 12px;
  padding: 0 12px;
  gap: 8px;
}

.usage-range-menu {
  width: min(620px, calc(100vw - 48px));
}

.usage-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-bottom: 14px;
}

.usage-preset {
  border: none;
  border-radius: 14px;
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  color: #475569;
  background: #fff;
  padding: 11px 14px;
}

.usage-preset:hover {
  background: #f1f5f9;
}

.usage-preset.active {
  background: #c8f3ec;
  color: #0f766e;
}

.usage-custom-row {
  grid-template-columns: 1fr 1fr;
}

.usage-actions {
  margin-top: 12px;
}

.usage-panel-hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: #64748b;
}

.usage-refresh-btn {
  min-width: 120px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-weight: 600;
}

.usage-refresh-btn:hover {
  background: #f1f5f9;
}

.dashboard-extra {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

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

.recent-item {
  border: 1px solid #e6eef5;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f9fcfe;
}

.recent-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
}

.recent-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}

.quick-actions {
  display: grid;
  gap: 8px;
}

.quick-actions button {
  text-align: left;
  padding: 10px 12px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.risk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.risk-head h3 {
  margin: 0;
}

.risk-open-btn,
.risk-submit-btn {
  min-width: 108px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #cfe0ea;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbff 100%);
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 14px rgba(148, 163, 184, 0.14);
}

.risk-open-btn:hover,
.risk-submit-btn:hover {
  border-color: #b8cedd;
  background: linear-gradient(180deg, #ffffff 0%, #f1f7fc 100%);
}

.trend-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.trend-panel-head h3 {
  margin: 0;
}

.trend-range-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.trend-refresh-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 999px;
  border: 1px solid #dbe7ee;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
  background: #ffffff;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.trend-refresh-btn svg {
  width: 18px;
  height: 18px;
}

.trend-refresh-btn:hover {
  transform: translateY(-1px);
  border-color: #c7d8e5;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.09);
}

.trend-refresh-btn:active {
  transform: translateY(0);
}

.trend-range-label {
  font-size: 16px;
  font-weight: 700;
  color: #334155;
}

.trend-range-dropdown {
  position: relative;
}

.trend-range-toggle {
  min-width: 230px;
  height: 56px;
  border-radius: 18px;
  border: 2px solid #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
  padding: 0 16px 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  color: #334155;
}

.trend-range-leading {
  font-size: 21px;
  line-height: 1;
}

.trend-caret {
  color: #64748b;
  margin-left: auto;
}

.trend-range-menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 620px;
  background: #ffffff;
  border: 1px solid #dde6ef;
  border-radius: 22px;
  box-shadow: 0 20px 46px rgba(15, 23, 42, 0.16);
  z-index: 50;
  padding: 16px;
}

.trend-range-menu.open {
  display: block;
}

.trend-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  margin-bottom: 14px;
}

.trend-preset {
  border: none;
  border-radius: 14px;
  text-align: left;
  font-size: 18px;
  font-weight: 600;
  color: #475569;
  background: #fff;
  padding: 11px 14px;
}

.trend-preset:hover {
  background: #f1f5f9;
}

.trend-preset.active {
  background: #c8f3ec;
  color: #0f766e;
}

.trend-custom-row {
  border-top: 1px solid #e6edf5;
  padding-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr 140px;
  gap: 10px;
}

.trend-custom-field label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.trend-custom-field input,
.trend-custom-field select {
  width: 100%;
  min-width: 0;
  height: 44px;
  border-radius: 12px;
  border-color: #d5dee9;
}

.trend-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.trend-actions button {
  min-width: 90px;
  height: 44px;
  border-radius: 14px;
}

#trendChart {
  width: 100%;
  height: 290px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: linear-gradient(to bottom, #f8fdff, #fff);
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.api-keys-grid {
  display: grid;
  gap: 12px;
}

#tab-apiKeys .panel {
  margin-top: 0;
}

.api-key-create-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.api-key-field label {
  display: block;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.api-key-create-btn {
  min-width: 126px;
  height: 44px;
}

.api-key-stats {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.api-key-stat-card {
  border: 1px solid #dbe7ee;
  border-radius: 14px;
  background: linear-gradient(160deg, #f8fdff 0%, #f0fdfa 100%);
  padding: 10px 12px;
}

.api-key-stat-card span {
  display: block;
  font-size: 12px;
  color: #64748b;
}

.api-key-stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  color: #0f766e;
}

.api-key-filters {
  margin-bottom: 8px;
  display: grid;
  grid-template-columns: 280px 150px 96px 1fr;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}

.api-key-filters.admin-mode {
  grid-template-columns: 250px 220px 150px 96px 1fr;
}

.api-key-filters #openCreateApiKeyModalBtn {
  justify-self: end;
  min-width: 128px;
  border-color: #b9e7df;
  background: linear-gradient(135deg, #f0fdfa, #e4f7ff);
  color: #0f766e;
  box-shadow: 0 10px 24px rgba(20, 184, 166, 0.1);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.api-key-filters #openCreateApiKeyModalBtn:hover {
  filter: none;
  transform: translateY(-1px);
  border-color: #8fd8cb;
  background: linear-gradient(135deg, #ecfeff, #dff4ff);
  box-shadow: 0 14px 28px rgba(14, 165, 233, 0.12);
}

.api-key-filters #openCreateApiKeyModalBtn:active {
  transform: translateY(0);
}

.api-key-filters input,
.api-key-filters select {
  height: 44px;
  border: 1px solid #dbe7ee;
  border-radius: 12px;
  background: #f8fbfd;
}

.api-key-table-wrap {
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  width: 100%;
  max-width: 100%;
}

.api-key-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1520px;
}

.api-key-table th,
.api-key-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #edf2f7;
  text-align: center;
  font-size: 13px;
  vertical-align: middle;
  white-space: nowrap;
}

.api-key-table.user-table { min-width: 1320px; }
.api-key-table.user-table th:nth-child(1),
.api-key-table.user-table td:nth-child(1) { min-width: 200px; }
.api-key-table.user-table th:nth-child(2),
.api-key-table.user-table td:nth-child(2) { min-width: 300px; }
.api-key-table.user-table th:nth-child(3),
.api-key-table.user-table td:nth-child(3) { min-width: 156px; }
.api-key-table.user-table th:nth-child(4),
.api-key-table.user-table td:nth-child(4) { min-width: 108px; }
.api-key-table.user-table th:nth-child(5),
.api-key-table.user-table td:nth-child(5) { min-width: 164px; }
.api-key-table.user-table th:nth-child(6),
.api-key-table.user-table td:nth-child(6) { min-width: 164px; }
.api-key-table.user-table th:nth-child(7),
.api-key-table.user-table td:nth-child(7) { min-width: 240px; }

.api-key-table.admin-table { min-width: 1490px; }
.api-key-table.admin-table th:nth-child(1),
.api-key-table.admin-table td:nth-child(1) { min-width: 200px; }
.api-key-table.admin-table th:nth-child(2),
.api-key-table.admin-table td:nth-child(2) { min-width: 156px; }
.api-key-table.admin-table th:nth-child(3),
.api-key-table.admin-table td:nth-child(3) { min-width: 300px; }
.api-key-table.admin-table th:nth-child(4),
.api-key-table.admin-table td:nth-child(4) { min-width: 156px; }
.api-key-table.admin-table th:nth-child(5),
.api-key-table.admin-table td:nth-child(5) { min-width: 108px; }
.api-key-table.admin-table th:nth-child(6),
.api-key-table.admin-table td:nth-child(6) { min-width: 164px; }
.api-key-table.admin-table th:nth-child(7),
.api-key-table.admin-table td:nth-child(7) { min-width: 164px; }
.api-key-table.admin-table th:nth-child(8),
.api-key-table.admin-table td:nth-child(8) { min-width: 240px; }

.api-key-table th {
  color: #475569;
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.api-key-sticky-col {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 2;
  box-shadow: 1px 0 0 #edf2f7;
  min-width: 220px;
  text-align: center;
}

.api-key-table th.api-key-sticky-col {
  background: #f8fafc;
  z-index: 3;
}

.api-key-empty-cell {
  text-align: center !important;
  color: #94a3b8;
  font-size: 15px;
  font-weight: 600;
  padding: 42px 8px !important;
}

.api-key-keycode {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 2px 7px;
}

.api-key-key-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.api-key-copy-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  padding: 0;
  border: 1px solid #e2e8f0;
  color: #64748b;
  background: #f3f4f6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.api-key-copy-btn:hover {
  background: #e5e7eb;
  border-color: #cbd5e1;
}

.api-key-copy-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.api-key-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}

.api-key-tag.active {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.api-key-tag.inactive {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.api-key-action-btn {
  height: 28px;
  border-radius: 8px;
  padding: 0 8px;
  font-size: 11px;
  background: #fff;
  border: 1px solid #dbe7ee;
  color: #334155;
}

.api-key-action-btn:hover {
  background: #f8fafc;
}

.api-key-actions {
  display: inline-flex;
  gap: 6px;
}

.api-key-action-btn.primary {
  border-color: #bae6fd;
  color: #0369a1;
  background: #f0f9ff;
}

.api-key-action-btn.warn {
  border-color: #fed7aa;
  color: #c2410c;
  background: #fff7ed;
}

.api-key-action-btn.danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fef2f2;
}

.api-key-action-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#tab-apiKeys.active {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 118px);
  height: calc(100vh - 118px);
  min-width: 0;
  overflow: hidden;
}

#tab-apiKeys .api-keys-grid {
  min-height: calc(100vh - 146px);
  height: 100%;
  flex: 1;
  grid-template-rows: auto 1fr;
  min-width: 0;
}

#tab-apiKeys .api-keys-grid > .panel:last-child {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

#apiKeysTable {
  display: flex;
  flex: 1;
  min-height: 0;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

#apiKeysTable .api-key-table-wrap {
  flex: 1;
  min-height: 100%;
  min-width: 0;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.36);
  display: grid;
  place-items: center;
  z-index: 120;
  backdrop-filter: blur(3px);
}

.modal-card {
  width: min(560px, 92vw);
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
}

.api-key-modal-card {
  width: min(460px, 90vw);
  border-radius: 20px;
  border: 1px solid #dce8f3;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.api-key-modal-card .modal-head {
  background: linear-gradient(140deg, #eefaf7 0%, #f5fbff 100%);
  border-bottom: 1px solid #e2edf6;
  padding: 16px 18px;
}

.api-key-modal-card .modal-head h3 {
  font-size: 20px;
  letter-spacing: 0.2px;
}

.api-key-modal-card .modal-close {
  border-color: #cfe0ec;
  background: #ffffff;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.modal-head h3 {
  margin: 0;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #dbe7ee;
  background: #fff;
  padding: 0;
}

.modal-body {
  padding: 14px 16px;
  display: grid;
  gap: 12px;
}

.api-key-modal-body {
  padding: 18px;
  gap: 16px;
}

.api-key-modal-body .api-key-field {
  display: grid;
  gap: 8px;
}

.api-key-modal-body .api-key-field label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.api-key-modal-body .api-key-field input {
  height: 46px;
  border: 1px solid #cfdeea;
  border-radius: 12px;
  background: #f8fbfd;
  padding: 0 12px;
}

.api-key-modal-body .api-key-field input:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16);
  background: #fff;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
}

.api-key-modal-card .modal-actions {
  border-top: 1px solid #e2edf6;
  padding: 14px 18px 18px;
}

.api-key-modal-card .modal-actions button {
  min-width: 110px;
  height: 42px;
  border-radius: 10px;
}

.risk-modal-card {
  width: min(520px, 92vw);
  border-radius: 20px;
  border: 1px solid #dce8f3;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.risk-modal-card .modal-head {
  background: linear-gradient(140deg, #eefaf7 0%, #f5fbff 100%);
  border-bottom: 1px solid #e2edf6;
  padding: 16px 18px;
}

.risk-modal-card .modal-close {
  border-color: #cfe0ec;
  background: #ffffff;
}

.risk-modal-body {
  padding: 18px;
  gap: 14px;
}

.notice-modal-card {
  width: min(560px, 92vw);
  border-radius: 20px;
  border: 1px solid #dce8f3;
  box-shadow: 0 24px 54px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.notice-modal-card .modal-head {
  background: linear-gradient(140deg, #f8fafc 0%, #f3f8ff 100%);
  border-bottom: 1px solid #e2edf6;
  padding: 16px 18px;
}

.notice-modal-card .modal-close {
  border-color: #cfe0ec;
  background: #ffffff;
}

.notice-modal-body {
  padding: 18px;
  gap: 14px;
}

.notice-field {
  display: grid;
  gap: 8px;
}

.notice-field label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.notice-field input,
.notice-field select,
.notice-field textarea {
  border: 1px solid #cfdeea;
  border-radius: 12px;
  background: #f8fbfd;
  padding: 10px 12px;
  font-size: 14px;
}

.notice-field input,
.notice-field select {
  height: 44px;
}

.notice-field textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.65;
}

.notice-field input:focus,
.notice-field select:focus,
.notice-field textarea:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16);
  background: #fff;
}

.notice-switch-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.notice-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 14px;
}

.risk-field {
  display: grid;
  gap: 8px;
}

.risk-field label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #334155;
}

.risk-field input,
.risk-field select {
  height: 44px;
  border: 1px solid #cfdeea;
  border-radius: 12px;
  background: #f8fbfd;
  padding: 0 12px;
}

.risk-field input:focus,
.risk-field select:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.16);
  background: #fff;
}

.risk-field input[readonly],
.risk-field select:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.risk-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: clamp(560px, calc(100vh - 210px), 920px);
}

.risk-section {
  min-height: 0;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.risk-sub-head h4 {
  margin: 0;
  font-size: 14px;
  color: #334155;
}

#riskTable,
#riskHitsTable {
  min-height: 0;
  flex: 1 1 0;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}

.usage-table-wrap {
  flex: 1;
  min-height: 420px;
}

.usage-data-table th:nth-child(1),
.usage-data-table td:nth-child(1) { min-width: 118px; }
.usage-data-table th:nth-child(2),
.usage-data-table td:nth-child(2) { min-width: 110px; }
.usage-data-table th:nth-child(3),
.usage-data-table td:nth-child(3) { min-width: 220px; }
.usage-data-table th:nth-child(4),
.usage-data-table td:nth-child(4) { min-width: 132px; }
.usage-data-table th:nth-child(5),
.usage-data-table td:nth-child(5) { min-width: 190px; }
.usage-data-table th:nth-child(6),
.usage-data-table td:nth-child(6) { min-width: 148px; }
.usage-data-table th:nth-child(7),
.usage-data-table td:nth-child(7) { min-width: 170px; }
.usage-data-table th:nth-child(8),
.usage-data-table td:nth-child(8) { min-width: 170px; }

.usage-data-table th:nth-child(4),
.usage-data-table td:nth-child(4) {
  text-align: left;
  padding-left: 18px;
}

.usage-data-table th:nth-child(5),
.usage-data-table td:nth-child(5) {
  text-align: left;
  padding-left: 32px;
}

.usage-data-table th:nth-child(6),
.usage-data-table td:nth-child(6) {
  text-align: left;
  padding-left: 18px;
}

.usage-request-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #dbe7ee;
  background: linear-gradient(135deg, #f8fbfd, #ffffff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.usage-request-chip strong {
  font-size: 14px;
  line-height: 1;
  color: #0f172a;
}

.usage-request-chip span {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
}

.usage-token-cell {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 138px;
}

.usage-token-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.usage-token-stat,
.usage-token-total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.usage-token-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.usage-token-icon svg {
  width: 18px;
  height: 18px;
}

.usage-token-stat.prompt .usage-token-icon {
  color: #10b981;
}

.usage-token-stat.completion .usage-token-icon {
  color: #8b5cf6;
}

.usage-token-total {
  color: #0ea5e9;
}

.usage-token-total .usage-token-icon {
  color: #0ea5e9;
}

.usage-token-footer {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.usage-token-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.usage-token-info-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #d9e2ec;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.usage-token-info-wrap:hover .usage-token-info-btn,
.usage-token-info-wrap:focus .usage-token-info-btn {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #3b82f6;
}

.usage-token-tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  min-width: 220px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(191, 219, 254, 0.92);
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 250, 255, 0.96));
  color: #475569;
  box-shadow: 0 18px 38px rgba(148, 163, 184, 0.22);
  backdrop-filter: blur(10px);
  transform: translate(8px, -50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 12;
}

.usage-token-tooltip::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  background: #f6fbff;
  border-left: 1px solid rgba(191, 219, 254, 0.92);
  border-bottom: 1px solid rgba(191, 219, 254, 0.92);
  transform: translateY(-50%) rotate(45deg);
}

.usage-token-info-wrap:hover .usage-token-tooltip,
.usage-token-info-wrap:focus .usage-token-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}

.usage-token-tooltip-title {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #0f766e;
}

.usage-token-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 13px;
  line-height: 1.7;
  color: #64748b;
}

.usage-token-tooltip-row strong {
  color: #0f172a;
  font-size: 13px;
}

.usage-token-tooltip-row.total {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(203, 213, 225, 0.9);
}

.usage-token-tooltip-row.total strong {
  color: #0284c7;
}

.usage-cost-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  border: 1px solid #cfeadf;
  background: linear-gradient(135deg, #f2fdf7, #ffffff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  color: #15803d;
}

.usage-cost-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dcfce7, #ecfdf5);
  color: #16a34a;
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.12);
}

.usage-cost-icon svg {
  width: 14px;
  height: 14px;
}

.usage-cost-chip strong {
  font-size: 13px;
  line-height: 1;
  color: #16a34a;
  letter-spacing: -0.02em;
}

.usage-billing-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.usage-billing-total {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  border-radius: 999px;
  border: 1px solid #cfeadf;
  background: linear-gradient(135deg, #f2fdf7, #ffffff);
  color: #15803d;
}

.usage-billing-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dcfce7, #ecfdf5);
  color: #16a34a;
  font-size: 12px;
  font-weight: 800;
}

.usage-billing-total strong {
  font-size: 13px;
  line-height: 1;
  color: #16a34a;
}

.usage-billing-detail {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

.usage-billing-breakdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.usage-billing-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}

.usage-billing-item.prompt {
  color: #16a34a;
}

.usage-billing-item.completion {
  color: #0284c7;
}

.usage-billing-arrow {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.usage-billing-arrow svg {
  width: 14px;
  height: 14px;
}

.usage-billing-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.usage-billing-source {
  max-width: 132px;
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.usage-billing-info-wrap {
  position: relative;
  display: inline-flex;
}

.usage-billing-info-btn {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #0f766e;
  border: 1px solid #b8e3dc;
  background: linear-gradient(180deg, #ecfdf9, #ffffff);
}

.usage-billing-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  min-width: 220px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #dbe7ee;
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
  display: none;
  z-index: 24;
}

.usage-billing-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #64748b;
}

.usage-billing-tooltip-row + .usage-billing-tooltip-row {
  margin-top: 7px;
}

.usage-billing-tooltip-row strong {
  color: #0f172a;
  font-size: 12px;
}

.usage-billing-info-wrap:hover .usage-billing-tooltip,
.usage-billing-info-wrap:focus-within .usage-billing-tooltip {
  display: block;
}

.usage-billing-empty {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px dashed #dbe2ea;
  color: #94a3b8;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
}

.recharge-shell {
  display: flex;
  justify-content: center;
}

.recharge-panel {
  position: relative;
  overflow: hidden;
  width: min(1240px, 100%);
  margin-top: 0;
  padding: 30px 30px 28px;
  border-radius: 30px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(249, 252, 255, 0.96));
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.08);
}

.recharge-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
  align-items: end;
}

.recharge-title-block h3 {
  margin: 12px 0 0;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #111827;
}

.recharge-title-block p {
  max-width: 620px;
  margin: 12px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: #64748b;
}

.recharge-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #ecfeff;
  border: 1px solid #c7f9f1;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recharge-balance-card {
  padding: 18px 18px 16px;
  border-radius: 24px;
  border: 1px solid #dbe7ee;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.recharge-balance-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}

.recharge-balance-card strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
  line-height: 1.08;
  letter-spacing: -0.04em;
  color: #111827;
}

.recharge-balance-card p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
}

.recharge-block {
  margin-top: 28px;
}

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

.recharge-block-label {
  font-size: 18px;
  font-weight: 700;
  color: #334155;
}

.recharge-block-hint {
  font-size: 13px;
  color: #94a3b8;
}

.recharge-amount-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.recharge-amount-chip {
  min-width: 102px;
  height: 64px;
  border-radius: 20px;
  border: 1px solid #edf2f7;
  background: rgba(247, 248, 250, 0.92);
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
  padding: 0 18px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.recharge-amount-chip:hover {
  transform: translateY(-1px);
  background: #f4f6f8;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.05);
}

.recharge-amount-chip.active {
  background: #050505;
  border-color: #050505;
  color: #ffffff;
  box-shadow: 0 16px 26px rgba(15, 23, 42, 0.14);
}

.recharge-custom-field {
  width: min(360px, 100%);
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 62px;
  padding: 0 18px;
  border-radius: 22px;
  border: 1px solid #dbe7ee;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.recharge-custom-prefix,
.recharge-custom-suffix {
  font-size: 18px;
  font-weight: 700;
  color: #475569;
}

.recharge-custom-field input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}

.recharge-amount-preview {
  min-height: 22px;
  margin: 12px 0 0;
  font-size: 14px;
  color: #64748b;
}

.recharge-method-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 24px;
  border: 1px solid #dbe7ee;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.96));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.recharge-method-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.recharge-method-logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #111827, #0f172a);
  color: #ffffff;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.18);
}

.recharge-method-copy strong {
  display: block;
  font-size: 18px;
  color: #111827;
}

.recharge-method-copy span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.6;
  color: #64748b;
}

.recharge-method-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0f766e;
  font-size: 13px;
  font-weight: 700;
}

.recharge-pay-btn {
  width: 100%;
  margin-top: 30px;
  height: 70px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(180deg, #111111, #000000);
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
}

.recharge-pay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.2);
}

.recharge-pay-btn:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.12);
}

.billing-legal-note {
  margin: 10px 2px 0;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.billing-legal-note a {
  color: #0f766e;
  text-decoration: none;
  border-bottom: 1px solid rgba(15, 118, 110, 0.24);
}

.billing-legal-note a:hover {
  color: #0f5f59;
  border-bottom-color: rgba(15, 95, 89, 0.4);
}

.recharge-order-state {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #dbe7ee;
  background: #f8fafc;
  color: #475569;
  font-size: 14px;
  line-height: 1.7;
}

.recharge-tips {
  margin-top: 24px;
  padding-top: 6px;
}

.recharge-tips h4 {
  margin: 0;
  font-size: 18px;
  color: #111827;
}

.recharge-tips ol {
  margin: 12px 0 0;
  padding-left: 28px;
}

.recharge-tips li {
  color: #334155;
  font-size: 15px;
  line-height: 1.8;
}

.bill-shell {
  display: grid;
  gap: 18px;
}

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

.bill-summary-card {
  padding: 22px 22px 20px;
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 253, 0.96));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.bill-summary-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
}

.bill-summary-card strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: #111827;
}

.bill-table-panel {
  display: flex;
  flex-direction: column;
  min-height: 580px;
}

.bill-table-head {
  display: block;
  margin-bottom: 18px;
}

.bill-table-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.bill-refresh-icon-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe7ee;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.bill-refresh-icon-btn svg {
  width: 18px;
  height: 18px;
}

.bill-refresh-icon-btn:hover {
  transform: translateY(-1px);
  border-color: #c7d8e5;
  box-shadow: 0 14px 26px rgba(15, 23, 42, 0.09);
}

.bill-refresh-icon-btn:active {
  transform: translateY(0);
}

.bill-table-copy {
  min-width: 0;
}

.bill-table-head h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
  color: #111827;
}

.bill-table-head p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: #64748b;
}

.bill-table-wrap {
  flex: 1;
  min-height: 460px;
}

.table-inline-action-btn {
  min-width: 92px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #dbe7ee;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  margin: 0 6px 6px 0;
}

.table-inline-action-btn:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
}

.table-inline-action-btn.info {
  border-color: #cfe1ff;
  background: #f3f8ff;
  color: #1d4ed8;
}

.table-inline-action-btn.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.table-inline-action-btn.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.table-inline-action-btn.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.table-inline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.table-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #dbe7f2;
  background: #f8fbff;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  margin: 0 4px 4px 0;
}

.table-inline-badge-soft {
  border-color: #d7efe8;
  background: #f3fbf8;
  color: #0f766e;
}

.table-muted {
  color: #94a3b8;
  font-size: 13px;
}

.table-code {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #0f172a;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.table-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: #e2e8f0;
  color: #475569;
}

.table-status-pending {
  background: #fef3c7;
  color: #b45309;
}

.table-status-paid {
  background: #ccfbf1;
  color: #0f766e;
}

.table-status-failed {
  background: #fee2e2;
  color: #b91c1c;
}

.table-empty {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 14px;
}

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

.data-table {
  width: 100%;
}

th, td {
  padding: 10px 8px;
  border-bottom: 1px solid #edf2f7;
  text-align: center;
  font-size: 13px;
  vertical-align: middle;
}

th {
  color: #475569;
  background: #f8fafc;
  position: sticky;
  top: 0;
}

.profile-shell,
.proxy-shell {
  display: grid;
  gap: 12px;
}

.profile-shell > .panel,
.proxy-shell > .panel {
  margin-top: 0;
}

.proxy-left-col > .panel {
  margin-top: 0;
}

.proxy-right-col > .panel {
  margin-top: 0;
}

.profile-hero-panel {
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 38%),
    linear-gradient(135deg, #ffffff 0%, #f6fbff 100%);
}

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

.profile-avatar {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: linear-gradient(135deg, #14b8a6, #0ea5e9);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 16px 34px rgba(20, 184, 166, 0.18);
}

.profile-hero-copy {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #dbe8f3;
  background: rgba(255, 255, 255, 0.72);
}

.profile-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-title-row h3 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.profile-primary-meta {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 14px;
}

.profile-email-verify-row {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-email-verify-label {
  color: #475569;
  font-size: 13px;
  font-weight: 600;
}

.profile-email-verify-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.profile-email-verify-badge.verified {
  border-color: #86efac;
  background: #ecfdf5;
  color: #047857;
}

.profile-email-verify-badge.pending {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.profile-email-verify-btn {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.16s ease;
}

.profile-email-verify-btn:hover {
  border-color: #7dd3fc;
  background: #e0f2fe;
}

.profile-email-verify-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.profile-refresh-btn {
  margin-left: 0;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

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

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

.profile-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.profile-card-head h3 {
  margin: 0;
  font-size: 20px;
  color: #0f172a;
  letter-spacing: -0.03em;
}

.profile-card-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-chip.role.admin {
  border-color: #bdeaf4;
  background: #ecfeff;
  color: #0f766e;
}

.profile-chip.role.user {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.profile-chip.status.active {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.profile-chip.status.inactive {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.profile-chip.role.neutral,
.profile-chip.status.neutral {
  border-color: #dbe7ee;
  background: #f8fafc;
  color: #64748b;
}

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

.profile-info-item {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #e7eef5;
  background: linear-gradient(180deg, #fbfdff 0%, #f5fbff 100%);
}

.profile-info-item span {
  display: block;
  color: #64748b;
  font-size: 13px;
  margin-bottom: 7px;
}

.profile-info-item strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.6;
  word-break: break-word;
}

.profile-info-wide {
  grid-column: 1 / -1;
}

.profile-balance-card {
  border: 1px solid #d7e9ff;
  border-radius: 18px;
  padding: 16px;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 42%),
    linear-gradient(135deg, #f8fdff 0%, #edf8ff 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.profile-hero-balance {
  margin-left: 0;
  margin-bottom: 0;
  min-width: 0;
  width: 100%;
  flex: 0 0 auto;
}

.profile-balance-copy {
  min-width: 0;
}

.profile-balance-label {
  display: block;
  color: #0369a1;
  font-size: 13px;
  font-weight: 700;
}

.profile-balance-copy strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.profile-balance-copy p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.profile-balance-btn {
  white-space: nowrap;
}

.profile-password-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.profile-password-field {
  display: grid;
  gap: 8px;
}

.profile-password-field label {
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

.profile-password-field input {
  width: 100%;
  border: 1px solid #d4e0e7;
  border-radius: 14px;
  padding: 10px 12px;
  background: #f8fbff;
  color: #0f172a;
}

.profile-password-field input:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
  background: #ffffff;
}

.profile-password-submit {
  justify-self: flex-start;
  margin-top: 4px;
}

.profile-balance-btn,
.profile-password-submit {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid #10b7ab;
  border-radius: 12px;
  background: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 100%);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 22px rgba(20, 184, 166, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.profile-balance-btn:hover,
.profile-password-submit:hover {
  transform: translateY(-1px);
  filter: saturate(1.04);
  box-shadow: 0 14px 26px rgba(14, 165, 233, 0.2);
}

.profile-balance-btn:active,
.profile-password-submit:active {
  transform: translateY(0);
}

.profile-session-json {
  max-height: 380px;
  border: 1px solid #dce8ef;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.08), transparent 34%),
    linear-gradient(180deg, #f8fbff 0%, #eff7fb 100%);
  color: #164e63;
  line-height: 1.8;
}

.proxy-shell {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
  align-items: start;
}

.proxy-left-col {
  display: grid;
  gap: 12px;
}

.proxy-right-col {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.proxy-request-panel {
  min-width: 0;
}

.proxy-example-panel {
  min-width: 0;
}

.proxy-spec-panel {
  min-width: 0;
}

.proxy-response-panel {
  min-width: 0;
}

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

.proxy-section-copy {
  min-width: 0;
}

.proxy-section-copy h3 {
  margin: 0;
  font-size: 23px;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: #0f172a;
}

.proxy-section-copy p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.7;
}

.proxy-request-panel .proxy-section-copy p {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-size: 13px;
  line-height: 1.5;
}

.proxy-request-badges,
.proxy-response-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.proxy-inline-badge,
.proxy-meta-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #dbe7ee;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.05);
}

.proxy-meta-chip.ok {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.proxy-meta-chip.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.proxy-meta-chip.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.proxy-meta-chip.pending {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #2563eb;
}

.proxy-meta-chip.accent {
  border-color: #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
}

.proxy-meta-chip.neutral {
  color: #475569;
}

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

.proxy-field {
  min-width: 0;
}

.proxy-field-span-2 {
  grid-column: 1 / -1;
}

.proxy-field label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.proxy-request-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 0;
}

.proxy-stream-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.proxy-stream-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.proxy-toggle-track {
  position: relative;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #d5e2ea;
  background: #eef6f8;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.proxy-toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
  transition: transform 0.18s ease;
}

.proxy-stream-toggle input:checked + .proxy-toggle-track {
  border-color: #14b8a6;
  background: #ccfbf1;
}

.proxy-stream-toggle input:checked + .proxy-toggle-track::after {
  transform: translateX(21px);
}

.proxy-action-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.proxy-action-group button {
  min-width: 124px;
  height: 42px;
}

.proxy-preview-card {
  margin-top: 18px;
  border: 1px solid #e6eef5;
  border-radius: 22px;
  background: linear-gradient(180deg, #fbfeff 0%, #f5fbff 100%);
  padding: 14px;
}

.proxy-subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.proxy-subsection-head h4 {
  margin: 0;
  font-size: 15px;
  color: #0f172a;
}

.proxy-subsection-hint {
  color: #64748b;
  font-size: 12px;
}

.proxy-example-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.proxy-example-tab {
  border: 1px solid #d6e4ef;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  color: #334155;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
}

.proxy-example-tab.active {
  border-color: #99f6e4;
  background: linear-gradient(180deg, #f0fdfa 0%, #dffcf5 100%);
  color: #0f766e;
  box-shadow: 0 8px 16px rgba(20, 184, 166, 0.15);
}

.proxy-example-code.proxy-code-view {
  min-height: 260px;
  max-height: 440px;
}

.proxy-example-footnote {
  margin: 10px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #64748b;
}

.proxy-example-footnote-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #b45309;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}

.proxy-code-view {
  margin: 0;
  min-height: 220px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.18), transparent 36%),
    linear-gradient(180deg, #102034 0%, #13283f 100%);
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.75;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

#proxyPayloadPreview.proxy-code-view {
  min-height: 120px;
  max-height: 180px;
}

.proxy-result-view {
  min-height: 320px;
  max-height: 560px;
}

.proxy-spec-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.proxy-example-head-actions {
  display: inline-flex;
  align-items: center;
}

.proxy-example-copy-btn {
  border: 1px solid #d8e5ef;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  background: #ffffff;
  color: #334155;
}

.proxy-spec-toggle-btn {
  border: 1px solid #d8e5ef;
  border-radius: 999px;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  background: #ffffff;
  color: #334155;
}

.proxy-spec-panel.spec-collapsed #proxySpecBody {
  display: none;
}

.proxy-spec-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.proxy-spec-summary-item {
  min-width: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #e6eef5;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.proxy-spec-summary-item span {
  display: block;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 8px;
}

.proxy-spec-summary-item strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.6;
  word-break: break-word;
}

.proxy-spec-summary-wide {
  grid-column: 1 / -1;
}

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

.proxy-spec-item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #e6eef5;
  background: linear-gradient(180deg, #fbfdff 0%, #f7fbff 100%);
}

.proxy-spec-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.proxy-spec-name {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.proxy-spec-badge-row {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.proxy-spec-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.proxy-spec-pill.required {
  background: #ecfdf5;
  color: #047857;
}

.proxy-spec-pill.optional {
  background: #eff6ff;
  color: #1d4ed8;
}

.proxy-spec-pill.type {
  background: #f8fafc;
  color: #475569;
}

.proxy-spec-desc {
  margin: 10px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}

.proxy-spec-default {
  margin: 8px 0 0;
  color: #0f766e;
  font-size: 12px;
  line-height: 1.6;
}

.proxy-logs-table-wrap {
  min-height: 300px;
}

.users-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.users-filter-bar input {
  flex: 1 1 520px;
  max-width: 640px;
  height: 44px;
  border-radius: 14px;
  padding: 0 14px;
  font-size: 14px;
  border: 1px solid #cfe0ea;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
}

.users-filter-bar .btn-primary {
  min-width: 104px;
  height: 44px;
  border-radius: 14px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  color: #0f766e;
  border: 1px solid #99e3db;
  background: linear-gradient(180deg, #eaf9f7 0%, #dff4f1 100%);
  box-shadow: 0 8px 14px rgba(20, 184, 166, 0.12);
}

.users-filter-bar .btn-primary:hover {
  transform: translateY(-1px);
  border-color: #7fd9cf;
  background: linear-gradient(180deg, #f2fcfa 0%, #e5f8f4 100%);
  filter: none;
}

.notice-filter-bar button {
  height: 44px;
  border-radius: 14px;
  padding: 0 18px;
}

.notice-filter-bar #noticeSearchBtn {
  min-width: 104px;
  font-size: 14px;
  font-weight: 700;
  color: #0f766e;
  border: 1px solid #99e3db;
  background: linear-gradient(180deg, #eaf9f7 0%, #dff4f1 100%);
  box-shadow: 0 8px 14px rgba(20, 184, 166, 0.12);
}

.notice-filter-bar #noticeSearchBtn:hover {
  transform: translateY(-1px);
  border-color: #7fd9cf;
  background: linear-gradient(180deg, #f2fcfa 0%, #e5f8f4 100%);
}

.notice-filter-bar #openNoticeModalBtn {
  min-width: 116px;
}

.notice-popup-mask {
  z-index: 220;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10px;
}

.notice-popup-card {
  width: min(620px, 92vw);
  border-radius: 20px;
  border: 1px solid #dce8f3;
  overflow: hidden;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
}

.notice-popup-head {
  background: linear-gradient(140deg, #eefaf7 0%, #f5fbff 100%);
  border-bottom: 1px solid #e2edf6;
  padding: 18px 20px;
}

.notice-popup-head h3 {
  margin: 0;
  font-size: 22px;
  color: #0f172a;
}

.notice-popup-body {
  padding: 16px 20px;
}

.notice-popup-content {
  color: #334155;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  max-height: min(52vh, 420px);
  overflow: auto;
}

.notice-popup-actions {
  padding: 14px 20px 20px;
}

.sysmsg-shell {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 12px;
}

.sysmsg-shell.user-single {
  grid-template-columns: minmax(0, 1fr);
}

.sysmsg-shell.user-single .sysmsg-thread-panel {
  display: none;
}

.sysmsg-shell.user-single .sysmsg-detail-panel {
  min-height: calc(100vh - 140px);
}

.sysmsg-shell.user-single .sysmsg-detail-copy h3 {
  font-size: 20px;
}

.sysmsg-shell.user-single .sysmsg-detail-head {
  display: none;
}

.sysmsg-shell .panel {
  margin-top: 0;
}

.sysmsg-thread-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 160px);
}

.sysmsg-thread-head h3 {
  margin: 0;
}

.sysmsg-thread-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.sysmsg-thread-filters input,
.sysmsg-thread-filters select,
.sysmsg-thread-filters button {
  height: 42px;
  border-radius: 12px;
}

.sysmsg-thread-filters button {
  color: #0f766e;
  border: 1px solid #99e3db;
  background: linear-gradient(180deg, #eaf9f7 0%, #dff4f1 100%);
  box-shadow: 0 8px 14px rgba(20, 184, 166, 0.12);
}

.sysmsg-thread-list {
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #ffffff;
  overflow: auto;
  flex: 1;
  min-height: 260px;
}

.sysmsg-thread-item {
  width: 100%;
  border: none;
  border-bottom: 1px solid #eef2f7;
  border-radius: 0;
  text-align: left;
  padding: 11px 12px;
  background: #ffffff;
}

.sysmsg-thread-item:last-child {
  border-bottom: none;
}

.sysmsg-thread-item:hover {
  background: #f8fbff;
}

.sysmsg-thread-item.active {
  background: linear-gradient(180deg, #ecfeff 0%, #f5fcff 100%);
}

.sysmsg-thread-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sysmsg-thread-item-top strong {
  font-size: 14px;
  color: #0f172a;
}

.sysmsg-thread-item p {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
}

.sysmsg-thread-item-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #94a3b8;
}

.sysmsg-thread-owner {
  color: #334155;
}

.sysmsg-create-box {
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #fbfdff;
}

.sysmsg-create-box label {
  font-size: 13px;
  color: #334155;
  font-weight: 700;
}

.sysmsg-create-box button {
  min-height: 42px;
}

.sysmsg-detail-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 160px);
}

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

.sysmsg-detail-copy h3 {
  margin: 0;
  font-size: 22px;
}

.sysmsg-detail-copy p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
}

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

.sysmsg-detail-actions select,
.sysmsg-detail-actions button {
  height: 38px;
  border-radius: 10px;
}

.sysmsg-message-list {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfeff 0%, #f8fbff 100%);
  min-height: 320px;
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.sysmsg-msg-item {
  display: flex;
  justify-content: flex-start;
  align-items: flex-end;
  gap: 8px;
}

.sysmsg-msg-item.mine {
  justify-content: flex-end;
}

.sysmsg-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-block;
  flex: 0 0 26px;
  overflow: hidden;
  border: 1px solid #c9dbe6;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
  background: #ffffff;
}

.sysmsg-msg-avatar-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.sysmsg-msg-bubble {
  max-width: min(80%, 760px);
  border-radius: 14px;
  border: 1px solid #dbe7ee;
  background: #ffffff;
  padding: 10px 12px;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05);
}

.sysmsg-msg-item.mine .sysmsg-msg-bubble {
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.sysmsg-msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 12px;
  color: #64748b;
}

.sysmsg-msg-content {
  margin-top: 6px;
  font-size: 14px;
  color: #0f172a;
  line-height: 1.65;
  word-break: break-word;
}

.sysmsg-reply-box {
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px;
  background: #ffffff;
  display: grid;
  gap: 10px;
}

.sysmsg-reply-box textarea {
  min-height: 96px;
  resize: vertical;
}

.sysmsg-reply-box button {
  justify-self: flex-end;
  min-height: 40px;
  min-width: 120px;
}

.support-float-entry {
  position: fixed;
  right: 18px;
  bottom: 96px;
  z-index: 140;
  width: 78px;
  border: none;
  border-radius: 24px;
  padding: 10px 8px 14px;
  background: linear-gradient(180deg, #14b8a6 0%, #0f766e 100%);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(15, 118, 110, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.support-float-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(15, 118, 110, 0.34);
}

.support-float-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 2px solid rgba(204, 251, 241, 0.92);
}

.support-float-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.support-float-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  writing-mode: vertical-rl;
  text-orientation: upright;
}

.support-widget {
  position: fixed;
  right: 20px;
  bottom: 22px;
  width: min(420px, calc(100vw - 36px));
  height: clamp(430px, 56vh, 600px);
  z-index: 150;
  border-radius: 18px;
  border: 1px solid #e7edf5;
  background: #ffffff;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.22);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.support-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #eef3f8;
  background: linear-gradient(180deg, #fcfdff 0%, #f7fbff 100%);
}

.support-widget-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font-size: 18px;
}

.support-widget-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.16);
}

.support-widget-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #64748b;
  font-size: 16px;
}

.support-widget-message-list {
  padding: 14px;
  overflow: auto;
  background: linear-gradient(180deg, #f8fbff 0%, #f6f9fd 100%);
  display: grid;
  gap: 10px;
  align-content: start;
}

.support-widget-empty {
  margin: auto;
  text-align: center;
  color: #7c8aa0;
  font-size: 14px;
  line-height: 1.65;
  padding: 0 18px;
}

.support-widget-msg {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.support-widget-msg.me {
  justify-self: end;
  background: #d9ecff;
  color: #0f172a;
  border-bottom-right-radius: 6px;
}

.support-widget-msg.support {
  justify-self: start;
  background: #ffffff;
  border: 1px solid #e3ebf4;
  color: #334155;
  border-bottom-left-radius: 6px;
}

.support-widget-msg-meta {
  font-size: 11px;
  color: #8a97aa;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.support-widget-footer {
  border-top: 1px solid #eef3f8;
  padding: 10px 12px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  background: #ffffff;
}

.support-widget-footer textarea {
  width: 100%;
  resize: none;
  border-radius: 12px;
  border: 1px solid #d8e3ef;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  min-height: 42px;
  max-height: 110px;
}

.support-widget-footer button {
  min-width: 80px;
  border-radius: 12px;
  border: 1px solid #16a34a;
  background: #22c55e;
  color: #ffffff;
  font-weight: 700;
}

.proxy-data-table th:nth-child(1),
.proxy-data-table td:nth-child(1) {
  min-width: 120px;
}

.proxy-data-table th:nth-child(2),
.proxy-data-table td:nth-child(2) {
  min-width: 170px;
}

.proxy-data-table th:nth-child(3),
.proxy-data-table td:nth-child(3) {
  min-width: 220px;
  text-align: left;
  padding-left: 18px;
}

.proxy-data-table th:nth-child(4),
.proxy-data-table td:nth-child(4) {
  min-width: 190px;
  text-align: left;
  padding-left: 24px;
}

.proxy-data-table th:nth-child(5),
.proxy-data-table td:nth-child(5) {
  min-width: 240px;
  text-align: left;
  padding-left: 18px;
}

.proxy-data-table th:nth-child(6),
.proxy-data-table td:nth-child(6) {
  min-width: 150px;
}

.proxy-data-table th:nth-child(7),
.proxy-data-table td:nth-child(7) {
  min-width: 130px;
}

.proxy-http-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
}

.proxy-http-chip.ok {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #047857;
}

.proxy-http-chip.warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.proxy-http-chip.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.proxy-http-chip.neutral {
  border-color: #dbe7ee;
  background: #f8fafc;
  color: #475569;
}

.json-view {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  max-height: 280px;
  overflow: auto;
}

.tab-panel { display: none; }
.tab-panel.active {
  display: block;
}

.app-toast {
  position: fixed;
  right: 20px;
  top: 20px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #0f766e;
  border: 1px solid transparent;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(6px);
  display: block;
  opacity: 0;
  transform: translateX(22px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  pointer-events: none;
  z-index: 100;
  will-change: transform, opacity;
}

.app-toast.show {
  opacity: 1;
  transform: translateX(0);
}

.app-toast.ok {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.35);
  color: #047857;
}

.app-toast.err {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.28);
  color: #b91c1c;
}

@media (max-width: 1100px) {
  .auth-wrap {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .auth-marketing {
    padding: 32px 24px 20px;
  }
  .marketing-title {
    font-size: 34px;
  }
  .auth-panel {
    padding: 16px 18px 24px;
  }
  .auth-card {
    margin: 0;
  }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .sidebar-brand, .sidebar-footer { grid-column: 1 / -1; }
  .content { padding: 12px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-extra { grid-template-columns: 1fr; }
  .grid-two { grid-template-columns: 1fr; }
  .api-key-create-row { grid-template-columns: 1fr; }
  .api-key-create-btn { width: 100%; }
  .bill-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bill-table-head {
    align-items: flex-start;
  }
  .recharge-panel { padding: 24px 22px 24px; }
  .recharge-head { grid-template-columns: 1fr; }
  .recharge-balance-card { max-width: 320px; }
  .recharge-amount-chip {
    min-width: 88px;
    height: 58px;
  }
  .recharge-pay-btn {
    height: 64px;
    font-size: 24px;
  }
  .usage-panel {
    min-height: 520px;
  }
  .usage-panel-head {
    flex-direction: column;
    align-items: stretch;
  }
  .usage-range-wrap,
  .usage-range-dropdown,
  .usage-range-toggle {
    width: 100%;
  }
  .usage-search-btn {
    flex: 1 1 auto;
  }
  .usage-custom-row {
    grid-template-columns: 1fr;
  }
  .usage-refresh-btn {
    width: 100%;
  }
  .profile-grid,
  .proxy-shell {
    grid-template-columns: 1fr;
  }
  .sysmsg-shell {
    grid-template-columns: 1fr;
  }
  .sysmsg-thread-panel,
  .sysmsg-detail-panel {
    min-height: 420px;
  }
  .sysmsg-detail-head {
    flex-direction: column;
    align-items: stretch;
  }
  .sysmsg-detail-actions {
    width: 100%;
  }
  .sysmsg-detail-actions select,
  .sysmsg-detail-actions button {
    flex: 1 1 0;
  }
  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: stretch;
  }
  .profile-hero-balance {
    grid-column: 1 / -1;
  }
  .proxy-section-head {
    flex-direction: column;
    align-items: stretch;
  }
  .profile-refresh-btn {
    justify-self: end;
  }
  .proxy-request-badges,
  .proxy-response-meta {
    justify-content: flex-start;
  }
  .proxy-form-grid,
  .proxy-spec-summary {
    grid-template-columns: 1fr;
  }
  .proxy-spec-summary-wide {
    grid-column: auto;
  }
  .proxy-action-group {
    width: 100%;
  }
  .proxy-action-group button {
    flex: 1 1 0;
  }
  .api-key-filters {
    grid-template-columns: 1fr;
  }
  .risk-head {
    flex-direction: column;
    align-items: stretch;
  }
  .risk-open-btn {
    width: 100%;
  }
  .risk-stack {
    height: clamp(520px, calc(100vh - 170px), 900px);
  }
  .users-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .users-filter-bar input {
    max-width: none;
  }
  .users-filter-bar .btn-primary {
    width: 100%;
  }
  .trend-range-menu { width: min(92vw, 620px); }
  .trend-custom-row { grid-template-columns: 1fr 1fr; }
  .trend-granularity { grid-column: 1 / -1; }
  .support-float-entry {
    right: 14px;
    bottom: 88px;
  }
  .support-widget {
    right: 12px;
    bottom: 12px;
    width: min(420px, calc(100vw - 24px));
  }
}

@media (max-width: 680px) {
  .auth-screen {
    padding: 10px;
  }
  .auth-wrap {
    border-radius: 20px;
  }
  .auth-marketing {
    padding: 24px 16px 16px;
  }
  .brand h1 {
    font-size: 30px;
  }
  .brand-head {
    gap: 10px;
  }
  .marketing-title {
    font-size: 28px;
  }
  .marketing-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .auth-panel {
    padding: 10px 12px 16px;
  }
  .auth-lang {
    margin: 0 0 10px;
  }
  .auth-lang .lang-toggle {
    min-width: 142px;
  }
  .auth-card {
    padding: 20px 16px;
  }
  .auth-head h2 {
    font-size: 28px;
  }
  .topbar {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .topbar-tools {
    order: 2;
    margin-left: auto;
  }
  .top-notice-panel {
    width: min(460px, calc(100vw - 24px));
  }
  .metric-grid { grid-template-columns: 1fr; }
  .metric strong { font-size: 34px; }
  .bill-summary-grid { grid-template-columns: 1fr; }
  .bill-summary-card {
    padding: 18px 18px 16px;
    border-radius: 20px;
  }
  .bill-summary-card strong {
    font-size: 26px;
  }
  .bill-table-panel {
    min-height: 520px;
  }
  .bill-table-head h3 {
    font-size: 22px;
  }
  .bill-refresh-icon-btn {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  .recharge-panel {
    padding: 20px 16px 22px;
    border-radius: 24px;
  }
  .recharge-title-block h3 {
    font-size: 32px;
  }
  .recharge-balance-card {
    max-width: none;
  }
  .recharge-balance-card strong {
    font-size: 28px;
  }
  .recharge-amount-row { gap: 8px; }
  .recharge-amount-chip {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    height: 54px;
    font-size: 16px;
    border-radius: 16px;
  }
  .recharge-custom-field {
    width: 100%;
    height: 56px;
    border-radius: 18px;
  }
  .recharge-custom-field input {
    font-size: 22px;
  }
  .recharge-method-card {
    padding: 16px;
    border-radius: 20px;
    align-items: flex-start;
    flex-direction: column;
  }
  .recharge-pay-btn {
    height: 58px;
    border-radius: 18px;
    font-size: 22px;
  }
  .recharge-tips li {
    font-size: 14px;
  }
  .trend-panel-head {
    gap: 12px;
  }
  .trend-range-wrap { width: 100%; }
  .trend-range-toggle { min-width: 0; width: 100%; }
  .trend-refresh-btn {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  .profile-hero-panel,
  .profile-grid > .panel,
  .profile-debug-panel,
  .proxy-request-panel,
  .proxy-spec-panel,
  .proxy-response-panel,
  .proxy-logs-panel {
    padding: 16px;
    border-radius: 20px;
  }
  .profile-title-row h3,
  .proxy-section-copy h3 {
    font-size: 22px;
  }
  .profile-info-grid {
    grid-template-columns: 1fr;
  }
  .profile-hero-balance {
    min-width: 0;
    width: 100%;
    margin-left: 0;
  }
  .profile-balance-card {
    flex-direction: column;
    align-items: stretch;
  }
  .profile-balance-copy strong {
    font-size: 24px;
  }
  .proxy-request-toolbar {
    align-items: stretch;
  }
  .sysmsg-msg-bubble {
    max-width: 94%;
  }
  .sysmsg-reply-box button {
    width: 100%;
    justify-self: stretch;
  }
  .proxy-stream-toggle {
    justify-content: space-between;
  }
  .proxy-action-group button {
    width: 100%;
  }
  .proxy-inline-badge,
  .proxy-meta-chip {
    min-height: 32px;
  }
  .proxy-example-code.proxy-code-view {
    min-height: 220px;
  }
  .proxy-code-view {
    min-height: 200px;
    padding: 14px 15px;
    border-radius: 18px;
  }
  .proxy-result-view {
    min-height: 260px;
  }
  .trend-range-menu { width: calc(100vw - 40px); left: -8px; }
  .trend-preset { font-size: 16px; }
  .trend-custom-row { grid-template-columns: 1fr; }
  .usage-panel {
    min-height: 460px;
  }
  .support-float-entry {
    width: 70px;
    bottom: 82px;
  }
  .support-float-text {
    font-size: 16px;
  }
  .support-widget {
    height: min(560px, calc(100vh - 24px));
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 8px;
    border-radius: 16px;
  }
  .support-widget-footer {
    grid-template-columns: 1fr;
  }
  .support-widget-footer button {
    height: 40px;
  }
  .top-doc-btn span[data-i18n="top_docs"] {
    display: none;
  }
  .top-doc-btn {
    width: 48px;
    justify-content: center;
    padding: 0;
  }
  .top-notice-panel {
    width: min(420px, calc(100vw - 12px));
  }
}
