* {
  box-sizing: border-box;
}

body.dashboard-page {
  --noah-bg: #09090b;
  --noah-bg-2: #121215;
  --noah-surface: rgba(18, 18, 21, .90);
  --noah-surface-2: #1e1e22;
  --noah-surface-3: #27272b;
  --noah-muted: #a1a1aa;
  --noah-soft: #71717a;
  background: #16181d;
}

html[data-noah-theme="dim"] body.dashboard-page {
  --noah-bg: #111318;
  --noah-bg-2: #181b21;
  --noah-surface: rgba(24, 27, 33, .92);
  --noah-surface-2: #20242c;
  --noah-surface-3: #2a303a;
  background: #16181d;
}

body {
  min-height: 100vh;
}

button,
input {
  font: inherit;
}

.dashboard-app {
  position: relative;
  min-height: 100vh;
}

.dashboard-sidebar {
  position: fixed;
  inset: 16px auto 16px 16px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: 268px;
  padding: 17px 14px 14px;
  border: 1px solid var(--noah-border);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(18, 18, 21, .97), rgba(11, 11, 14, .95));
  box-shadow: var(--noah-shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transition: transform .3s var(--noah-ease);
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 18px;
}

.dashboard-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--noah-text);
  font: 700 16px var(--noah-font-mono);
  letter-spacing: -.04em;
}

.dashboard-brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  color: #07110d;
  background: linear-gradient(135deg, var(--noah-lime), var(--noah-cyan));
  box-shadow: 0 0 24px rgba(134, 232, 220, .14);
}

.dashboard-brand.noah-brand-pill {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-brand-mark.noah-brand-mark {
  width: 31px;
  height: 31px;
  border-radius: 10px 10px 10px 4px;
  color: #111;
  background: var(--noah-lime);
  font: 700 14px/1 var(--noah-font-mono);
  transform: rotate(-8deg);
}

.dashboard-brand .noah-brand-word {
  font: 800 17px/1.5 var(--noah-font-sans);
}

.sidebar-collapse,
.mobile-menu-button,
.topbar-icon-button,
.topbar-user,
.user-menu-button,
.text-button {
  border: 0;
  color: var(--noah-muted);
  background: transparent;
}

.sidebar-collapse {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.sidebar-collapse:hover,
.mobile-menu-button:hover,
.topbar-icon-button:hover,
.topbar-user:hover,
.user-menu-button:hover,
.text-button:hover {
  color: var(--noah-text);
  background: rgba(255, 255, 255, .06);
}

.sidebar-collapse svg,
.mobile-menu-button svg,
.topbar-icon-button svg,
.topbar-user svg,
.user-menu-button svg,
.text-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.new-chat-button {
  width: 100%;
  min-height: 43px;
  margin-bottom: 22px;
  border-radius: 13px;
}

.new-chat-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-label {
  padding: 0 10px 7px;
  color: var(--noah-soft);
  font: 600 10px var(--noah-font-mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}

.nav-label-spaced {
  margin-top: 21px;
}

.dashboard-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--noah-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: color .2s var(--noah-ease), background .2s var(--noah-ease), border-color .2s var(--noah-ease), transform .2s var(--noah-ease);
}

a.dashboard-nav-item {
  text-decoration: none;
}

.dashboard-nav-item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-nav-item:hover {
  color: var(--noah-text);
  background: rgba(255, 255, 255, .05);
  border-color: var(--noah-border);
  transform: translateX(2px);
}

.dashboard-nav-item.active {
  color: #07110d;
  border-color: transparent;
  background: linear-gradient(135deg, var(--noah-lime), var(--noah-cyan));
  box-shadow: 0 10px 24px rgba(34, 197, 94, .13);
}

.nav-count {
  min-width: 21px;
  margin-left: auto;
  padding: 3px 6px;
  border-radius: 999px;
  color: var(--noah-muted);
  background: rgba(255, 255, 255, .08);
  font: 600 10px var(--noah-font-mono);
  text-align: center;
}

.dashboard-nav-item.active .nav-count {
  color: #07110d;
  background: rgba(7, 17, 13, .12);
}

.sidebar-bottom {
  display: grid;
  gap: 13px;
  margin-top: auto;
  padding-top: 16px;
}

.sidebar-credit-mini {
  padding: 13px;
  border: 1px solid var(--noah-border);
  border-radius: 15px;
  background: rgba(255, 255, 255, .035);
}

.mini-credit-head,
.mini-credit-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--noah-muted);
  font: 10px var(--noah-font-mono);
}

.mini-credit-head {
  margin-bottom: 10px;
  color: var(--noah-text);
}

.mini-credit-head span:last-child {
  color: var(--noah-lime);
}

.sidebar-credit-mini .noah-progress {
  height: 7px;
}

.mini-credit-foot {
  margin-top: 8px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background .2s ease, border-color .2s ease;
}

.sidebar-user:hover {
  border-color: var(--noah-border);
  background: rgba(255, 255, 255, .04);
}

.user-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(134, 232, 220, .35);
  border-radius: 11px;
  color: #07110d;
  background: linear-gradient(135deg, var(--noah-cyan), var(--noah-lime));
  font: 700 13px var(--noah-font-mono);
}

.user-avatar.small {
  width: 31px;
  height: 31px;
  border-radius: 10px;
  font-size: 11px;
}

.user-avatar.large {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  font-size: 18px;
}

.sidebar-user-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.sidebar-user-copy strong {
  overflow: hidden;
  color: var(--noah-text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy span {
  overflow: hidden;
  color: var(--noah-soft);
  font: 10px var(--noah-font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  border-radius: 8px;
}

.dashboard-main {
  min-height: 100vh;
  margin-left: 300px;
}

.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 16px clamp(22px, 4vw, 58px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(9, 9, 11, .82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-actions,
.topbar-user,
.connection-status,
.card-heading-row,
.window-line,
.welcome-row,
.view-heading,
.connection-detail {
  display: flex;
  align-items: center;
}

.topbar-left {
  gap: 14px;
}

.topbar-kicker,
.card-kicker {
  display: block;
  color: var(--noah-soft);
  font: 600 10px var(--noah-font-mono);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.dashboard-topbar h1 {
  margin: 5px 0 0;
  color: var(--noah-text);
  font: 700 20px var(--noah-font-mono);
  letter-spacing: -.05em;
}

.topbar-actions {
  gap: 10px;
}

.connection-status {
  gap: 7px;
  color: var(--noah-muted);
  font: 10px var(--noah-font-mono);
}

.connection-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--noah-amber);
  box-shadow: 0 0 10px rgba(255, 157, 103, .5);
}

.connection-status.connected i {
  background: var(--noah-lime);
  box-shadow: 0 0 10px rgba(34, 197, 94, .6);
}

.connection-status.error i {
  background: var(--noah-rose);
  box-shadow: 0 0 10px rgba(251, 113, 133, .5);
}

.topbar-icon-button {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  border: 1px solid var(--noah-border);
  border-radius: 12px;
}

.topbar-icon-button.spinning svg {
  animation: dashboardSpin .7s linear infinite;
}

.topbar-user {
  gap: 8px;
  padding: 4px 7px 4px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.profile-menu-wrap {
  position: relative;
}

.profile-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 236px;
  gap: 8px;
  padding: 15px;
  border-radius: 17px;
  background: linear-gradient(180deg, rgba(39, 39, 43, .98), rgba(18, 18, 21, .98));
  box-shadow: 0 22px 55px rgba(0, 0, 0, .42);
  transform-origin: top right;
  animation: profilePopoverIn .18s var(--noah-ease);
}

/* Author styles set display:grid above; keep the semantic hidden state authoritative. */
.profile-popover[hidden] {
  display: none;
}

.popover-kicker {
  color: var(--noah-soft);
  font: 600 9px var(--noah-font-mono);
  letter-spacing: .11em;
  text-transform: uppercase;
}

.profile-popover > strong {
  overflow: hidden;
  color: var(--noah-text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popover-link,
.popover-logout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--noah-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
}

.popover-link:hover,
.popover-logout:hover {
  color: var(--noah-text);
  border-color: var(--noah-border);
  background: rgba(255, 255, 255, .06);
}

.popover-link span {
  color: var(--noah-cyan);
}

.popover-logout {
  color: #fecdd3;
}

.topbar-user svg {
  width: 14px;
  height: 14px;
}

.mobile-menu-button {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--noah-border);
  border-radius: 11px;
}

.dashboard-content {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 70px;
}

.dashboard-view {
  display: none;
  contain: layout style;
}

.dashboard-view.active {
  display: block;
}

.welcome-row {
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.welcome-row h2,
.view-heading h2 {
  margin: 10px 0 0;
  color: var(--noah-text);
  font: 700 clamp(31px, 4vw, 54px) / .98 var(--noah-font-mono);
  letter-spacing: -.08em;
}

.welcome-row h2 em {
  color: var(--noah-cyan);
  font-style: normal;
}

.welcome-row p,
.view-heading p {
  max-width: 600px;
  margin: 14px 0 0;
  color: var(--noah-muted);
  font-size: 14px;
  line-height: 1.7;
}

.welcome-row .noah-button svg,
.view-heading .noah-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.metric-card {
  padding: 20px;
  transition: transform .25s var(--noah-ease), border-color .25s var(--noah-ease);
}

.metric-card:hover,
.dashboard-card:hover,
.usage-hero:hover {
  transform: translateY(-3px);
  border-color: var(--noah-border-strong);
}

.metric-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 19px;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.metric-icon.lime { color: var(--noah-lime); background: rgba(34, 197, 94, .12); }
.metric-icon.cyan { color: var(--noah-cyan); background: rgba(134, 232, 220, .11); }
.metric-icon.amber { color: var(--noah-amber); background: rgba(255, 157, 103, .11); }

.metric-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-label {
  color: var(--noah-muted);
  font: 600 11px var(--noah-font-mono);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.metric-value {
  display: block;
  margin-bottom: 7px;
  color: var(--noah-text);
  font: 700 27px var(--noah-font-mono);
  letter-spacing: -.06em;
}

.metric-detail {
  display: block;
  min-height: 18px;
  color: var(--noah-soft);
  font-size: 11px;
  line-height: 1.5;
}

.overview-grid,
.account-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-card,
.usage-hero {
  padding: 23px;
  transition: transform .25s var(--noah-ease), border-color .25s var(--noah-ease);
}

.card-heading-row {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.card-heading-row h3,
.dashboard-card h3,
.usage-hero h3 {
  margin: 7px 0 0;
  color: var(--noah-text);
  font: 700 20px var(--noah-font-mono);
  letter-spacing: -.06em;
}

.card-heading-row > h3 {
  margin: 0;
  font-size: 16px;
}

.window-block {
  padding: 15px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.window-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.window-line {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  color: var(--noah-muted);
  font-size: 12px;
}

.window-line strong {
  color: var(--noah-text);
  font: 600 11px var(--noah-font-mono);
}

.window-block small,
.usage-windows small,
.plan-card small {
  display: block;
  margin-top: 9px;
  color: var(--noah-soft);
  font: 10px var(--noah-font-mono);
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--noah-cyan);
  font-size: 12px;
  font-weight: 700;
}

.card-link:hover {
  color: var(--noah-lime);
}

.plan-orb {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 157, 103, .27);
  border-radius: 14px;
  color: #17100a;
  background: linear-gradient(135deg, var(--noah-amber), #ffd1af);
  font: 700 16px var(--noah-font-mono);
}

.plan-overview > p,
.usage-hero p,
.dashboard-card > p,
.dashboard-card h3 + p {
  margin: 0;
  color: var(--noah-muted);
  font-size: 13px;
  line-height: 1.7;
}

.plan-feature-list {
  display: grid;
  gap: 10px;
  margin: 22px 0 4px;
}

.plan-feature-list div {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--noah-muted);
  font-size: 12px;
}

.plan-feature-list i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--noah-lime);
  box-shadow: 0 0 9px rgba(34, 197, 94, .5);
}

.recent-card {
  margin-bottom: 16px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  color: var(--noah-cyan);
  font-size: 11px;
  font-weight: 700;
}

.text-button span {
  font-size: 14px;
}

.view-heading {
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.view-heading h2 {
  font-size: clamp(31px, 4vw, 50px);
}

.usage-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.usage-hero h3 {
  font-size: 29px;
}

.usage-windows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.usage-windows .dashboard-card {
  padding: 20px;
}

.usage-windows .card-heading-row {
  margin-bottom: 17px;
}

.usage-windows .card-heading-row h3 {
  font-size: 15px;
}

.usage-windows .card-heading-row strong {
  color: var(--noah-text);
  font: 600 12px var(--noah-font-mono);
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 14px;
}

.plan-grid.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 21px;
}

.plan-card.current {
  border-color: rgba(34, 197, 94, .4);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, .08), var(--noah-shadow-soft);
}

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

.plan-card h3 {
  margin: 0;
  font-size: 18px;
}

.plan-card p {
  flex: 1;
  margin: 0 0 16px;
  color: var(--noah-muted);
  font-size: 12px;
  line-height: 1.6;
}

.plan-limits {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.plan-limits span {
  color: var(--noah-muted);
  font: 11px var(--noah-font-mono);
}

.plan-card .noah-button {
  width: 100%;
  min-height: 39px;
  margin-top: auto;
  font-size: 12px;
}

.account-grid {
  align-items: start;
}

.profile-form {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.profile-form label {
  margin-top: 6px;
  color: var(--noah-muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-form .noah-button {
  width: max-content;
  margin-top: 9px;
}

.connection-detail {
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 18px;
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: var(--noah-muted);
  font-size: 12px;
}

.connection-detail strong {
  color: var(--noah-lime);
  font: 600 11px var(--noah-font-mono);
}

#logout-button {
  width: 100%;
  margin-top: 8px;
}

.sidebar-scrim {
  display: none;
}

.noah-reveal {
  opacity: 0;
  transform: translateY(15px);
}

.noah-reveal.show {
  opacity: 1;
  transform: none;
  transition: opacity .55s var(--noah-ease), transform .55s var(--noah-ease);
  transition-delay: var(--noah-reveal-delay, 0ms);
}

html.dashboard-drawer-open,
body.dashboard-drawer-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.account-summary-grid,
.api-management-grid,
.api-lists-grid,
.account-security-grid,
.account-preferences-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

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

.account-summary-card {
  display: grid;
  gap: 7px;
  padding: 17px 19px;
}

.account-summary-card > span,
.api-usage-number > span {
  color: var(--noah-soft);
  font: 600 10px var(--noah-font-mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.account-summary-card strong {
  color: var(--noah-text);
  font: 700 25px var(--noah-font-mono);
  letter-spacing: -.06em;
}

.account-summary-card small {
  color: var(--noah-muted);
  font-size: 11px;
}

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

.account-preferences-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr);
}

.preference-card > p,
.preference-api-card > p {
  max-width: 560px;
}

.preference-orb {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid rgba(134, 232, 220, .26);
  border-radius: 13px;
  color: #08120d;
  background: linear-gradient(135deg, var(--noah-cyan), var(--noah-lime));
  font: 700 10px var(--noah-font-mono);
}

.preferences-form {
  gap: 10px;
}

.preferences-form .noah-textarea {
  min-height: 126px;
  resize: vertical;
  line-height: 1.6;
}

.preferences-form .noah-select {
  appearance: auto;
  min-height: 47px;
}

.preference-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: -2px;
  color: var(--noah-soft);
  font: 10px var(--noah-font-mono);
}

.preference-api-card {
  display: flex;
  flex-direction: column;
}

.preference-api-points {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.preference-api-points span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--noah-muted);
  font-size: 12px;
}

.preference-api-points i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--noah-lime);
  box-shadow: 0 0 9px rgba(34, 197, 94, .45);
}

.preference-api-card .noah-button {
  width: max-content;
  margin-top: auto;
}

.danger-card {
  border-color: rgba(251, 113, 133, .18);
}

.noah-button.danger {
  color: #fff1f2;
  border-color: rgba(251, 113, 133, .28);
  background: rgba(251, 113, 133, .13);
}

.noah-button.danger:hover {
  border-color: rgba(251, 113, 133, .48);
  background: rgba(251, 113, 133, .20);
  box-shadow: 0 12px 28px rgba(251, 113, 133, .12);
}

.api-management-grid,
.api-lists-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
}

.api-lists-grid {
  align-items: start;
}

.api-orb {
  width: 52px;
  color: #10120b;
  background: linear-gradient(135deg, var(--noah-lime), var(--noah-cyan));
  font-size: 11px;
}

.api-create-card > p {
  max-width: 560px;
}

.api-key-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 20px;
}

.api-key-form label {
  grid-column: 1 / -1;
  color: var(--noah-muted);
  font-size: 12px;
  font-weight: 700;
}

.api-key-form .noah-button {
  min-height: 46px;
  white-space: nowrap;
}

.api-secret-reveal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 14px;
  margin-top: 16px;
  padding: 13px;
  border: 1px solid rgba(34, 197, 94, .28);
  border-radius: 14px;
  background: rgba(34, 197, 94, .08);
}

.api-secret-reveal[hidden] {
  display: none;
}

.api-secret-reveal strong {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: #d9ffe5;
  font: 600 11px var(--noah-font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-secret-reveal small {
  grid-column: 1 / -1;
  color: var(--noah-muted);
  font-size: 10px;
}

.api-cli-profile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px 12px;
  margin-top: 12px;
  padding: 12px 13px;
  border: 1px solid rgba(134, 232, 220, .18);
  border-radius: 14px;
  background: rgba(134, 232, 220, .045);
}

.api-cli-profile > div { display: grid; gap: 4px; }
.api-cli-profile strong { color: var(--noah-text); font-size: 12px; }
.api-cli-profile > code { overflow: hidden; color: var(--noah-cyan); font: 600 10px var(--noah-font-mono); text-overflow: ellipsis; white-space: nowrap; }
.api-cli-profile small { grid-column: 1 / -1; color: var(--noah-muted); font-size: 10px; line-height: 1.55; }
.api-cli-profile small code { color: var(--noah-soft); font: 600 10px var(--noah-font-mono); }

.api-usage-card {
  display: grid;
  align-content: start;
}

.api-usage-number {
  display: grid;
  gap: 5px;
  margin: 7px 0 20px;
}

.api-usage-number strong {
  color: var(--noah-text);
  font: 700 35px var(--noah-font-mono);
  letter-spacing: -.08em;
}

.api-usage-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: var(--noah-muted);
  font-size: 12px;
}

.api-usage-meta strong {
  color: var(--noah-text);
  font: 600 11px var(--noah-font-mono);
}

.api-key-count {
  color: var(--noah-soft);
  font: 600 10px var(--noah-font-mono);
}

.api-key-list,
.api-request-list {
  display: grid;
  gap: 8px;
}

.api-key-row,
.api-request-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  background: rgba(255, 255, 255, .025);
}

.api-key-row-copy,
.api-request-row-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.api-key-row-copy strong,
.api-request-row-copy strong {
  overflow: hidden;
  color: var(--noah-text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-row-copy span,
.api-request-row-copy span {
  overflow: hidden;
  color: var(--noah-soft);
  font: 10px var(--noah-font-mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-row .revoke-key {
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid rgba(251, 113, 133, .20);
  border-radius: 8px;
  color: #fecdd3;
  background: rgba(251, 113, 133, .07);
  font: 600 10px var(--noah-font-mono);
}

.api-key-row .revoke-key:hover {
  background: rgba(251, 113, 133, .15);
}

.api-key-row.is-revoked {
  opacity: .62;
}

.api-request-row > strong {
  flex: 0 0 auto;
  color: var(--noah-lime);
  font: 600 10px var(--noah-font-mono);
}

@keyframes profilePopoverIn {
  from { opacity: 0; transform: translate3d(0, -5px, 0) scale(.98); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

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

@media (max-width: 1050px) {
  .dashboard-sidebar {
    width: 245px;
  }

  .dashboard-main {
    margin-left: 277px;
  }

  .dashboard-content {
    width: min(100% - 38px, 1000px);
  }

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

@media (max-width: 820px) {
  .dashboard-sidebar {
    inset: 0 auto 0 0;
    width: min(320px, calc(100vw - 36px));
    border-top: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 0;
    transform: translateX(-100%);
  }

  .dashboard-sidebar.open {
    transform: none;
  }

  .sidebar-collapse,
  .mobile-menu-button {
    display: grid;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  .sidebar-scrim.open {
    display: block;
  }

  .dashboard-main {
    margin-left: 0;
  }

  .dashboard-topbar {
    padding: 14px 20px;
  }

  .dashboard-content {
    width: min(100% - 34px, 720px);
    padding-top: 35px;
  }

  .connection-status {
    display: none;
  }

  .overview-grid,
  .account-grid,
  .api-management-grid,
  .api-lists-grid,
  .account-security-grid,
  .account-preferences-grid {
    grid-template-columns: 1fr;
  }

  .profile-popover {
    right: -4px;
  }
}

@media (max-width: 580px) {
  .dashboard-topbar h1 {
    font-size: 17px;
  }

  .topbar-user > span:last-of-type {
    display: none;
  }

  .dashboard-content {
    width: min(100% - 24px, 520px);
    padding-top: 28px;
  }

  .welcome-row,
  .view-heading,
  .usage-hero {
    display: block;
  }

  .welcome-row .noah-button,
  .view-heading .noah-button {
    width: fit-content;
    min-width: 180px;
    margin: 22px auto 0;
  }

  .stats-grid,
  .usage-windows,
  .account-summary-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card,
  .usage-hero {
    padding: 18px;
  }

  .usage-hero .noah-badge {
    margin-top: 16px;
  }

}

/* Compact, neutral workspace treatment inspired by data-dense operations apps. */
.dashboard-sidebar {
  inset: 12px auto 12px 12px;
  width: 256px;
  padding: 15px 12px 12px;
  border-radius: 18px;
  background: #1b1e24;
  box-shadow: 0 20px 54px rgba(0, 0, 0, .28);
}

.dashboard-main { margin-left: 280px; }

.dashboard-topbar {
  min-height: 68px;
  padding: 13px clamp(20px, 3vw, 46px);
  background: rgba(22, 24, 29, .9);
}

.dashboard-content { width: min(1160px, calc(100% - 44px)); padding-top: 38px; }

.sidebar-open-chat {
  width: 100%;
  min-height: 38px;
  margin-bottom: 18px;
  padding: 8px 11px;
  border-radius: 10px;
  color: var(--noah-text) !important;
  background: rgba(255, 255, 255, .07) !important;
  border-color: rgba(255, 255, 255, .12) !important;
  box-shadow: none !important;
  font-size: 12px;
}

.sidebar-open-chat:hover { background: rgba(255, 255, 255, .11) !important; border-color: rgba(255, 255, 255, .2) !important; }
.sidebar-open-chat svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.dashboard-nav-item.active {
  color: var(--noah-text);
  border-color: rgba(255,255,255,.10);
  background: rgba(255,255,255,.09);
  box-shadow: none;
}

.dashboard-nav-item.active .nav-count { color: var(--noah-text); background: rgba(255,255,255,.09); }
.dashboard-sidebar .noah-button, .dashboard-content > .noah-button, .dashboard-page .noah-button { min-height: 38px; padding: 8px 12px; border-radius: 10px; font-size: 12px; box-shadow: none; }
.dashboard-page .noah-button.primary { color: #121418; background: var(--noah-lime); }
.dashboard-page .noah-button.primary:hover { box-shadow: 0 8px 20px rgba(34,197,94,.16); }
.dashboard-page .glass-panel, .dashboard-page .glass-card { background: #20242c; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.dashboard-page .dashboard-card, .dashboard-page .metric-card { border-color: rgba(255,255,255,.08); }
.metric-card { min-height: 132px; }
.metric-card:hover, .dashboard-card:hover { transform: translate3d(0, -2px, 0); border-color: rgba(255,255,255,.15); }
.welcome-row h2, .view-heading h2 { font-family: var(--noah-font-sans); font-weight: 700; letter-spacing: -.055em; }
.welcome-row h2 em { color: var(--noah-text); }
.plan-orb, .preference-orb { background: rgba(255,255,255,.08); color: var(--noah-muted); box-shadow: none; }
.api-create-card [disabled] { cursor: not-allowed; opacity: .58; }

@media (max-width: 1050px) {
  .dashboard-main { margin-left: 0; }
  .dashboard-sidebar { inset: 0 auto 0 0; width: min(292px, calc(100vw - 34px)); border-radius: 0; }
}

@media (max-width: 580px) {
  .dashboard-content { width: min(100% - 24px, 520px); }
  .welcome-row .noah-button, .view-heading .noah-button { min-width: 0; margin-left: 0; }
}

/* Referral card: a compact One API-style share surface. */
.referral-card { min-height: 210px; }
.referral-card p { max-width: 460px; }
.referral-orb { color: var(--noah-lime) !important; background: rgba(34,197,94,.1) !important; }
.referral-link-box { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 17px; padding: 8px 9px 8px 12px; border: 1px solid rgba(134,232,220,.18); border-radius: 11px; background: rgba(255,255,255,.035); }
.referral-link-box code { min-width: 0; flex: 1; overflow: hidden; color: var(--noah-cyan); font: 500 10px var(--noah-font-mono); text-overflow: ellipsis; white-space: nowrap; }
.referral-link-box .copy-button { flex: 0 0 auto; }
.referral-card .copy-button:disabled { cursor: not-allowed; opacity: .45; }
.referral-note { display: block; margin-top: 10px; color: var(--noah-soft); font-size: 9px; line-height: 1.45; }
