:root {
  --ink: #151827;
  --ink-soft: #293047;
  --muted: #687087;
  --faint: #98a0b3;
  --page: #f5f6fa;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --line: #e8eaf1;
  --line-strong: #d9dde8;
  --sidebar: #111625;
  --sidebar-soft: #1a2032;
  --accent: #635bff;
  --accent-dark: #5047eb;
  --accent-soft: #efefff;
  --cyan: #36c9d0;
  --good: #17855d;
  --good-soft: #eaf8f2;
  --warn: #b36b12;
  --warn-soft: #fff5e6;
  --bad: #c24455;
  --bad-soft: #fff0f2;
  --radius: 16px;
  --shadow-card: 0 1px 2px rgba(19, 25, 45, 0.04), 0 8px 24px rgba(32, 39, 66, 0.045);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--page);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  min-height: 100%;
  background: var(--page);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

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

[hidden] {
  display: none !important;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

::selection {
  color: #292176;
  background: #dcd9ff;
}

:focus-visible {
  outline: 2px solid #7e76ff;
  outline-offset: 2px;
}

.eyebrow,
.card-kicker {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-light {
  color: #9da8ff;
}

.brand-symbol {
  position: relative;
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
}

.brand-symbol i {
  position: absolute;
  width: 8px;
  height: 21px;
  border-radius: 10px;
  background: linear-gradient(180deg, #9b94ff, #625aff);
  transform: rotate(32deg);
}

.brand-symbol i:first-child {
  margin-left: -12px;
  transform: rotate(-32deg);
}

.brand-symbol i:last-child {
  height: 16px;
  margin-top: 11px;
  transform: rotate(90deg);
}

.brand-symbol-dark i {
  background: linear-gradient(180deg, #7e76ff, #5047eb);
}

/* Login */

.login-layout {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 46%) 1fr;
  background: var(--surface);
}

.login-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  flex-direction: column;
  padding: 46px 56px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(35, 41, 76, 0.72), rgba(12, 17, 33, 0.98)),
    #111728;
}

.login-story::before {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

.login-brand,
.sidebar-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 19px;
  font-weight: 820;
  letter-spacing: 0.15em;
}

.story-content {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  margin: auto 0;
}

.story-content h1 {
  margin: 22px 0 20px;
  font-size: clamp(40px, 4.2vw, 64px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.story-content > p {
  max-width: 430px;
  margin: 0;
  color: #b8bfd2;
  font-size: 16px;
  line-height: 1.8;
}

.story-points {
  display: grid;
  max-width: 390px;
  gap: 13px;
  margin-top: 42px;
}

.story-points span {
  display: flex;
  align-items: center;
  gap: 15px;
  color: #e3e5f0;
  font-size: 13px;
}

.story-points i {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(157, 168, 255, 0.28);
  border-radius: 50%;
  color: #9da8ff;
  background: rgba(99, 91, 255, 0.08);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.story-footnote {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #747c91;
  font-size: 11px;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.orb-one {
  right: -160px;
  bottom: -170px;
  width: 470px;
  height: 470px;
  border: 1px solid rgba(115, 106, 255, 0.38);
  box-shadow: inset 0 0 100px rgba(99, 91, 255, 0.12);
}

.orb-two {
  right: 42px;
  bottom: 64px;
  width: 110px;
  height: 110px;
  background: rgba(54, 201, 208, 0.14);
  box-shadow: 0 0 100px rgba(54, 201, 208, 0.23);
}

.login-form-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: 52px max(8vw, 70px) 30px;
  background:
    radial-gradient(circle at 92% 8%, rgba(99, 91, 255, 0.055), transparent 26%),
    #fff;
}

.mobile-brand {
  display: none;
}

.login-form-wrap {
  width: min(420px, 100%);
  margin: auto;
}

.login-form-wrap h2 {
  margin: 12px 0 8px;
  font-size: 34px;
  letter-spacing: -0.04em;
}

.login-lead {
  margin: 0 0 38px;
  color: var(--muted);
  font-size: 14px;
}

.form-stack {
  display: grid;
  gap: 19px;
}

label {
  display: grid;
  gap: 8px;
}

label > span:first-child {
  color: #373d50;
  font-size: 12px;
  font-weight: 680;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder {
  color: #adb3c2;
}

input:focus,
select:focus {
  border-color: #817aff;
  box-shadow: 0 0 0 3px rgba(99, 91, 255, 0.1);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 46px;
}

.field-action {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 7px;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.field-action svg {
  width: 19px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 720;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button svg {
  width: 16px;
  height: 16px;
}

.button-primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(99, 91, 255, 0.2);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  background: #fff;
}

.button-danger-subtle {
  border-color: #f1cbd1;
  color: var(--bad);
  background: var(--bad-soft);
}

.button-block {
  width: 100%;
  min-height: 48px;
}

.login-help {
  margin: 24px 0 0;
  color: var(--faint);
  font-size: 12px;
  text-align: center;
}

.login-security {
  display: flex;
  width: min(420px, 100%);
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: auto auto 0;
  color: var(--faint);
  font-size: 10px;
}

.login-security svg {
  width: 15px;
}

.form-error {
  margin: -5px 0 0;
  padding: 10px 12px;
  border: 1px solid #f1cbd1;
  border-radius: 9px;
  color: var(--bad);
  background: var(--bad-soft);
  font-size: 11px;
  line-height: 1.5;
}

/* Shell */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 244px;
  flex-direction: column;
  padding: 30px 18px 20px;
  color: #fff;
  background:
    radial-gradient(circle at 0 0, rgba(99, 91, 255, 0.17), transparent 30%),
    var(--sidebar);
}

.sidebar-brand {
  padding: 0 14px 32px;
  font-size: 17px;
}

.sidebar-brand > span:last-child {
  display: grid;
  gap: 1px;
}

.sidebar-brand small {
  color: #717a93;
  font-size: 7px;
  font-weight: 650;
  letter-spacing: 0.28em;
}

.primary-nav {
  display: grid;
  gap: 5px;
}

.nav-item {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 13px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  color: #9098ad;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  transition: color 150ms ease, background 150ms ease;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav-item:hover {
  color: #d9ddeb;
  background: rgba(255, 255, 255, 0.035);
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(99, 91, 255, 0.27), rgba(99, 91, 255, 0.1));
  box-shadow: inset 2px 0 #827bff;
}

.sidebar-support {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: auto 4px 18px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.support-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: #aaa4ff;
  background: rgba(99, 91, 255, 0.14);
  font-size: 12px;
  font-weight: 800;
}

.sidebar-support div {
  display: grid;
  gap: 3px;
  font-size: 9px;
}

.sidebar-support strong {
  color: #d9ddea;
  font-weight: 650;
}

.sidebar-support a {
  color: #878fa5;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 10px 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: #fff;
  background: transparent;
  text-align: left;
}

.sidebar-profile > svg {
  width: 15px;
  margin-left: auto;
  color: #626b82;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #746cff, #4c45d7);
  font-size: 12px;
  font-weight: 760;
}

.profile-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.profile-copy strong,
.profile-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy strong {
  color: #e4e7f0;
  font-size: 11px;
}

.profile-copy small {
  color: #6f788e;
  font-size: 9px;
}

.workspace {
  min-height: 100vh;
  margin-left: 244px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
}

.topbar p {
  margin: 0 0 2px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

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

.service-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid #d7eee5;
  border-radius: 999px;
  color: var(--good);
  background: #f6fbf9;
  font-size: 10px;
  font-weight: 650;
}

.service-status i,
.status-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(23, 133, 93, 0.1);
}

.service-status.is-error {
  border-color: #f1cbd1;
  color: var(--bad);
  background: var(--bad-soft);
}

.icon-button {
  display: grid;
  width: 35px;
  height: 35px;
  padding: 8px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: #fff;
}

.icon-button svg {
  width: 17px;
}

.icon-button.is-spinning svg {
  animation: spin 750ms linear infinite;
}

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

.page-content {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 34px 36px 70px;
}

.page-view {
  display: none;
}

.page-view.active {
  display: block;
  animation: enter 180ms ease-out;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}

.welcome-row,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.welcome-row h2,
.section-heading h2 {
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 25px;
  letter-spacing: -0.035em;
}

.welcome-row p,
.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

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

.summary-card,
.card,
.quota-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.summary-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 19px 20px;
}

.summary-card::after {
  position: absolute;
  top: -40px;
  right: -45px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--card-glow, rgba(99, 91, 255, 0.06));
  content: "";
}

.summary-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.summary-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  color: var(--icon-color, var(--accent));
  background: var(--icon-bg, var(--accent-soft));
}

.summary-icon svg {
  width: 15px;
  height: 15px;
}

.summary-value {
  display: block;
  margin-top: 13px;
  font-size: 25px;
  font-weight: 740;
  letter-spacing: -0.04em;
}

.summary-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--faint);
  font-size: 9px;
}

.summary-meta.good {
  color: var(--good);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.85fr);
  gap: 16px;
  margin-bottom: 16px;
}

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

.card {
  padding: 21px;
}

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

.card-header h3,
.account-profile-card h3,
.security-card h3 {
  margin: 5px 0 0;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.text-button {
  padding: 3px 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 10px;
  font-weight: 650;
}

.soft-badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #555e74;
  background: #f0f2f7;
  font-size: 9px;
  font-weight: 680;
  white-space: nowrap;
}

.status-good {
  color: var(--good);
  background: var(--good-soft);
}

.status-warn {
  color: var(--warn);
  background: var(--warn-soft);
}

.status-bad {
  color: var(--bad);
  background: var(--bad-soft);
}

.model-usage-list {
  display: grid;
  gap: 17px;
}

.model-usage-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.95fr) minmax(140px, 2fr) 65px;
  align-items: center;
  gap: 14px;
}

.model-name {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.model-name strong,
.model-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-name strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.model-name small {
  color: var(--faint);
  font-size: 9px;
}

.usage-bar {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef0f5;
}

.usage-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.bar-color-0 {
  background: #635bff !important;
}

.bar-color-1 {
  background: #36a7d9 !important;
}

.bar-color-2 {
  background: #23aa7a !important;
}

.bar-color-3 {
  background: #a36bff !important;
}

.bar-color-4 {
  background: #e68a3a !important;
}

.width-0 { width: 0 !important; }
.width-5 { width: 5% !important; }
.width-10 { width: 10% !important; }
.width-15 { width: 15% !important; }
.width-20 { width: 20% !important; }
.width-25 { width: 25% !important; }
.width-30 { width: 30% !important; }
.width-35 { width: 35% !important; }
.width-40 { width: 40% !important; }
.width-45 { width: 45% !important; }
.width-50 { width: 50% !important; }
.width-55 { width: 55% !important; }
.width-60 { width: 60% !important; }
.width-65 { width: 65% !important; }
.width-70 { width: 70% !important; }
.width-75 { width: 75% !important; }
.width-80 { width: 80% !important; }
.width-85 { width: 85% !important; }
.width-90 { width: 90% !important; }
.width-95 { width: 95% !important; }
.width-100 { width: 100% !important; }

.model-total {
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.empty-state {
  display: grid;
  min-height: 130px;
  place-items: center;
  padding: 20px;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.referral-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(99, 91, 255, 0.035), transparent 65%),
    #fff;
}

.referral-card > p {
  position: relative;
  max-width: 290px;
  margin: 4px 0 20px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.referral-art {
  position: absolute;
  top: 52px;
  right: 20px;
  width: 90px;
  height: 76px;
  opacity: 0.11;
}

.referral-art span {
  position: absolute;
  width: 34px;
  height: 34px;
  border: 8px solid var(--accent);
  border-radius: 50%;
}

.referral-art span:nth-child(2) {
  top: 30px;
  left: 24px;
  border-color: var(--cyan);
}

.referral-art span:nth-child(3) {
  right: 0;
  border-color: #a36bff;
}

.copy-field,
.secret-field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 13px;
  border: 1px dashed #cbc8ff;
  border-radius: 10px;
  background: #f8f7ff;
}

.copy-field code,
.secret-field code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #4b448f;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-field button,
.secret-field button {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  font-size: 9px;
  font-weight: 680;
}

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

.table-card > .card-header {
  margin: 0;
  padding: 20px 21px 14px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: #9299aa;
  background: #fafbfc;
  font-size: 8px;
  font-weight: 760;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: #555e72;
}

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: #fbfbfe;
}

.table-code {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  color: #3e465a;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.table-primary {
  color: var(--ink-soft);
  font-weight: 650;
}

.table-secondary {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 8px;
}

.table-empty td {
  height: 130px;
  color: var(--faint);
  text-align: center;
}

.row-action {
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  color: var(--bad);
  background: transparent;
  font-size: 9px;
  font-weight: 650;
}

.row-action:hover {
  background: var(--bad-soft);
}

.row-action:disabled {
  color: var(--faint);
  cursor: not-allowed;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 17px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: #fff;
}

.notice-info {
  border-color: #dcdafe;
  background: #f8f7ff;
}

.notice-warning {
  border-color: #f2dfbd;
  background: var(--warn-soft);
}

.notice > svg {
  width: 18px;
  flex: 0 0 auto;
  color: var(--accent);
}

.notice-warning > svg {
  color: var(--warn);
}

.notice div {
  display: grid;
  gap: 3px;
}

.notice strong {
  color: var(--ink-soft);
  font-size: 10px;
}

.notice span {
  font-size: 10px;
  line-height: 1.55;
}

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

.quota-card {
  padding: 20px;
}

.quota-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quota-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.quota-card strong {
  display: block;
  margin: 13px 0 10px;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.quota-card small {
  color: var(--faint);
  font-size: 9px;
}

.quota-progress {
  height: 6px;
  margin: 14px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef0f5;
}

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

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

.quality-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.quality-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 9px;
}

.quality-item strong {
  font-size: 20px;
  letter-spacing: -0.03em;
}

.search-field {
  position: relative;
  width: min(280px, 100%);
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 16px;
  transform: translateY(-50%);
  color: var(--faint);
}

.search-field input {
  min-height: 39px;
  padding-left: 36px;
}

.table-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 9px;
  text-align: right;
}

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

.model-card {
  position: relative;
  min-height: 168px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-card);
}

.model-card::after {
  position: absolute;
  right: -30px;
  bottom: -42px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--model-glow);
  content: "";
}

.model-theme-omnis {
  --model-color: #635bff;
  --model-soft: #efefff;
  --model-glow: rgba(99, 91, 255, 0.08);
}

.model-provider-mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 11px;
  color: var(--model-color);
  background: var(--model-soft);
  font-size: 12px;
  font-weight: 800;
}

.model-card h3 {
  margin: 17px 0 5px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  letter-spacing: -0.02em;
}

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

.model-card-footer {
  position: absolute;
  z-index: 1;
  right: 18px;
  bottom: 17px;
  left: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--faint);
  font-size: 9px;
}

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

.account-profile-card {
  display: flex;
  min-height: 150px;
  align-items: center;
  gap: 18px;
}

.account-profile-card > .status-pill {
  margin-left: auto;
}

.account-avatar {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(145deg, #7770ff, #4d45d5);
  box-shadow: 0 9px 24px rgba(99, 91, 255, 0.24);
  font-size: 20px;
  font-weight: 760;
}

.account-profile-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.details-card dl {
  margin: 0;
}

.details-card dl > div {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
}

.details-card dl > div:first-child {
  border-top: 0;
}

.details-card dt {
  color: var(--muted);
  font-size: 10px;
}

.details-card dd {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 620;
  text-align: right;
}

.details-card code {
  color: #514a98;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
}

.mini-copy {
  padding: 3px 6px;
  border: 0;
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 8px;
}

.security-card {
  display: flex;
  align-items: center;
  gap: 15px;
  grid-column: 1 / -1;
  border-color: #dcdafe;
  background: #f8f7ff;
}

.security-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.security-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: #e9e7ff;
}

.security-icon svg {
  width: 21px;
}

/* Dialogs and toast */

.modal {
  width: min(520px, calc(100% - 28px));
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 30px 90px rgba(20, 24, 45, 0.25);
}

.modal::backdrop {
  background: rgba(12, 16, 31, 0.58);
  backdrop-filter: blur(4px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.modal h2 {
  margin: 7px 0 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.modal > p,
.modal form > p {
  margin: 9px 0 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.dialog-close {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 18px;
}

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

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.secret-modal {
  text-align: center;
}

.success-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 50%;
  color: var(--good);
  background: var(--good-soft);
}

.success-mark svg {
  width: 26px;
  stroke-width: 2.4;
}

.secret-field {
  margin: 22px 0 16px;
  text-align: left;
}

.secret-field code {
  font-size: 10px;
}

.secret-modal .notice {
  text-align: left;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  display: flex;
  max-width: min(360px, calc(100% - 32px));
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid #d8eae3;
  border-radius: 11px;
  color: var(--good);
  background: #fff;
  box-shadow: 0 15px 40px rgba(25, 33, 57, 0.15);
  font-size: 11px;
  font-weight: 650;
}

.toast.is-error {
  border-color: #f0ccd2;
  color: var(--bad);
}

.toast > span:first-child {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: currentColor;
  font-size: 10px;
}

.toast > span:first-child::first-letter {
  color: white;
}

/* Responsive */

@media (max-width: 1100px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .login-form-panel {
    padding-inline: 7vw;
  }
}

@media (max-width: 860px) {
  .login-layout {
    display: block;
  }

  .login-story {
    display: none;
  }

  .login-form-panel {
    min-height: 100vh;
    padding: 32px 24px 22px;
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 45px;
    color: var(--ink);
    font-size: 16px;
    letter-spacing: 0.14em;
  }

  .sidebar {
    inset: auto 0 0;
    width: auto;
    height: 68px;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-brand,
  .sidebar-support,
  .sidebar-profile {
    display: none;
  }

  .primary-nav {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px;
  }

  .nav-item {
    min-height: 52px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    border-radius: 8px;
    font-size: 8px;
  }

  .nav-item svg {
    width: 16px;
    height: 16px;
  }

  .nav-item.active {
    box-shadow: none;
  }

  .workspace {
    margin-left: 0;
    padding-bottom: 68px;
  }

  .topbar {
    height: 64px;
    padding: 0 20px;
  }

  .page-content {
    padding: 25px 20px 50px;
  }

  .dashboard-grid,
  .dashboard-grid-balanced,
  .account-grid {
    grid-template-columns: 1fr;
  }

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

  .security-card {
    grid-column: auto;
  }
}

@media (max-width: 600px) {
  .page-content {
    padding-inline: 14px;
  }

  .topbar {
    padding-inline: 15px;
  }

  .service-status span {
    display: none;
  }

  .service-status {
    width: 32px;
    height: 32px;
    justify-content: center;
    padding: 0;
  }

  .welcome-row,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .welcome-row > .button,
  .section-heading > .button,
  .section-heading > .search-field {
    width: 100%;
  }

  .summary-grid,
  .quota-grid,
  .model-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    display: block;
  }

  .dashboard-grid > .card {
    margin-bottom: 14px;
  }

  .model-usage-row {
    grid-template-columns: minmax(100px, 1fr) minmax(90px, 1.2fr) 56px;
    gap: 8px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .account-profile-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .account-profile-card > .status-pill {
    width: fit-content;
    margin-left: 76px;
  }

  .modal {
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
