/* Клиентский Portal — native CSS. Токены из portal-color-system-spec-20260428.
   Dark: класс html.dark (theme-boot + centariumChrome), не auto prefers-color-scheme. */
:root {
  color-scheme: light;
  --background: #fbfbfa;
  --foreground: #161d21;
  --primary: #2f5a64;
  --primary-foreground: #f8fbfc;
  --secondary: #f2eee7;
  --secondary-foreground: #414d54;
  --muted: #f2f5f6;
  --muted-foreground: #58636a;
  --accent: #e9eff1;
  --accent-foreground: #22464f;
  --destructive: #b8645b;
  --border: #d9e0e3;
  --input: #cfd8dc;
  --ring: #62828d;
  --radius: 0.875rem;
  --card: #ffffff;
  --card-foreground: #161d21;
  --sidebar: #f6f7f7;
  --sidebar-foreground: #34424b;
  --portal-brand-primary: #2f5a64;
  --portal-brand-primary-strong: #20444c;
  --portal-brand-surface: color-mix(in srgb, var(--portal-brand-primary) 14%, white);
  --portal-brand-surface-strong: color-mix(in srgb, var(--portal-brand-primary) 21%, white);
  --portal-brand-border: color-mix(in srgb, var(--portal-brand-primary) 24%, white);
  --portal-warm-primary: #c4844b;
  --portal-warm-strong: #9f6638;
  --portal-warm-surface: color-mix(in srgb, var(--portal-warm-primary) 12%, white);
  --portal-warm-border: color-mix(in srgb, var(--portal-warm-primary) 20%, white);
  --portal-success-primary: #5f846f;
  --portal-success-strong: #466553;
  --portal-success-surface: color-mix(in srgb, var(--portal-success-primary) 13%, white);
  --portal-danger-primary: #b8645b;
  --portal-danger-strong: #974941;
  --portal-danger-surface: color-mix(in srgb, var(--portal-danger-primary) 14%, white);
  --portal-danger-border: color-mix(in srgb, var(--portal-danger-primary) 24%, white);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

html.dark {
  color-scheme: dark;
  --background: #0d1316;
  --foreground: #eef2f3;
  --card: #141b1f;
  --card-foreground: #eef2f3;
  --primary: #8bb0bc;
  --primary-foreground: #0d1316;
  --secondary: #20292d;
  --secondary-foreground: #dde3e6;
  --muted: #1c2428;
  --muted-foreground: #9aa8af;
  --accent: #222d31;
  --accent-foreground: #e3eaec;
  --destructive: #d48780;
  --border: rgb(255 255 255 / 10%);
  --input: rgb(255 255 255 / 14%);
  --ring: #90b5c1;
  --sidebar: #11181c;
  --sidebar-foreground: #d8e1e5;
  --portal-brand-primary: #8bb0bc;
  --portal-brand-primary-strong: #c0d5dc;
  --portal-brand-surface: color-mix(in srgb, var(--portal-brand-primary) 15%, transparent);
  --portal-brand-surface-strong: color-mix(in srgb, var(--portal-brand-primary) 22%, transparent);
  --portal-brand-border: color-mix(in srgb, var(--portal-brand-primary) 28%, transparent);
  --portal-warm-primary: #d2a06e;
  --portal-warm-strong: #ebbc8f;
  --portal-warm-surface: color-mix(in srgb, var(--portal-warm-primary) 18%, transparent);
  --portal-warm-border: color-mix(in srgb, var(--portal-warm-primary) 30%, transparent);
  --portal-success-primary: #7eb293;
  --portal-success-strong: #b8dcc5;
  --portal-success-surface: color-mix(in srgb, var(--portal-success-primary) 18%, transparent);
  --portal-danger-primary: #d48780;
  --portal-danger-strong: #efb0aa;
  --portal-danger-surface: color-mix(in srgb, var(--portal-danger-primary) 18%, transparent);
  --portal-danger-border: color-mix(in srgb, var(--portal-danger-primary) 30%, transparent);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
a { color: var(--portal-brand-primary-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

.nplf-skip-link {
  position: absolute; left: -999px; top: 0; z-index: 10000;
  background: var(--card); color: var(--foreground); padding: 0.5rem 1rem;
}
.nplf-skip-link:focus { left: 0.5rem; top: 0.5rem; }

.portal-app-shell {
  background-image:
    radial-gradient(circle at top left, color-mix(in srgb, var(--portal-brand-primary) 7%, transparent), transparent 32rem),
    radial-gradient(circle at bottom right, color-mix(in srgb, var(--portal-warm-primary) 6%, transparent), transparent 28rem);
}
.portal-auth-shell {
  background-image:
    radial-gradient(circle at top, color-mix(in srgb, var(--portal-brand-primary) 9%, transparent), transparent 30rem),
    radial-gradient(circle at bottom, color-mix(in srgb, var(--portal-warm-primary) 6%, transparent), transparent 24rem);
}
.portal-auth-main {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 2rem;
}

.portal-frame {
  max-width: 72rem;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
}
.portal-frame-inner {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.portal-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(24px);
}
.portal-header-row {
  display: flex;
  height: 4rem;
  align-items: center;
  padding: 0 1rem;
  gap: 0.75rem;
}
.portal-header-end {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--foreground);
  text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; opacity: 0.8; }
.brand-mark {
  display: flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: var(--card);
  box-shadow: 0 1px 2px rgb(22 29 33 / 0.08);
}
html.dark .brand-mark { background: #fff; }
.brand-mark img { display: block; }
.brand-text { display: none; flex-direction: column; }
.brand-title { font-size: 1rem; font-weight: 700; letter-spacing: 0.02em; line-height: 1; }
.brand-sub { margin-top: 0.15rem; font-size: 0.75rem; line-height: 1; color: var(--muted-foreground); }
.muted { color: var(--muted-foreground); }

.portal-info-bar {
  display: none;
  min-width: 0;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.info-item { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.info-item:not(.info-endpoint) {
  flex-shrink: 0;
  min-width: auto;
}
.info-item code {
  font-weight: 500;
  color: var(--foreground);
  flex-shrink: 0;
  min-width: 4.5rem;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.info-endpoint { min-width: 0; flex-shrink: 1; }
.info-endpoint code { max-width: 14rem; flex-shrink: 1; min-width: 0; }
.info-sep { width: 1px; height: 0.875rem; background: var(--border); flex-shrink: 0; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  padding: 0.2rem;
  border-radius: 0.35rem;
  cursor: pointer;
}
.icon-btn:hover { background: var(--accent); color: var(--foreground); }

.portal-service-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--portal-success-strong);
  flex-shrink: 0;
}
.portal-service-status__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--portal-success-primary);
  animation: portal-pulse 1.6s ease-in-out infinite;
}
@keyframes portal-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.user-menu { position: relative; flex-shrink: 0; }
.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 0.75rem;
  padding: 0.25rem 0.4rem;
}
.user-trigger:hover { background: var(--accent); }
.user-avatar {
  display: flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 16%, transparent);
}
.user-email {
  display: none;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
}
.user-menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  width: 14rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--card);
  box-shadow: 0 12px 30px -18px rgb(22 29 33 / 0.35);
  z-index: 60;
}
.user-menu-panel[data-open="true"] { display: block; }
.menu-label {
  padding: 0.4rem 0.65rem 0.2rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.menu-sep { height: 1px; background: var(--border); margin: 0.25rem 0; }
.menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  text-decoration: none;
  border-radius: 0.5rem;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
}
.menu-item:hover { background: var(--accent); text-decoration: none; }
.menu-item-danger { color: var(--destructive); }
.menu-logout { margin: 0; }
.theme-mark { margin-left: auto; display: none; font-size: 0.75rem; color: var(--muted-foreground); }
.theme-mark[data-current="true"] { display: inline; }

.portal-body {
  display: flex;
  border-top: 1px solid var(--border);
  flex: 1;
  min-height: 0;
}
.portal-sidebar {
  display: none;
  width: 13rem;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  padding: 1.5rem 0.75rem;
}
.portal-sidebar nav { display: flex; flex-direction: column; gap: 0.25rem; }
.portal-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.75rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--sidebar-foreground) 78%, transparent);
  text-decoration: none;
}
.portal-nav-link:hover {
  background: var(--portal-brand-surface);
  color: var(--portal-brand-primary-strong);
  text-decoration: none;
}
.portal-nav-link[data-active="true"] {
  background: var(--portal-brand-surface-strong);
  color: var(--portal-brand-primary-strong);
  box-shadow: inset 0 0 0 1px var(--portal-brand-border);
}
.nav-icon { flex-shrink: 0; }
.nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main#content { min-width: 0; flex: 1; padding: 1.5rem 1.5rem 8.5rem; }
.portal-app-shell main#content { padding-bottom: 8.5rem; }

.portal-mobile-nav {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  background: color-mix(in srgb, var(--background) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 10px 24px -12px rgb(15 23 42 / 0.28);
  backdrop-filter: blur(24px);
  z-index: 40;
}
.portal-mobile-nav-link {
  flex: 1;
  display: flex;
  min-height: 3.5rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  border-radius: 0.75rem;
  padding: 0.35rem 0.2rem;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  text-align: center;
}
.portal-mobile-nav-link .nav-label { max-width: 4.5rem; }
.portal-mobile-nav-link:hover,
.portal-mobile-nav-link[data-active="true"] {
  background: var(--portal-brand-surface-strong);
  color: var(--portal-brand-primary-strong);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--portal-brand-border);
}

.auth-card, .panel, .card {
  background: color-mix(in srgb, var(--card) 96%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 92%, white);
  border-radius: 1rem;
  box-shadow: 0 12px 30px -22px rgb(22 29 33 / 0.24);
  padding: 1.5rem;
}
.portal-auth-main .auth-card { width: 100%; max-width: 28rem; }
.portal-eyebrow {
  display: inline-block;
  margin-bottom: 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--portal-brand-border);
  background: var(--portal-brand-surface);
  color: var(--portal-brand-primary-strong);
  padding: 0.2rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.auth-lede { color: var(--muted-foreground); margin: 0 0 1rem; }
.auth-footer { margin: 1rem 0 0; text-align: center; font-size: 0.875rem; }
.portal-text-link { color: var(--portal-brand-primary-strong); font-weight: 500; }
.portal-text-link:hover { color: var(--primary); }
.field-hint { margin: 0.25rem 0 0; font-size: 0.75rem; color: var(--muted-foreground); }
.auth-form { display: grid; gap: 0.85rem; }
.auth-form label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.3rem; }
.auth-form input:not(.honeypot),
.auth-form textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 4px);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
}
.auth-form button, .panel button, .card button, .btn-block {
  background: var(--primary);
  color: var(--primary-foreground);
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.6rem 1rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
.auth-form button:hover, .panel button:hover, .card button:hover {
  background: var(--portal-brand-primary-strong);
}
.btn-block { width: 100%; }
.btn-outline {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
  font-weight: 500;
}
.btn-outline:hover { background: var(--accent); color: var(--foreground); }
.card button.btn-outline, .panel button.btn-outline {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
  font-weight: 500;
}
.card button.btn-outline:hover, .panel button.btn-outline:hover {
  background: var(--accent);
  color: var(--foreground);
}
.card button.btn-ghost, .panel button.btn-ghost {
  background: transparent;
  color: var(--muted-foreground);
  padding: 0.35rem;
  min-width: 0;
  font-weight: 500;
  box-shadow: none;
}
.card button.btn-ghost:hover, .panel button.btn-ghost:hover {
  background: var(--accent);
  color: var(--destructive);
}
.card button.btn-danger, .panel button.btn-danger {
  background: var(--destructive);
  color: #fff;
}
.card button.btn-danger:hover, .panel button.btn-danger:hover {
  filter: brightness(0.95);
}
.card button.btn-icon, .panel button.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.45rem;
}
.api-keys-head { align-items: flex-start; }
.api-keys-head h1 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.api-keys-head .muted { max-width: 40rem; }
.api-keys-head button { display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; }
.empty-state {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  text-align: center;
}
.empty-state-icon { color: var(--muted-foreground); }
.empty-state-icon .nav-icon { width: 2.5rem; height: 2.5rem; }
.empty-state-title { font-weight: 600; margin: 0; }
.table-wrap { overflow-x: auto; }
.cell-truncate { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.last4-badge {
  display: inline-block;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--muted) 80%, transparent);
  border-radius: 0.35rem;
  padding: 0.15rem 0.45rem;
  font-size: 0.85rem;
}
.nplf-dialog dialog {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0;
  max-width: 32rem;
  width: calc(100% - 2rem);
  background: var(--card);
  color: var(--foreground);
  box-shadow: 0 18px 40px -24px rgb(22 29 33 / 0.45);
}
.nplf-dialog dialog::backdrop {
  background: rgb(15 23 26 / 0.45);
}
.portal-dialog-body { display: grid; gap: 0.85rem; padding: 1.25rem; }
.portal-dialog-body h2 { margin: 0; font-size: 1.05rem; }
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.alert-warning {
  border-radius: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--destructive) 35%, var(--border));
  background: color-mix(in srgb, var(--destructive) 10%, var(--card));
  padding: 0.75rem 1rem;
  display: grid;
  gap: 0.5rem;
}
.reveal-key-row { display: flex; gap: 0.5rem; align-items: flex-start; }
.reveal-key-code {
  flex: 1;
  display: block;
  border: 1px solid var(--border);
  background: var(--muted);
  border-radius: 0.4rem;
  padding: 0.55rem 0.75rem;
  word-break: break-all;
  font-size: 0.85rem;
}
button[data-copied="true"] { opacity: 0.7; }
.copy-done, .btn-label-busy { display: none; }
button[data-copied="true"] .copy-idle { display: none; }
button[data-copied="true"] .copy-done { display: inline-flex; }
form.htmx-request .btn-label-idle { display: none; }
form.htmx-request .btn-label-busy { display: inline; }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.form-actions button { min-width: 10rem; }
.info-callout {
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--muted) 70%, transparent);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  margin: 0.75rem 0 1rem;
}
@media (max-width: 767px) {
  .form-actions { flex-direction: column; }
  .form-actions button { width: 100%; min-width: 0; }
}

.data-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.data-table th, .data-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0.5rem;
  text-align: left;
}
.data-table th { color: var(--muted-foreground); font-size: 0.8rem; font-weight: 600; }
.kv { display: grid; gap: 0.5rem; margin: 1rem 0; }
.kv div { display: grid; grid-template-columns: 10rem 1fr; gap: 0.5rem; }
.kv dt { color: var(--muted-foreground); }
.reveal-key {
  padding: 0.75rem;
  border: 1px solid var(--portal-brand-border);
  background: var(--portal-brand-surface);
  border-radius: calc(var(--radius) - 4px);
}
.honeypot { position: absolute; left: -9999px; height: 0; width: 0; overflow: hidden; }
[role="alert"] { color: var(--portal-danger-strong); }
[role="status"] { color: var(--portal-success-strong); }
code { font-family: var(--font-mono); font-size: 0.9em; }
h1 { font-size: 1.5rem; letter-spacing: -0.03em; margin: 0 0 0.5rem; }
h2 { font-size: 1.05rem; margin: 0 0 0.35rem; font-weight: 600; }
.panel { max-width: none; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}
.badge-success {
  border-color: color-mix(in srgb, var(--portal-success-primary) 40%, white);
  background: var(--portal-success-surface);
  color: var(--portal-success-strong);
}
.badge-warning {
  border-color: var(--portal-warm-border);
  background: var(--portal-warm-surface);
  color: var(--portal-warm-strong);
}
.badge-danger {
  border-color: var(--portal-danger-border);
  background: var(--portal-danger-surface);
  color: var(--portal-danger-strong);
}
.badge-info {
  border-color: var(--portal-brand-border);
  background: var(--portal-brand-surface);
  color: var(--portal-brand-primary-strong);
}

.portal-page { display: flex; gap: 1.5rem; }
.portal-page-main { flex: 1; min-width: 0; display: grid; gap: 1.25rem; }
.portal-aside { display: none; width: 180px; flex-shrink: 0; }
.portal-aside-card {
  position: sticky;
  top: 5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  padding: 1rem;
  display: grid;
  gap: 1.25rem;
  box-shadow: 0 1px 2px rgb(22 29 33 / 0.06);
}
.aside-heading {
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.portal-aside-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.4rem;
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-decoration: none;
}
.portal-aside-link:hover {
  background: var(--portal-brand-surface);
  color: var(--portal-brand-primary-strong);
  text-decoration: none;
}
.portal-aside-alert-link {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid var(--portal-danger-border);
  background: color-mix(in srgb, var(--portal-danger-surface) 92%, transparent);
  padding: 0.5rem;
  text-decoration: none;
  margin-bottom: 0.5rem;
  color: var(--portal-danger-strong);
}
.portal-aside-alert-link:hover { text-decoration: none; background: var(--portal-danger-surface); }
.alert-title { display: block; font-size: 0.75rem; font-weight: 500; line-height: 1.35; }
.alert-date { display: block; font-size: 0.625rem; opacity: 0.8; }
.portal-aside-news-link {
  display: flex;
  gap: 0.5rem;
  border-radius: 0.4rem;
  padding: 0.25rem 0.25rem;
  text-decoration: none;
}
.portal-aside-news-link:hover { background: var(--portal-brand-surface); text-decoration: none; }
.portal-aside-news-link:hover .portal-aside-news-link__title { color: var(--portal-brand-primary-strong); }
.portal-aside-news-link__title, .portal-aside-news-link__date {
  display: block;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted-foreground);
}
.portal-aside-news-link__date { font-size: 0.625rem; }
.news-dot {
  margin-top: 0.4rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--border);
  flex-shrink: 0;
}
.news-dot-new { background: var(--primary); }

.billing-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}
.billing-bar-badge { margin-left: auto; }

.stats-grid { display: grid; gap: 1.25rem; }
.card-head, .card-head-tight {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.card-head-tight { flex-direction: column; gap: 0.15rem; }
.card-head-tight h2 { font-size: 1rem; }
.portal-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  height: 7rem;
  padding: 0 0.25rem;
}
.portal-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.portal-bar-plot { position: relative; display: flex; width: 100%; height: 90px; align-items: flex-end; justify-content: center; }
.portal-bar { fill: color-mix(in srgb, var(--primary) 55%, transparent); }
.portal-bar-col:hover .portal-bar { fill: var(--primary); }
.portal-bar-tooltip {
  display: none;
  position: absolute;
  top: -1.15rem;
  border-radius: 0.25rem;
  background: var(--foreground);
  color: var(--background);
  padding: 0.1rem 0.35rem;
  font-size: 0.625rem;
  font-weight: 500;
  pointer-events: none;
}
.portal-bar-col:hover .portal-bar-tooltip { display: block; }
.portal-bar-day { font-size: 0.6875rem; color: var(--muted-foreground); }
.metrics-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-top: 1rem; }
.metric-label { font-size: 0.75rem; }
.metric-value { font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-foot { font-size: 0.75rem; margin: 0.75rem 0 0; }
.storage-row { display: flex; align-items: center; gap: 1rem; }
.donut-wrap { position: relative; width: 6rem; height: 6rem; flex-shrink: 0; }
.portal-donut { width: 100%; height: 100%; transform: rotate(-90deg); }
.portal-donut-track { stroke: var(--border); }
.portal-donut-fg { stroke: var(--primary); }
.donut-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.storage-title { font-size: 0.875rem; font-weight: 500; }
.storage-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.quota-list { display: grid; gap: 0.75rem; margin-top: 1.25rem; }
.quota-meta { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 0.35rem; }
.quota-svg { display: block; width: 100%; height: 0.5rem; }
.quota-svg-track { fill: var(--muted); }
.quota-svg-fill { fill: var(--primary); }
.feature-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.4rem; }
.feature-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.billing-custom-note { color: var(--portal-brand-primary-strong); }
.plan-change-form { max-width: 32rem; margin-bottom: 1.5rem; }
.badge-muted {
  border-color: var(--border);
  background: var(--muted);
  color: var(--muted-foreground);
}

.account-grid { display: grid; gap: 1.5rem; }
.readonly-grid { display: grid; gap: 1rem; margin: 1rem 0 1.25rem; }
.field-caption {
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.35rem;
}
.reveal-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
}
.muted-box {
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--muted) 70%, transparent);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-mono);
  word-break: break-all;
}
.status-list { display: grid; gap: 1rem; margin-top: 1rem; }

@media (min-width: 640px) {
  .brand-text { display: flex; }
  .readonly-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) {
  .portal-sidebar { display: flex; flex-direction: column; }
  .portal-mobile-nav { display: none; }
  .portal-info-bar { display: flex; }
  main#content,
  .portal-app-shell main#content { padding: 1.5rem 2rem 2rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1024px) {
  .user-email { display: inline; }
  .portal-aside { display: block; }
  .account-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  main#content { padding-left: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-service-status__dot { animation: none; }
}
