:root {
  color-scheme: dark;
  --portal-bg: #050507;
  --portal-sidebar: #070b09;
  --portal-surface: #0a1410;
  --portal-surface-2: #0e1a15;
  --portal-border: rgba(143, 255, 208, 0.16);
  --portal-border-strong: rgba(143, 255, 208, 0.3);
  --portal-text: #eafff6;
  --portal-muted: #a7c3b9;
  --portal-faint: #6f8a80;
  --portal-accent: #8fffd0;
  --portal-accent-strong: #bdffe6;
  --portal-accent-ink: #02110a;
  --portal-danger: #ff8f8f;
  --portal-danger-bg: #211010;
  --portal-danger-border: #5b2929;
  --portal-radius: 6px;
  --sidebar-width: 268px;
  --sidebar-rail: 76px;
  --focus: 0 0 0 3px rgba(119, 225, 178, 0.24);
  --portal-cut: 9px;
  font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
}

.legal-check{display:flex;align-items:flex-start;gap:10px;color:var(--portal-muted,#a7c3b9);font-size:.82rem;line-height:1.5}
.legal-check input{width:17px;height:17px;margin:2px 0 0;flex:0 0 auto;accent-color:#8fffd0}
.legal-check a{color:#8fffd0;text-decoration:underline;text-underline-offset:2px}
.signup-legal-check{margin-bottom:16px}
.billing-legal-check{margin:0 0 18px}

* {
  box-sizing: border-box;
}

html {
  background: var(--portal-bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--portal-bg);
  color: var(--portal-text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

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

a {
  color: var(--portal-accent);
  text-underline-offset: 3px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 0;
  box-shadow: var(--focus);
}

.mono,
code,
pre {
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.metric .mono,
.credit-number .mono {
  font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  transform: translateY(-160%);
  background: var(--portal-accent);
  color: var(--portal-accent-ink);
  padding: 10px 14px;
  border-radius: var(--portal-radius);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.portal-brand {
  display: inline-flex;
  width: 104px;
  min-height: 42px;
  align-items: center;
  color: var(--portal-text);
  text-decoration: none;
  overflow: visible;
}

.portal-brand img {
  display: block;
  width: auto;
  height: 42px;
  object-fit: contain;
  transform: scale(1.85);
  transform-origin: left center;
  filter: drop-shadow(0 0 18px rgba(143, 255, 208, 0.35));
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(143, 255, 208, 0.1);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(143, 255, 208, 0.08), rgba(143, 255, 208, 0.01) 55%, rgba(0, 0, 0, 0.28));
  color: var(--portal-muted);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -2px 0 rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.icon-btn:hover {
  border-color: var(--portal-border);
  background: var(--portal-surface-2);
  color: var(--portal-text);
}

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

.portal-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid var(--portal-border-strong);
  border-radius: 0;
  background: linear-gradient(180deg, #141a17, #0b0f0d 55%, #050807);
  color: var(--portal-text);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  clip-path: polygon(var(--portal-cut) 0, 100% 0, 100% calc(100% - var(--portal-cut)), calc(100% - var(--portal-cut)) 100%, 0 100%, 0 var(--portal-cut));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), inset 0 -2px 0 rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.portal-btn:hover {
  border-color: var(--portal-accent);
  background: linear-gradient(180deg, rgba(143, 255, 208, 0.2), rgba(143, 255, 208, 0.07) 55%, rgba(0, 0, 0, 0.22));
}

.portal-btn.primary {
  border-color: var(--portal-accent);
  background: linear-gradient(180deg, #c9ffe9 0%, var(--portal-accent) 45%, #57dfab 100%);
  color: var(--portal-accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -2px 0 rgba(2, 17, 10, 0.3), inset 0 -8px 14px rgba(2, 17, 10, 0.1);
}

.portal-btn.primary:hover {
  border-color: var(--portal-accent-strong);
  background: linear-gradient(180deg, #e4fff5 0%, #bdffe6 45%, #8fffd0 100%);
}

.portal-btn.secondary {
  border-color: rgba(143, 255, 208, 0.28);
  background: linear-gradient(180deg, rgba(143, 255, 208, 0.15), rgba(143, 255, 208, 0.05) 55%, rgba(0, 0, 0, 0.3));
}

.portal-btn.quiet {
  border-color: transparent;
  background: transparent;
  color: var(--portal-muted);
}

.portal-btn.danger {
  border-color: var(--portal-danger-border);
  background: linear-gradient(180deg, #321818, var(--portal-danger-bg) 55%, #120707);
  color: var(--portal-danger);
}

.portal-btn.oauth {
  min-height: 46px;
  border-color: rgba(143, 255, 208, 0.22);
  background: linear-gradient(180deg, #151c19, #0b100e 55%, #050706);
  color: var(--portal-text);
}

.portal-btn.oauth i {
  font-size: 19px;
}

.portal-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}

.portal-btn.full {
  width: 100%;
}

.portal-app {
  min-height: 100dvh;
}

.portal-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100dvh;
  flex-direction: column;
  border-right: 1px solid var(--portal-border);
  background: var(--portal-sidebar);
}

.sidebar-head {
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid var(--portal-border);
}

.sidebar-close {
  display: none;
}

.sidebar-nav {
  display: grid;
  gap: 3px;
  padding: 14px 10px;
}

.sidebar-nav a,
.sidebar-secondary a {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: var(--portal-radius);
  color: var(--portal-muted);
  text-decoration: none;
  font-weight: 620;
}

.sidebar-nav a i,
.sidebar-secondary a i {
  flex: 0 0 auto;
  font-size: 19px;
}

.sidebar-nav a:hover,
.sidebar-secondary a:hover {
  border-color: var(--portal-border);
  background: var(--portal-surface);
  color: var(--portal-text);
}

.sidebar-nav a[aria-current="page"],
.sidebar-secondary a[aria-current="page"] {
  border-color: #28463a;
  background: #11231a;
  color: var(--portal-accent);
}

.sidebar-secondary {
  display: grid;
  gap: 3px;
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--portal-border);
}

.sidebar-account {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 12px 18px;
  border-top: 1px solid var(--portal-border);
}

.account-copy {
  min-width: 0;
}

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

.account-copy strong {
  font-size: 13px;
}

.account-copy span {
  color: var(--portal-faint);
  font-size: 12px;
}

.portal-shell {
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
}

.portal-mobile-head {
  display: none;
}

.portal-content {
  width: min(1180px, calc(100% - 64px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.portal-app.sidebar-collapsed .portal-sidebar {
  width: var(--sidebar-rail);
}

.portal-app.sidebar-collapsed .portal-shell {
  margin-left: var(--sidebar-rail);
}

.portal-app.sidebar-collapsed .portal-sidebar .portal-brand span,
.portal-app.sidebar-collapsed .sidebar-nav a span,
.portal-app.sidebar-collapsed .sidebar-secondary a span,
.portal-app.sidebar-collapsed .account-copy {
  display: none;
}

.portal-app.sidebar-collapsed .sidebar-head {
  justify-content: center;
  padding: 0;
}

.portal-app.sidebar-collapsed .sidebar-head .portal-brand {
  display: none;
}

.portal-app.sidebar-collapsed .sidebar-nav a,
.portal-app.sidebar-collapsed .sidebar-secondary a {
  justify-content: center;
  padding-inline: 0;
}

.portal-app.sidebar-collapsed .sidebar-account {
  justify-content: center;
  padding-inline: 0;
}

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

.page-head h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.page-head p {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--portal-muted);
  font-size: 16px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 38px;
  border-block: 1px solid var(--portal-border);
}

.metric {
  min-width: 0;
  padding: 22px 24px 24px 0;
}

.metric + .metric {
  padding-left: 24px;
  border-left: 1px solid var(--portal-border);
}

.metric span,
.metric small {
  display: block;
}

.metric span {
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 650;
}

.metric strong {
  display: block;
  margin: 7px 0 2px;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.metric small {
  color: var(--portal-faint);
  font-size: 12px;
}

.portal-section {
  margin-top: 24px;
  padding: 26px;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  background: var(--portal-surface);
}

.portal-section.flush {
  padding: 0;
  overflow: hidden;
}

.section-head {
  margin-bottom: 22px;
}

.section-head.row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.section-head p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--portal-muted);
  font-size: 14px;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 34px;
}

.action-list {
  display: grid;
}

.action-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 4px;
  border-top: 1px solid var(--portal-border);
  color: var(--portal-text);
  text-decoration: none;
}

.action-list a:last-child {
  border-bottom: 1px solid var(--portal-border);
}

.action-list a:hover strong {
  color: var(--portal-accent);
}

.action-list strong,
.action-list small {
  display: block;
}

.action-list small {
  margin-top: 3px;
  color: var(--portal-muted);
}

.action-list i {
  color: var(--portal-accent);
  font-size: 20px;
}

.usage-snapshot {
  padding-left: 30px;
  border-left: 1px solid var(--portal-border);
}

.credit-number {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 24px 0 20px;
}

.credit-number strong {
  font-size: 38px;
  letter-spacing: -0.05em;
}

.credit-number span,
.credit-legend {
  color: var(--portal-muted);
}

.credit-rule {
  height: 5px;
  overflow: hidden;
  border-radius: var(--portal-radius);
  background: #1c2d26;
}

.credit-rule span {
  display: block;
  height: 100%;
  max-width: 100%;
  background: var(--portal-accent);
}

.credit-legend {
  display: flex;
  justify-content: space-between;
  margin: 8px 0 24px;
  font-size: 12px;
}

.compact-activity {
  min-height: 110px;
}

.compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--portal-border);
}

.compact-row:last-child {
  border-bottom: 1px solid var(--portal-border);
}

.compact-row strong,
.compact-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-row small,
.compact-row time {
  color: var(--portal-muted);
  font-size: 12px;
}

.status-text {
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 700;
}

.status-text.success {
  color: var(--portal-accent);
}

.status-text.error {
  color: var(--portal-danger);
}

.playground-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.8fr) minmax(0, 1.2fr);
  gap: 20px;
}

.playground-grid .portal-section {
  margin-top: 0;
  padding: 26px;
}

.playground-feedback {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 17px 18px;
  border: 1px solid var(--portal-border);
  background: rgba(10, 20, 15, 0.72);
}

.playground-feedback[hidden],
.feedback-actions[hidden],
.feedback-reasons[hidden] {
  display: none;
}

.playground-feedback > div:first-child {
  display: grid;
  gap: 3px;
  margin-right: auto;
}

.playground-feedback strong {
  font-size: 14px;
}

.playground-feedback span {
  color: var(--portal-muted);
  font-size: 12px;
}

.feedback-actions,
.feedback-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-btn.compact,
.feedback-reasons button {
  min-height: 34px;
  padding: 8px 11px;
  font-size: 12px;
}

.feedback-reasons button {
  border: 1px solid var(--portal-border-strong);
  background: #0b1510;
  color: var(--portal-text);
  cursor: pointer;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.feedback-reasons button:hover {
  border-color: var(--portal-accent);
}

.playground-feedback .form-message {
  flex-basis: 100%;
  margin: 0;
}

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

.portal-form.narrow {
  max-width: 520px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: var(--portal-text);
  font-size: 13px;
  font-weight: 700;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.field-label-row a {
  font-size: 12px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--portal-border-strong);
  border-radius: 0;
  background: #070d0a;
  color: var(--portal-text);
  padding: 10px 12px;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), inset 0 2px 8px rgba(0, 0, 0, 0.28);
}

.field textarea {
  min-height: 132px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #71857b;
  opacity: 1;
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: #406252;
}

.field-help {
  margin: 0;
  color: var(--portal-muted);
  font-size: 12px;
}

.result-console {
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  background: #050806;
}

.result-console header {
  display: flex;
  height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--portal-border);
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 700;
}

.result-console pre {
  min-height: 500px;
  margin: 0;
  overflow: auto;
  padding: 20px;
  color: #c8dfd3;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.form-message {
  display: none;
  padding: 10px 12px;
  border: 1px solid var(--portal-border);
  border-radius: var(--portal-radius);
  color: var(--portal-muted);
  font-size: 13px;
}

.form-message.show {
  display: block;
}

.form-message.error {
  border-color: var(--portal-danger-border);
  background: var(--portal-danger-bg);
  color: var(--portal-danger);
}

.form-message.success {
  border-color: #28553f;
  background: #0d2118;
  color: var(--portal-accent);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.portal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.portal-table th,
.portal-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--portal-border);
  vertical-align: middle;
}

.portal-table th {
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.portal-table td {
  color: #d7eee2;
  font-size: 13px;
}

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

.request-cell {
  max-width: 360px;
}

.request-cell strong,
.request-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-cell small {
  margin-top: 2px;
  color: var(--portal-faint);
}

.empty-state {
  padding: 72px 24px;
  text-align: center;
}

.empty-state i {
  color: var(--portal-accent);
  font-size: 30px;
}

.empty-state h2 {
  margin: 12px 0 4px;
  font-size: 19px;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--portal-muted);
}

.usage-chart {
  display: flex;
  height: 260px;
  align-items: flex-end;
  gap: clamp(3px, 0.8vw, 9px);
  padding: 22px 4px 30px;
  border-bottom: 1px solid var(--portal-border);
}

.chart-day {
  position: relative;
  display: flex;
  min-width: 4px;
  height: 100%;
  flex: 1 1 0;
  align-items: flex-end;
  justify-content: center;
}

.chart-bar {
  width: min(18px, 76%);
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--portal-accent);
}

.chart-bar.has-errors {
  box-shadow: inset 0 3px 0 var(--portal-danger);
}

.chart-day time {
  position: absolute;
  bottom: -24px;
  color: var(--portal-faint);
  font-size: 9px;
}

.chart-legend {
  display: flex;
  gap: 18px;
  padding-top: 14px;
  color: var(--portal-muted);
  font-size: 12px;
}

.chart-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 2px;
}

.legend-credit {
  background: var(--portal-accent);
}

.legend-error {
  background: var(--portal-danger);
}

.security-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid #28523e;
  border-radius: var(--portal-radius);
  background: #0b1c14;
  color: #b8d7c8;
}

.security-note i {
  color: var(--portal-accent);
  font-size: 20px;
}

.security-note p {
  margin: 0;
}

.key-create-panel {
  padding: 18px;
  border-bottom: 1px solid var(--portal-border);
  background: var(--portal-surface-2);
}

.inline-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.inline-form .field {
  width: min(360px, 100%);
}

.keys-table code {
  color: #b3cabe;
  font-size: 12px;
}

.current-plan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  border-block: 1px solid var(--portal-border);
}

.current-plan > div > span {
  color: var(--portal-muted);
  font-size: 13px;
}

.current-plan h2 {
  margin: 3px 0 4px;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.current-plan p {
  margin: 0;
  color: var(--portal-muted);
}

.plan-state {
  text-align: right;
}

.plan-state strong,
.plan-state span {
  display: block;
}

.plan-state strong {
  text-transform: capitalize;
}

.plan-state span {
  color: var(--portal-muted);
  font-size: 12px;
  text-transform: capitalize;
}

.plan-list {
  display: grid;
}

.plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 150px;
  align-items: center;
  gap: 24px;
  padding: 17px 0;
  border-top: 1px solid var(--portal-border);
}

.plan-row:last-child {
  border-bottom: 1px solid var(--portal-border);
}

.plan-row h3,
.plan-row p {
  margin: 0;
}

.plan-row h3 {
  font-size: 16px;
}

.plan-row p {
  color: var(--portal-muted);
  font-size: 13px;
}

.plan-row > strong {
  font-size: 18px;
}

.plan-row > strong small {
  color: var(--portal-muted);
  font-size: 11px;
  font-weight: 500;
}

.account-page-head {
  margin-bottom: 26px;
}

.account-summary {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 22px;
  padding: 24px 0;
  border-block: 1px solid var(--portal-border);
}

.account-avatar {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--portal-border-strong);
  background: linear-gradient(145deg, #153126, #08100c);
  color: var(--portal-accent);
  font-size: 21px;
  font-weight: 800;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}

.account-identity {
  min-width: 0;
}

.account-identity h2,
.account-identity p {
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity h2 {
  font-size: 20px;
  letter-spacing: -0.025em;
}

.account-identity p {
  margin-top: 4px;
  color: var(--portal-muted);
  font-size: 13px;
}

.account-facts {
  display: flex;
  gap: 28px;
  margin: 0;
}

.account-facts > div {
  min-width: 82px;
}

.account-facts dt,
.account-facts dd {
  margin: 0;
}

.account-facts dt {
  color: var(--portal-faint);
  font-size: 11px;
}

.account-facts dd {
  margin-top: 3px;
  color: var(--portal-text);
  font-size: 13px;
  font-weight: 700;
}

.account-settings-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  margin-top: 26px;
}

.account-settings-grid .portal-section {
  min-width: 0;
  margin-top: 0;
}

.account-section-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  margin-bottom: 24px;
}

.account-section-title > i {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--portal-border);
  background: #0c1a14;
  color: var(--portal-accent);
  font-size: 18px;
}

.account-section-title h2,
.account-section-title p {
  margin: 0;
}

.account-section-title h2 {
  font-size: 18px;
  letter-spacing: -0.025em;
}

.account-section-title p {
  margin-top: 4px;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.5;
}

.account-password-form {
  gap: 15px;
}

.account-password-form .portal-btn {
  justify-self: start;
  margin-top: 2px;
}

.session-list {
  display: grid;
  border-top: 1px solid var(--portal-border);
}

.session-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--portal-border);
}

.session-device {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--portal-border);
  color: var(--portal-muted);
  font-size: 16px;
}

.session-row.current .session-device {
  border-color: #28553f;
  background: #0d2118;
  color: var(--portal-accent);
}

.session-copy {
  min-width: 0;
}

.session-row strong,
.session-row small,
.session-row time {
  display: block;
}

.session-row strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-row small,
.session-row time {
  color: var(--portal-muted);
  font-size: 11px;
}

.session-row time {
  text-align: right;
}

.session-current {
  color: var(--portal-accent);
}

.account-logout-others {
  margin-top: 18px;
}

.danger-zone {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 22px;
  border: 1px solid var(--portal-danger-border);
  background: linear-gradient(110deg, rgba(58, 20, 20, 0.42), rgba(27, 12, 12, 0.18));
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%);
}

.danger-zone-icon {
  color: var(--portal-danger);
  font-size: 25px;
}

.danger-zone h2 {
  margin: 0 0 4px;
  color: var(--portal-danger);
  font-size: 18px;
}

.danger-zone p {
  max-width: 690px;
  margin: 0;
  color: #c2a0a0;
  font-size: 13px;
}

.portal-dialog {
  width: min(520px, calc(100% - 32px));
  border: 1px solid var(--portal-border-strong);
  border-radius: 0;
  background: var(--portal-surface);
  color: var(--portal-text);
  padding: 28px;
  box-shadow: 0 28px 80px rgba(3, 9, 6, 0.62);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}

.portal-dialog::backdrop {
  background: rgba(3, 7, 5, 0.76);
  backdrop-filter: blur(3px);
}

.portal-dialog h2 {
  margin: 0 42px 7px 0;
  font-size: 23px;
}

.portal-dialog > p {
  margin: 0 0 22px;
  color: var(--portal-muted);
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.secret-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0;
  padding: 10px 10px 10px 12px;
  border: 1px solid #315846;
  border-radius: var(--portal-radius);
  background: #07110c;
}

.secret-row code {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  color: var(--portal-accent);
  font-size: 12px;
}

.danger-dialog {
  border-color: var(--portal-danger-border);
}

.portal-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: 360px;
  padding: 12px 15px;
  border: 1px solid #35634e;
  border-radius: var(--portal-radius);
  background: #102219;
  color: var(--portal-text);
  box-shadow: 0 14px 44px rgba(3, 9, 6, 0.5);
}

.skeleton-lines {
  display: grid;
  gap: 11px;
  padding: 10px 0;
}

.skeleton-lines span,
.skeleton-chart {
  display: block;
  border-radius: var(--portal-radius);
  background: #18251f;
}

.skeleton-lines span {
  width: 100%;
  height: 14px;
}

.skeleton-lines span:nth-child(2) {
  width: 82%;
}

.skeleton-lines span:nth-child(3) {
  width: 64%;
}

.skeleton-chart {
  width: 100%;
  height: 180px;
}

.portal-scrim {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: rgba(3, 7, 5, 0.72);
}

/* Authentication */
.portal-auth {
  display: grid;
  grid-template-rows: auto 1fr;
}

.auth-topbar {
  display: flex;
  width: min(1180px, calc(100% - 48px));
  height: 76px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--portal-border);
}

.auth-topbar p {
  margin: 0;
  color: var(--portal-muted);
}

.auth-topbar a {
  font-weight: 700;
}

.auth-main {
  display: grid;
  width: min(460px, calc(100% - 48px));
  min-height: calc(100dvh - 76px);
  margin: 0 auto;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 30px;
  padding: 56px 0 96px;
}

.auth-intro h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 50px);
  line-height: 1;
  letter-spacing: -0.055em;
  text-align: center;
}

.auth-intro p {
  margin: 15px auto 0;
  color: var(--portal-muted);
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
}

.auth-panel {
  padding: 30px;
  border: 1px solid var(--portal-border);
  border-radius: 0;
  background: linear-gradient(155deg, rgba(143, 255, 208, 0.045), rgba(10, 20, 16, 0.98) 38%);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 24px 80px rgba(0, 0, 0, 0.3);
}

.auth-panel > .form-message.show:first-of-type {
  margin-bottom: 18px;
}

.auth-switch {
  margin: 22px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--portal-border);
  color: var(--portal-muted);
  font-size: 13px;
  text-align: center;
}

.auth-switch a {
  font-weight: 700;
}

.oauth-buttons {
  display: grid;
  gap: 10px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--portal-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--portal-border);
}

.auth-note {
  margin: 0;
  color: var(--portal-muted);
}

.one-time-secret {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--portal-border);
}

.one-time-secret h2 {
  margin: 0 0 5px;
  font-size: 20px;
}

.one-time-secret > p {
  margin: 0;
  color: var(--portal-muted);
}

.documentation-head {
  margin-bottom: 22px;
}

.documentation-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}

.documentation-index {
  position: sticky;
  top: 30px;
  display: grid;
  gap: 2px;
  padding-top: 4px;
}

.documentation-index strong {
  margin-bottom: 8px;
  color: var(--portal-muted);
  font-size: 13px;
}

.documentation-index a {
  padding: 7px 0;
  color: var(--portal-muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.documentation-index a:hover {
  color: var(--portal-accent);
}

.documentation-body {
  min-width: 0;
  border-top: 1px solid var(--portal-border);
}

.documentation-section {
  scroll-margin-top: 28px;
  padding: 38px 0 42px;
  border-bottom: 1px solid var(--portal-border);
}

.documentation-section:first-child {
  padding-top: 30px;
}

.documentation-section-head {
  max-width: 760px;
  margin-bottom: 24px;
}

.documentation-section-head h2 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.035em;
}

.documentation-section-head p {
  margin: 9px 0 0;
  color: var(--portal-muted);
  font-size: 14px;
  line-height: 1.7;
}

.documentation-section code {
  color: var(--portal-accent-strong);
  font-size: 0.9em;
}

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

.documentation-paths > a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 100px;
  padding: 18px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface);
  color: var(--portal-text);
  text-decoration: none;
}

.documentation-paths > a:hover {
  border-color: var(--portal-border-strong);
  background: var(--portal-surface-2);
}

.documentation-paths > a > i:first-child {
  color: var(--portal-accent);
  font-size: 23px;
}

.documentation-paths > a > i:last-child {
  color: var(--portal-faint);
}

.documentation-paths strong,
.documentation-paths small {
  display: block;
}

.documentation-paths small {
  margin-top: 4px;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.45;
}

.documentation-code {
  overflow: hidden;
  border: 1px solid var(--portal-border);
  background: #030604;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.documentation-code-head {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 6px 17px;
  border-bottom: 1px solid var(--portal-border);
  color: var(--portal-muted);
  font-size: 12px;
  font-weight: 700;
}

.documentation-code pre {
  margin: 0;
  overflow-x: auto;
  padding: 20px;
  color: #c8dfd3;
  font-size: 12px;
  line-height: 1.7;
}

.documentation-code pre code {
  color: inherit;
  font-size: inherit;
}

.documentation-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 15px 0 0;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.55;
}

.documentation-note i {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--portal-accent);
  font-size: 17px;
}

.documentation-reference {
  margin: 0;
  border-top: 1px solid var(--portal-border);
}

.documentation-reference > div {
  display: grid;
  grid-template-columns: minmax(135px, 0.35fr) minmax(0, 1fr);
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--portal-border);
}

.documentation-reference dt {
  color: var(--portal-text);
  font-weight: 700;
}

.documentation-reference dd {
  min-width: 0;
  margin: 0;
  color: var(--portal-muted);
}

.documentation-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--portal-border);
}

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

.documentation-table th,
.documentation-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--portal-border);
  text-align: left;
  vertical-align: top;
}

.documentation-table th {
  color: var(--portal-faint);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.documentation-table td {
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.6;
}

.documentation-table tr:last-child td {
  border-bottom: 0;
}

.documentation-table td:first-child {
  width: 185px;
  color: var(--portal-text);
}

.endpoint-list {
  display: grid;
  border-top: 1px solid var(--portal-border);
}

.endpoint-list > div {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--portal-border);
}

.endpoint-list span {
  color: var(--portal-muted);
  font-size: 13px;
}

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

.documentation-callouts > div {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--portal-border);
  background: var(--portal-surface);
}

.documentation-callouts i {
  display: block;
  margin-bottom: 22px;
  color: var(--portal-accent);
  font-size: 22px;
}

.documentation-callouts strong,
.documentation-callouts small {
  display: block;
}

.documentation-callouts small {
  margin-top: 7px;
  color: var(--portal-muted);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .account-summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .account-facts {
    grid-column: 2 / 4;
  }

  .account-settings-grid {
    grid-template-columns: 1fr;
  }

  .documentation-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .documentation-index {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-bottom: 18px;
    border-bottom: 1px solid var(--portal-border);
  }

  .documentation-index strong {
    grid-column: 1 / -1;
  }

  .documentation-index a {
    padding: 4px 0;
  }

  .documentation-body {
    border-top: 0;
  }

  .documentation-callouts {
    grid-template-columns: 1fr;
  }

  .documentation-callouts > div {
    min-height: 0;
  }

  .documentation-callouts i {
    margin-bottom: 14px;
  }

  .portal-content {
    width: min(100% - 40px, 900px);
  }

  .overview-grid,
  .playground-grid {
    grid-template-columns: 1fr;
  }

  .playground-feedback {
    align-items: flex-start;
    flex-direction: column;
  }

  .usage-snapshot {
    padding: 28px 0 0;
    border-top: 1px solid var(--portal-border);
    border-left: 0;
  }

  .result-console {
    min-height: 420px;
  }

  .result-console pre {
    min-height: 360px;
  }

  .auth-main {
    gap: 30px;
  }
}

@media (max-width: 760px) {
  .portal-sidebar {
    width: min(310px, calc(100% - 42px));
    transform: translateX(-102%);
  }

  .portal-sidebar.mobile-open {
    transform: translateX(0);
  }

  .portal-sidebar .sidebar-close {
    display: inline-grid;
  }

  .portal-sidebar .sidebar-collapse {
    display: none;
  }

  .portal-shell,
  .portal-app.sidebar-collapsed .portal-shell {
    margin-left: 0;
  }

  .portal-app.sidebar-collapsed .portal-sidebar {
    width: min(310px, calc(100% - 42px));
  }

  .portal-app.sidebar-collapsed .sidebar-nav a span,
  .portal-app.sidebar-collapsed .sidebar-secondary a span,
  .portal-app.sidebar-collapsed .account-copy {
    display: initial;
  }

  .portal-app.sidebar-collapsed .sidebar-head {
    justify-content: space-between;
    padding: 0 16px 0 18px;
  }

  .portal-app.sidebar-collapsed .sidebar-head .portal-brand {
    display: inline-flex;
  }

  .portal-app.sidebar-collapsed .sidebar-nav a,
  .portal-app.sidebar-collapsed .sidebar-secondary a {
    justify-content: space-between;
    padding-inline: 11px;
  }

  .portal-app.sidebar-collapsed .sidebar-account {
    justify-content: space-between;
    padding: 12px 12px 12px 18px;
  }

  .portal-mobile-head {
    display: flex;
    height: 62px;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid var(--portal-border);
    background: var(--portal-sidebar);
  }

  .portal-content {
    width: min(100% - 30px, 680px);
    padding: 30px 0 60px;
  }

  .page-head {
    min-height: 0;
    flex-direction: column;
    margin-bottom: 26px;
  }

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

  .documentation-paths {
    grid-template-columns: 1fr;
  }

  .documentation-reference > div,
  .endpoint-list > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .documentation-table {
    min-width: 600px;
  }

  .documentation-section {
    padding: 32px 0 36px;
  }

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

  .metric,
  .metric + .metric {
    padding: 16px 0;
    border-left: 0;
  }

  .metric + .metric {
    border-top: 1px solid var(--portal-border);
  }

  .portal-section {
    padding: 20px;
  }

  .section-head.row,
  .current-plan {
    align-items: flex-start;
    flex-direction: column;
  }

  .plan-state {
    text-align: left;
  }

  .plan-row {
    grid-template-columns: 1fr auto;
  }

  .plan-row .portal-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form .field {
    width: 100%;
  }

  .account-summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .account-facts {
    grid-column: 1 / -1;
    justify-content: space-between;
    width: 100%;
    padding-top: 16px;
    border-top: 1px solid var(--portal-border);
  }

  .account-summary > .portal-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .session-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .session-row time {
    grid-column: 2;
    text-align: left;
  }

  .danger-zone {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .danger-zone .portal-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .auth-topbar {
    width: calc(100% - 32px);
  }

  .auth-topbar p {
    font-size: 13px;
  }

  .auth-main {
    width: calc(100% - 32px);
    align-content: start;
    padding: 46px 0 70px;
  }

  .auth-intro h1 {
    font-size: clamp(34px, 10vw, 46px);
  }

  .auth-intro p {
    margin-top: 15px;
    font-size: 16px;
  }

  .auth-panel {
    padding: 22px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .portal-sidebar {
    transition: transform 180ms ease;
  }

  .portal-btn,
  .icon-btn,
  .sidebar-nav a,
  .sidebar-secondary a {
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 80ms ease;
  }
}
