:root {
  --settings-ink: #17211d;
  --settings-muted: #66726c;
  --settings-paper: #f4f6f2;
  --settings-card: rgba(255, 255, 255, .92);
  --settings-line: #dce2da;
  --settings-accent: #c9f27c;
  --settings-green: #5f7f3d;
  --settings-shadow: 0 18px 50px rgba(25, 39, 31, .08);
}

.settings-impersonation-banner { position: fixed; z-index: 1000; top: 0; right: 0; left: 0; min-height: 56px; padding: 8px max(16px,calc((100% - 1380px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #17211d; color: #fff; box-shadow: 0 8px 25px rgba(12,21,16,.24); }
.settings-impersonation-banner.hidden { display: none; }
.settings-impersonation-banner span { min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.settings-impersonation-banner b { color: #c9f27c; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.settings-impersonation-banner strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.settings-impersonation-banner button { min-height: 38px; padding: 0 14px; flex: 0 0 auto; border: 1px solid rgba(201,242,124,.32); border-radius: 7px; background: rgba(201,242,124,.1); color: #d8f4a3; font-size: 10px; font-weight: 850; cursor: pointer; }
body.settings-impersonating { padding-top: 56px; }
@media (max-width: 620px) {
  body.settings-impersonating { padding-top: 94px; }
  .settings-impersonation-banner { min-height: 94px; align-items: stretch; flex-direction: column; gap: 7px; padding: 10px 14px; }
  .settings-impersonation-banner span { display: grid; gap: 3px; }
  .settings-impersonation-banner strong { font-size: 11px; }
  .settings-impersonation-banner button { width: 100%; }
}

body {
  color: var(--settings-ink);
  background:
    radial-gradient(circle at 88% 4%, rgba(201, 242, 124, .22), transparent 28rem),
    radial-gradient(circle at 22% 92%, rgba(105, 144, 75, .08), transparent 32rem),
    var(--settings-paper);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

button, input, textarea { font-family: inherit; }

.account-shell { grid-template-columns: 272px minmax(0, 1fr); }

.account-sidebar {
  padding: 20px 16px 16px;
  background:
    radial-gradient(circle at 8% 1%, rgba(201, 242, 124, .1), transparent 18rem),
    linear-gradient(180deg, #14241c 0%, #101b16 100%);
  box-shadow: 14px 0 44px rgba(15, 29, 21, .08);
}

.account-brand { gap: 11px; padding: 2px 6px; }
.account-brand img { width: 44px; height: 44px; }
.account-brand strong { font-family: inherit; font-size: 21px; font-weight: 750; line-height: 1.05; letter-spacing: -.035em; }
.account-brand small { margin-top: 4px; font-size: 11px; }

.account-person {
  margin: 20px 0 14px;
  padding: 12px;
  grid-template-columns: 40px minmax(0, 1fr);
  border-radius: 14px;
  background: rgba(255, 255, 255, .055);
}

.account-person i { width: 40px; height: 40px; border-radius: 11px; font-family: inherit; font-size: 16px; font-weight: 800; line-height: 1; }
.account-person strong { font-size: 13px; }
.account-person small { font-size: 11px; }

#account-nav { gap: 5px; }
#account-nav button {
  min-height: 58px;
  padding: 8px 9px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 10px;
  border-radius: 12px;
}

#account-nav button > i { width: 36px; height: 36px; border-radius: 10px; font-size: 12px; }
#account-nav strong { font-size: 13px; }
#account-nav small { margin-top: 3px; font-size: 11px; }
#account-nav button > b { font-size: 9px; }
#account-nav button.active { background: #f5f7f2; box-shadow: 0 12px 28px rgba(0, 0, 0, .18); }

.account-sidebar-footer { gap: 8px; }
.account-sidebar-footer a, .account-sidebar-footer button { min-height: 38px; font-size: 12px; }

.account-header {
  min-height: 98px;
  padding: 20px clamp(22px, 3.3vw, 46px) 18px;
  align-items: center;
  background: rgba(248, 249, 246, .9);
  box-shadow: 0 8px 28px rgba(30, 44, 35, .035);
}

.account-header > div > span,
.section-intro > span,
.settings-card header span,
.profile-hero span,
.api-access-card span,
.api-base-card span,
.api-test-lab span,
.api-key-dialog-head span {
  font-size: 10px;
  letter-spacing: .12em;
}

.account-header h1 {
  margin: 5px 0 4px;
  font-family: inherit;
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 730;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.account-header p { font-size: 13px; }
.account-header-actions > a { min-height: 42px; border-radius: 11px; font-size: 12px; }
.save-state { min-height: 40px; border-radius: 11px; font-size: 11px; }

.settings-page { width: min(1160px, calc(100% - 44px)); padding: 34px 0 68px; }

.profile-hero {
  min-height: 225px;
  padding: 34px 40px;
  grid-template-columns: minmax(0, 1fr) 180px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 48%, rgba(201, 242, 124, .18), transparent 15rem),
    linear-gradient(135deg, #17251e, #20382a);
  box-shadow: 0 24px 60px rgba(19, 34, 25, .16);
}

.profile-hero h2 {
  max-width: 700px;
  margin: 10px 0 13px;
  font-family: inherit;
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: -.045em;
}

.profile-hero p { max-width: 700px; font-size: 14px; line-height: 1.65; }
.profile-hero img { width: 170px; height: 170px; }

.overview-grid { margin-top: 14px; gap: 12px; }
.overview-grid article {
  position: relative;
  min-height: 125px;
  padding: 19px 20px;
  overflow: hidden;
  border-radius: 15px;
  background: var(--settings-card);
  box-shadow: 0 12px 34px rgba(23, 33, 29, .035);
}
.overview-grid article::before { position: absolute; inset: 0 auto 0 0; width: 3px; content: ""; background: linear-gradient(var(--settings-accent), #7ea650); }
.overview-grid span { font-size: 10px; }
.overview-grid strong { margin-top: 16px; font-family: inherit; font-size: 19px; font-weight: 720; line-height: 1.2; letter-spacing: -.02em; }
.overview-grid small { margin-top: 6px; font-size: 12px; }

.profile-actions { margin-top: 14px; gap: 12px; }
.profile-actions button, .profile-actions a {
  min-height: 88px;
  padding: 15px 16px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  border-radius: 15px;
  box-shadow: 0 10px 28px rgba(23, 33, 29, .035);
}
.profile-actions i { width: 42px; height: 42px; border-radius: 12px; font-size: 11px; }
.profile-actions strong { font-size: 14px; }
.profile-actions small { margin-top: 5px; font-size: 12px; }
.profile-actions b { font-size: 17px; }
.admin-settings-link { border-radius: 14px; }
.admin-settings-link strong { font-size: 13px; }
.admin-settings-link small, .admin-settings-link a { font-size: 11px; }

.api-access-card {
  padding: 22px 24px;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 18px;
  border-radius: 18px;
  box-shadow: var(--settings-shadow);
}
.api-access-icon { width: 58px; height: 58px; border-radius: 15px; font-size: 13px; }
.api-access-card h2 { margin: 6px 0 6px; font-family: inherit; font-size: 25px; font-weight: 720; line-height: 1.15; letter-spacing: -.03em; }
.api-access-card p { font-size: 13px; line-height: 1.55; }
.api-access-card > b { padding: 7px 10px; font-size: 10px; }

.api-base-card { margin-top: 12px; padding: 17px 20px; border-radius: 14px; box-shadow: 0 10px 30px rgba(23, 33, 29, .035); }
.api-base-card code { margin-top: 6px; font-size: 16px; }
.api-base-card small { margin-top: 5px; font-size: 11px; }
.api-base-card button { min-height: 40px; padding-inline: 14px; border-radius: 10px; font-size: 11px; }

.settings-card { margin-top: 12px; border-radius: 18px; box-shadow: var(--settings-shadow); }
.key-manager > header { padding: 20px 21px; align-items: center; gap: 20px; }
.key-manager h2 { margin: 5px 0 5px; font-family: inherit; font-size: 23px; font-weight: 720; line-height: 1.2; letter-spacing: -.025em; }
.key-manager header p { font-size: 12px; }
.key-manager-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.key-manager form { gap: 8px; }
.key-manager input { width: 220px; height: 42px; border-radius: 10px; font-size: 13px; }
.key-manager form button { min-height: 42px; padding-inline: 14px; border-radius: 10px; font-size: 11px; }
.api-docs-button {
  min-height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #b8cf9a;
  border-radius: 10px;
  background: #f0f7e7;
  color: #46652e;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}
.api-docs-button:hover { background: #e7f3da; transform: translateY(-1px); }
.api-docs-button b { font-size: 14px; }

.settings-key-list { padding: 12px 14px 15px; gap: 9px; }
.settings-key-list > p { font-size: 13px; }
.settings-key-list article { padding: 13px 14px; border-radius: 12px; }
.settings-key-list strong { font-size: 13px; }
.settings-key-list code { margin-top: 4px; font-size: 11px; }
.settings-key-list small { margin-top: 5px; font-size: 11px; }
.settings-key-list article > b { font-size: 9px; }
.settings-key-list article > button { font-size: 11px; }

.api-test-lab { margin-top: 12px; border-radius: 18px; box-shadow: var(--settings-shadow); }
.api-test-lab > div, .api-test-lab pre { padding: 25px; }
.api-test-lab h2 { margin: 7px 0 8px; font-family: inherit; font-size: 24px; font-weight: 720; line-height: 1.2; letter-spacing: -.025em; }
.api-test-lab p { margin-bottom: 17px; font-size: 13px; line-height: 1.55; }
.api-test-lab label { gap: 7px; font-size: 12px; }
.api-test-lab input { height: 43px; border-radius: 10px; font-size: 13px; }
.api-test-lab button { min-height: 42px; border-radius: 10px; font-size: 11px; }
.api-test-lab code { font-size: 12px; }

.section-intro { margin-bottom: 22px; }
.section-intro h2 { margin: 8px 0 9px; font-family: inherit; font-size: clamp(27px, 3vw, 34px); font-weight: 730; line-height: 1.12; letter-spacing: -.035em; }
.section-intro p { font-size: 14px; line-height: 1.6; }
.billing-form { padding: 21px; }
.billing-status-row { margin-bottom: 18px; border-radius: 12px; }
.billing-status-row strong { font-size: 13px; }
.billing-status-row small { font-size: 11px; }
.billing-status-row > b { font-size: 10px; }
.billing-grid { gap: 14px; }
.billing-grid label, .security-card label { gap: 7px; font-size: 12px; }
.billing-grid small { font-size: 11px; }
.billing-grid input, .billing-grid textarea, .security-card input { min-height: 44px; border-radius: 10px; font-size: 14px; }
.billing-form footer a { font-size: 12px; }
.billing-form footer button, .security-card > button { min-height: 43px; padding-inline: 17px; border-radius: 10px; font-size: 11px; }

.security-card { max-width: 720px; padding: 24px; gap: 17px; border-radius: 18px; box-shadow: var(--settings-shadow); }
.account-password-rules span { padding: 8px 10px; font-size: 11px; }

.api-key-dialog { border-radius: 20px; }
.api-key-dialog h2 { font-family: inherit; font-size: 26px; font-weight: 730; line-height: 1.1; letter-spacing: -.03em; }
.api-key-dialog-lead { font-size: 13px; }
.api-key-dialog-value code { font-size: 13px; }
.api-key-dialog-value button { font-size: 11px; }
.api-key-dialog-warning strong { font-size: 12px; }
.api-key-dialog-warning small, .api-key-dialog footer span { font-size: 11px; }
.api-key-dialog footer button { font-size: 11px; }
.settings-toast { font-size: 12px; }

@media (max-width: 1160px) {
  .key-manager > header { align-items: stretch; flex-direction: column; }
  .key-manager-tools { justify-content: flex-start; }
}

@media (max-width: 980px) {
  .account-shell { display: block; min-width: 0; }
  .account-sidebar { position: static; width: 100%; height: auto; padding: 13px 16px; }
  .account-brand { margin-bottom: 10px; }
  .account-brand img { width: 38px; height: 38px; }
  .account-person, .account-sidebar-footer { display: none; }
  #account-nav { display: flex; gap: 7px; overflow-x: auto; }
  #account-nav button { min-width: 170px; flex: 0 0 170px; }
  .account-header { position: static; min-height: 0; padding: 18px 22px; }
  .settings-page { padding-top: 28px; }
  .profile-hero { grid-template-columns: 1fr; }
  .profile-hero img { display: none; }
  .overview-grid, .profile-actions { grid-template-columns: 1fr; }
  .api-test-lab { grid-template-columns: 1fr; }
  .api-test-lab pre { min-height: 230px; border-top: 1px solid rgba(255, 255, 255, .1); border-left: 0; }
  .billing-grid { grid-template-columns: 1fr; }
  .billing-grid label.wide { grid-column: auto; }
}

@media (max-width: 650px) {
  .account-header { align-items: stretch; flex-direction: column; gap: 13px; padding: 17px 15px; }
  .account-header-actions { justify-content: space-between; }
  .save-state { flex: 1; }
  .settings-page { width: calc(100% - 24px); padding: 22px 0 48px; }
  .profile-hero { min-height: 0; padding: 27px 22px; border-radius: 18px; }
  .profile-hero h2 { font-size: 30px; }
  .profile-hero p { font-size: 13px; }
  .api-access-card { padding: 19px; grid-template-columns: 48px minmax(0, 1fr); gap: 13px; }
  .api-access-icon { width: 48px; height: 48px; }
  .api-access-card h2 { font-size: 21px; }
  .api-access-card > b { grid-column: 2; justify-self: start; }
  .api-base-card { align-items: stretch; flex-direction: column; }
  .api-base-card code { overflow-x: auto; font-size: 14px; }
  .key-manager > header { padding: 18px; }
  .key-manager-tools, .key-manager form { display: grid; grid-template-columns: 1fr; }
  .api-docs-button { justify-content: center; }
  .key-manager input { width: 100%; }
  .settings-key-list { padding-inline: 9px; }
  .settings-key-list article { grid-template-columns: 39px minmax(0, 1fr) auto; }
  .settings-key-list article > button { grid-column: 2 / -1; justify-self: start; }
  .api-test-lab > div, .api-test-lab pre { padding: 20px 17px; }
  .billing-form { padding: 15px; }
  .billing-form footer { align-items: stretch; flex-direction: column; gap: 14px; }
  .api-key-dialog h2 { font-size: 22px; }
}
