/* Minimal modern UI (no external deps). */

:root {
  --accent: #7c5cff;
  --accent-2: #32d3ff;
  --ok: #2ee59d;
  --warn: #ffcc66;
  /* Semantic palette (aliases) */
  --color-primary: var(--accent);
  --color-secondary: var(--accent-2);
  --color-success: var(--ok);
  --color-warning: var(--warn);
  --color-danger: #e84545;
  --color-danger-hover: #ff5c5c;
  --color-danger-border: rgba(255, 92, 92, 0.85);
  --color-danger-shadow: rgba(232, 69, 69, 0.28);
  /* Control heights (vertical rhythm) */
  --control-h-s: 32px;
  --control-h-m: 40px;
  --control-h-l: 48px;
  --control-h-xl: 54px;
  --brand-gradient-angle: 108deg;
  /* Softer handoff + fewer hard stops = cleaner corners on pill buttons (Chromium). */
  --brand-gradient: linear-gradient(
    var(--brand-gradient-angle),
    #5c4abe 0%,
    #6854cc 42%,
    #3a8fb0 100%
  );
  --brand-gradient-hover: linear-gradient(
    var(--brand-gradient-angle),
    #6a5ed0 0%,
    #7664da 42%,
    #429eb8 100%
  );
  --brand-btn-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 8px 22px rgba(90, 72, 200, 0.18),
    0 3px 12px rgba(45, 130, 165, 0.12);
  /* Typography scale */
  --text-display-size: clamp(26px, 4.2vw, 44px);
  --text-display-sm-size: clamp(22px, 3.6vw, 38px);
  --text-display-xs-size: clamp(20px, 3.2vw, 34px);
  --text-title-xl-size: 23px;
  --text-title-lg-size: 20px;
  --text-title-size: 17px;
  --text-body-size: 14px;
  --text-body-lg-size: 15px;
  --text-caption-size: 12px;
  --radius: 16px;
  --radius-sm: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  /* Fallback для admin (без theme-*): тёмные токены. */
  --bg: #0b1020;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-2: rgba(255, 255, 255, 0.06);
  /* Solid surfaces for overlays (dropdowns/popovers): no backdrop bleed. */
  --popover-bg: #10182e;
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.70);
  --subtle: rgba(255, 255, 255, 0.55);
  --border: rgba(255, 255, 255, 0.16);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --label-tone-a-bg: rgba(124, 92, 255, 0.22);
  --label-tone-a-text: rgba(220, 210, 255, 0.95);
  --label-tone-b-bg: rgba(50, 211, 255, 0.18);
  --label-tone-b-text: rgba(180, 235, 255, 0.95);
  --label-new-bg: rgba(46, 229, 157, 0.18);
  --label-new-text: rgba(180, 255, 220, 0.95);
  --label-date-bg: rgba(255, 255, 255, 0.08);
  --label-date-text: rgba(255, 255, 255, 0.65);
  --label-radar-use-bg: rgba(255, 255, 255, 0.07);
  --label-radar-use-text: rgba(255, 255, 255, 0.78);
  --label-radar-use-border: rgba(255, 255, 255, 0.14);
  --color-text: var(--text);
  --color-muted: var(--muted);
  --color-border: var(--border);
  --color-surface: var(--panel);
  --color-surface-elevated: var(--panel-2);
  --media-aspect-publication: 16 / 10;
  --media-aspect-stage: 16 / 9;
  --media-aspect-book: 2 / 3;
  --media-aspect-film: 2 / 3;
  --media-aspect-product: 1 / 1;
  --media-aspect-resume: 1 / 1;
  --media-card-stack-max: 320px;
  --radar-card-col-min: 280px;
  --radar-score-label-col: 6.25rem;
  --radar-score-track-width: 10.5rem;
  --radar-score-value-col: 2.25rem;
  --radar-score-tile-cell: 5.75rem;
}

/* Публичная часть: светлая тема (body.theme-light). */
body.theme-light:not(.admin) {
  --bg: #f3f5fc;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --popover-bg: #ffffff;
  --text: rgba(14, 18, 42, 0.92);
  --muted: rgba(14, 18, 42, 0.62);
  --subtle: rgba(14, 18, 42, 0.48);
  --border: rgba(14, 18, 42, 0.08);
  --shadow: 0 8px 28px rgba(30, 40, 90, 0.07);
  --label-tone-a-bg: rgba(124, 92, 255, 0.14);
  --label-tone-a-text: #5a3fd4;
  --label-tone-b-bg: rgba(50, 211, 255, 0.16);
  --label-tone-b-text: #1a7a9e;
  --label-radar-use-bg: rgba(14, 18, 42, 0.045);
  --label-radar-use-text: rgba(14, 18, 42, 0.68);
  --label-radar-use-border: rgba(14, 18, 42, 0.1);
  --label-new-bg: rgba(46, 229, 157, 0.18);
  --label-new-text: #1a7a52;
  --label-date-bg: rgba(14, 18, 42, 0.06);
  --label-date-text: rgba(14, 18, 42, 0.55);
  --color-text: var(--text);
  --color-muted: var(--muted);
  --color-border: var(--border);
  --color-surface: var(--panel);
  --color-surface-elevated: var(--panel-2);
  --color-input-bg: #f5f7fc;
  --color-input-border: rgba(14, 18, 42, 0.09);
}

/* Typography utilities */
.text-display,
.text-display-sm,
.text-display-xs {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--color-text);
}

.text-display {
  font-size: var(--text-display-size);
}

.text-display-sm {
  font-size: var(--text-display-sm-size);
}

.text-display-xs {
  font-size: var(--text-display-xs-size);
}

.text-title,
.text-title-lg,
.text-title-xl {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--color-text);
}

.text-title {
  font-size: var(--text-title-size);
}

.text-title-lg {
  font-size: var(--text-title-lg-size);
}

.text-title-xl {
  font-size: var(--text-title-xl-size);
}

.text-body {
  margin: 0;
  font-size: var(--text-body-size);
  line-height: 1.5;
  color: var(--color-muted);
}

.text-body-lg {
  margin: 0;
  font-size: var(--text-body-lg-size);
  line-height: 1.55;
  color: var(--color-muted);
}

.text-caption {
  margin: 0;
  font-size: var(--text-caption-size);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
  color: var(--color-muted);
}

.text-mono {
  font-family: var(--mono);
  font-size: var(--text-caption-size);
  color: var(--color-muted);
}

* { box-sizing: border-box; }
html {
  min-height: 100%;
}
body:not(.admin) {
  min-height: 100%;
  min-height: 100dvh;
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background-color: var(--bg);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

body.theme-light:not(.admin) {
  background-image:
    radial-gradient(1100px 640px at 20% 0%, rgba(124, 92, 255, 0.06), transparent 72%),
    radial-gradient(900px 520px at 90% 8%, rgba(50, 211, 255, 0.05), transparent 70%),
    radial-gradient(1000px 700px at 50% 100%, rgba(46, 229, 157, 0.03), transparent 78%);
}

body.theme-dark:not(.admin) {
  background-image:
    radial-gradient(1200px 720px at 25% 8%, rgba(124, 92, 255, 0.28), transparent 68%),
    radial-gradient(1000px 640px at 82% 12%, rgba(50, 211, 255, 0.22), transparent 65%),
    radial-gradient(1100px 800px at 55% 88%, rgba(46, 229, 157, 0.12), transparent 72%);
}

/* --- Светлая публичка: поверхности, ссылки, кнопки, логотип --- */
body.theme-light:not(.admin) .topbar,
body.theme-light:not(.admin) .card,
body.theme-light:not(.admin) .profile-menu-panel,
body.theme-light:not(.admin) .radar-signal-panel {
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(14, 18, 42, 0.08);
  backdrop-filter: none;
  box-shadow: var(--shadow);
}

body.theme-light:not(.admin) .topbar {
  --topbar-control-bg: #ffffff;
  --topbar-control-border: rgba(14, 18, 42, 0.12);
  --topbar-control-fg: rgba(14, 18, 42, 0.9);
}

body.theme-light:not(.admin) .logo {
  color: #5a3fd4;
  background: color-mix(in srgb, var(--color-primary) 16%, transparent);
  border-radius: 12px;
}

/* Topbar accents: logo + theme switch + auth CTA should feel related. */
body.theme-light:not(.admin) .topbar .theme-switch-thumb {
  background: var(--brand-gradient);
}

body.theme-light:not(.admin) a:not(.btn):not(.pill-logout) {
  color: #5a3fd4;
  text-decoration-color: rgba(90, 63, 212, 0.45);
}

body.theme-light:not(.admin) a:not(.btn):not(.pill-logout):hover {
  color: #4a32b8;
  text-decoration-color: rgba(90, 63, 212, 0.75);
}

body.theme-light:not(.admin) .pill-user .pill-logout {
  color: rgba(14, 18, 42, 0.58);
  text-decoration-color: rgba(14, 18, 42, 0.28);
}

body.theme-light:not(.admin) .pill-user .pill-logout:hover {
  color: rgba(14, 18, 42, 0.88);
  text-decoration-color: rgba(14, 18, 42, 0.45);
}

body.theme-light:not(.admin) .pill-user-sep {
  color: rgba(14, 18, 42, 0.22);
}

body.theme-light:not(.admin) .btn {
  border-color: rgba(14, 18, 42, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(14, 18, 42, 0.9);
}

body.theme-light:not(.admin) .btn:hover {
  border-color: rgba(14, 18, 42, 0.18);
  background: #ffffff;
}

body.theme-light:not(.admin) .btn-ghost {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(14, 18, 42, 0.14);
  color: rgba(14, 18, 42, 0.82);
}

body.theme-light:not(.admin) .btn-ghost:hover {
  background: #ffffff;
  border-color: rgba(14, 18, 42, 0.2);
  color: rgba(14, 18, 42, 0.95);
}

body.theme-light:not(.admin) .btn.btn-danger {
  border-color: rgba(200, 50, 50, 0.55);
  background: linear-gradient(135deg, #d63c3c, #f05a4a);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(200, 50, 50, 0.22);
}

body.theme-light:not(.admin) .btn.btn-danger:hover {
  border-color: rgba(180, 40, 40, 0.65);
  background: linear-gradient(135deg, #e04545, #ff6b5a);
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(200, 50, 50, 0.28);
}

body.theme-light:not(.admin) .btn.btn-primary {
  border-color: rgba(255, 255, 255, 0.34);
  background-color: transparent;
  color: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 8px 22px rgba(90, 72, 200, 0.16),
    0 3px 12px rgba(45, 130, 165, 0.1);
}

body.theme-light:not(.admin) .btn.btn-primary::before {
  background: linear-gradient(135deg, rgba(90, 72, 200, 0.96), rgba(58, 158, 196, 0.88));
}

body.theme-light:not(.admin) .btn.btn-primary:hover {
  border-color: rgba(255, 255, 255, 0.44);
  background-color: transparent;
  color: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 12px 30px rgba(90, 72, 200, 0.2),
    0 4px 14px rgba(45, 130, 165, 0.12);
}

body.theme-light:not(.admin) .btn.btn-primary:hover::before {
  background: linear-gradient(135deg, rgba(100, 82, 212, 0.98), rgba(68, 176, 208, 0.92));
}

body.theme-light:not(.admin) .btn.btn-brand {
  border-color: rgba(255, 255, 255, 0.34);
  background-color: transparent;
  color: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.18) inset,
    0 8px 22px rgba(90, 72, 200, 0.16),
    0 3px 12px rgba(45, 130, 165, 0.1);
}

body.theme-light:not(.admin) .btn.btn-brand:hover {
  border-color: rgba(255, 255, 255, 0.44);
  background-color: transparent;
  color: rgba(255, 255, 255, 0.98);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 12px 30px rgba(90, 72, 200, 0.2),
    0 4px 14px rgba(45, 130, 165, 0.12);
}

body.theme-light:not(.admin) .topbar-actions .btn-theme-toggle,
body.theme-light:not(.admin) .topbar-actions .btn-ghost {
  flex-shrink: 0;
}

body.theme-light:not(.admin) .mono {
  color: rgba(14, 18, 42, 0.72);
}

body.theme-light:not(.admin) .kv > .kv-row {
  border-bottom-color: rgba(14, 18, 42, 0.08);
}

body.theme-light:not(.admin) .footer code {
  background: rgba(14, 18, 42, 0.06);
  border-color: rgba(14, 18, 42, 0.1);
  color: rgba(14, 18, 42, 0.78);
}

body.theme-dark:not(.admin) .logo {
  color: rgba(255, 255, 255, 0.95);
}

body.theme-dark:not(.admin) .logo {
  background: color-mix(in srgb, var(--color-primary) 18%, transparent);
  border-radius: 12px;
}

body.theme-dark:not(.admin) .topbar .theme-switch-thumb {
  background: var(--brand-gradient);
}

@media (max-width: 640px) {
  body.theme-light:not(.admin) {
    background-image:
      radial-gradient(95vw 50vh at 50% 0%, rgba(124, 92, 255, 0.1), transparent 72%),
      radial-gradient(90vw 45vh at 50% 100%, rgba(50, 211, 255, 0.08), transparent 78%);
  }
  body.theme-dark:not(.admin) {
    background-image:
      radial-gradient(95vw 55vh at 50% 0%, rgba(124, 92, 255, 0.22), transparent 70%),
      radial-gradient(90vw 50vh at 50% 100%, rgba(50, 211, 255, 0.14), transparent 75%),
      radial-gradient(100vw 70vh at 50% 45%, rgba(46, 229, 157, 0.08), transparent 80%);
  }
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 44px 16px 60px;
  min-width: 0;
  box-sizing: border-box;
}

body:not(.admin) {
  /* Mobile safety: prevent horizontal scroll from long content */
  overflow-x: hidden;
}

html,
body {
  max-width: 100%;
}

/* Страницы входа/регистрации: форма по центру по вертикали под topbar. */
body.auth-page {
  min-height: 100%;
  min-height: 100dvh;
}

body.auth-page main.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 28px;
  padding-bottom: 32px;
  box-sizing: border-box;
}

body.auth-page .auth-layout {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(78vh, 720px);
  padding: 24px 0 40px;
}

@media (max-width: 520px) {
  body.auth-page .auth-layout {
    align-items: stretch;
    min-height: 0;
  }
}

.auth-layout {
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

/* Topbar should read as a single surface with “raised” controls. */
.topbar {
  --topbar-control-bg: rgba(255, 255, 255, 0.10);
  --topbar-control-border: rgba(255, 255, 255, 0.18);
  --topbar-control-fg: rgba(255, 255, 255, 0.92);
}

.topbar .btn:not(.btn-primary):not(.btn-brand):not(.btn-danger),
.topbar .profile-menu-trigger,
.topbar .theme-switch-track {
  background: var(--topbar-control-bg);
  border-color: var(--topbar-control-border);
  color: var(--topbar-control-fg);
}

.topbar-actions .btn.btn-ghost,
.topbar-actions .btn.btn-secondary {
  position: relative;
  isolation: isolate;
  border-color: rgba(255, 255, 255, 0.22);
  background-color: transparent;
  color: rgba(255, 255, 255, 0.98);
}

body.theme-light:not(.admin) .topbar-actions .btn.btn-ghost,
body.theme-light:not(.admin) .topbar-actions .btn.btn-secondary {
  border-color: rgba(255, 255, 255, 0.34);
  color: #ffffff;
}

.topbar-actions .btn.btn-ghost::before,
.topbar-actions .btn.btn-secondary::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  background: var(--brand-gradient);
  opacity: 0.92;
}

.topbar-actions .btn.btn-ghost:hover::before,
.topbar-actions .btn.btn-secondary:hover::before {
  background: var(--brand-gradient-hover);
  opacity: 0.98;
}

.topbar-actions .btn.btn-ghost:hover,
.topbar-actions .btn.btn-secondary:hover {
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.18);
}

/* Topbar avatar: match brand gradient */
.topbar-actions .profile-menu-trigger .avatar {
  background: transparent;
  color: rgba(255, 255, 255, 0.98);
}

body.theme-light:not(.admin) .topbar-actions .profile-menu-trigger .avatar {
  color: rgba(255, 255, 255, 0.98);
}

/* Theme switch thumb: match brand gradient (both themes). */
.topbar-actions .theme-switch-thumb {
  background: var(--brand-gradient);
}

body.theme-dark:not(.admin) .topbar-actions .theme-switch-thumb {
  background: var(--brand-gradient);
}

.topbar .btn:not(.btn-primary):not(.btn-brand):not(.btn-danger):hover,
.topbar .profile-menu-trigger:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.12);
}

/* Light theme: keep visible border on hover (no “disappearing ring”). */
body.theme-light:not(.admin) .topbar .profile-menu-trigger:hover {
  border-color: rgba(14, 18, 42, 0.18);
  background: rgba(255, 255, 255, 1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.logo {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 12px;
  /* OpenGFX: primary logo should be “clean” (no gradients/effects). */
  background: transparent;
  border: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.95);
}


/* Public CTAs should match the “mysterious” pill/round aesthetic. */
.topbar .stack-row .btn {
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 750;
}

/* Публичная шапка: профиль и «Выйти» в одном бейдже. */
.topbar .topbar-user.stack-row {
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

/* Public card CTAs (e.g. “Действия” on /entries) should match auth CTAs. */
body:not(.admin) .card .stack-row .btn {
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 750;
}

/* Блок «Действия» на главной: без карточки, сразу под шапкой. */
.actions-strip {
  margin-top: 18px;
  padding: 0 2px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.actions-strip-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--subtle);
}

body:not(.admin) .actions-strip .stack-row .btn {
  border-radius: 999px;
  padding: 12px 16px;
  font-weight: 750;
}

/* Public form buttons (registration/login). */
.public-auth .btn {
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 750;
  min-height: 48px;
}

/* Public links: make contrast explicit (admin uses dedicated link styles). */
body:not(.admin) a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: underline;
  text-decoration-color: rgba(124, 92, 255, 0.65);
  text-underline-offset: 3px;
}

body:not(.admin) a:hover {
  color: rgba(255, 255, 255, 0.98);
  text-decoration-color: rgba(124, 92, 255, 0.95);
}

.brand-title {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-title strong {
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-title span {
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.2;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.pill-user {
  flex-wrap: wrap;
  row-gap: 6px;
  column-gap: 4px;
  align-items: center;
  max-width: min(100%, 420px);
  white-space: normal;
  line-height: 1.2;
}

.topbar-actions .pill-user {
  min-height: var(--control-h-s);
  padding-top: 0;
  padding-bottom: 0;
}

/* --- Profile menu (topbar) --- */
.profile-menu {
  position: relative;
}

.profile-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--control-h-s);
  height: var(--control-h-s);
  padding: 0 12px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  user-select: none;
}

.profile-menu-trigger::-webkit-details-marker {
  display: none;
}

.profile-menu-trigger::marker {
  content: "";
}

.profile-menu-trigger:hover {
  border-color: rgba(124, 92, 255, 0.35);
  background: var(--color-surface);
}

.profile-menu[open] .profile-menu-trigger {
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

.profile-menu-login {
  max-width: min(180px, 28vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.profile-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--popover-bg);
  backdrop-filter: none;
  box-shadow: var(--shadow);
  z-index: 40;
  text-align: right;
}

.profile-menu-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  line-height: 1.3;
  text-align: right;
}

.profile-menu-item:hover {
  background: rgba(124, 92, 255, 0.08);
  color: var(--color-primary);
}

.profile-menu-item:focus-visible {
  outline: 2px solid rgba(124, 92, 255, 0.45);
  outline-offset: 1px;
}

body.theme-light:not(.admin) .profile-menu-item {
  color: rgba(14, 18, 42, 0.9);
}

body.theme-light:not(.admin) .profile-menu-item:hover {
  color: #5a3fd4;
}

/* --- Modal (dialog) --- */
.modal {
  padding: 0;
  margin: auto;
  max-width: min(100vw - 24px, 440px);
  width: 100%;
  border: 0;
  background: transparent;
  overflow: visible;
}

/* Non-modal dialog state (in document flow) — never show until showModal() */
dialog.modal:not(:modal) {
  display: none !important;
}

.modal::backdrop {
  background: rgba(8, 12, 28, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal[open] {
  animation: modal-fade-in 0.22s ease-out;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-panel {
  display: grid;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--popover-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-origin: center top;
  animation: modal-panel-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modal-panel-in {
  from {
    opacity: 0;
    transform: scale(0.98) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
  border-bottom: 1px solid var(--color-border);
}

.modal-title {
  margin: 0;
  font-size: var(--text-title-size);
}

.modal-close.btn {
  flex-shrink: 0;
  gap: 0;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 8px;
  color: var(--muted);
}

.modal-close.btn:hover {
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  box-shadow: none;
}

body.theme-light:not(.admin) .modal-close.btn {
  border: none;
  background: transparent;
  color: rgba(14, 18, 42, 0.5);
}

body.theme-light:not(.admin) .modal-close.btn:hover {
  border: none;
  background: rgba(14, 18, 42, 0.06);
  color: rgba(14, 18, 42, 0.88);
  box-shadow: none;
}

.modal-body {
  padding: 16px;
}

.modal-footer {
  padding: 10px 16px 16px;
  border-top: 1px solid var(--color-border);
}

.modal-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(232, 69, 69, 0.35);
  background: rgba(232, 69, 69, 0.12);
  color: var(--color-text);
}

.modal-switch {
  margin: 0;
  text-align: center;
}

.modal-switch a {
  font-weight: 600;
}

.auth-modal-form {
  display: grid;
  gap: 14px;
}

.auth-modal-fields {
  display: grid;
  gap: 12px;
}

.auth-modal-fields .field {
  margin: 0;
}

/* Auth modal labels: theme-specific contrast */
body.theme-dark:not(.admin) .auth-dialog .field-label label {
  color: rgba(255, 255, 255, 0.86);
}

body.theme-dark:not(.admin) .auth-dialog .field-hint {
  color: rgba(255, 255, 255, 0.62);
}

body.theme-light:not(.admin) .auth-dialog .field-label label {
  color: rgba(14, 18, 42, 0.78);
}

body.theme-light:not(.admin) .auth-dialog .field-hint {
  color: rgba(14, 18, 42, 0.55);
}

/* Auth modal + light theme: soft input fills on white panel */
body.theme-light:not(.admin) .auth-dialog input.control-s,
body.theme-light:not(.admin) .auth-dialog input.control-m,
body.theme-light:not(.admin) .auth-dialog input.control-l,
body.theme-light:not(.admin) .auth-dialog select.control-m,
body.theme-light:not(.admin) .auth-dialog textarea.control-m {
  background: var(--color-input-bg);
  border-color: var(--color-input-border);
  color: rgba(14, 18, 42, 0.92);
}

body.theme-light:not(.admin) .auth-dialog input.control-s:focus-visible,
body.theme-light:not(.admin) .auth-dialog input.control-m:focus-visible,
body.theme-light:not(.admin) .auth-dialog input.control-l:focus-visible,
body.theme-light:not(.admin) .auth-dialog select.control-m:focus-visible,
body.theme-light:not(.admin) .auth-dialog textarea.control-m:focus-visible {
  background: #ffffff;
  border-color: rgba(90, 63, 212, 0.42);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

.auth-modal-actions {
  display: flex;
  justify-content: stretch;
}

.auth-modal-actions .btn {
  width: 100%;
  border-radius: 999px;
  font-weight: 750;
}

body.theme-light:not(.admin) .modal::backdrop {
  background: rgba(14, 18, 42, 0.42);
}

@media (max-width: 640px) {
  .modal {
    max-width: calc(100vw - 16px);
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 14px;
    padding-right: 14px;
  }
}

.pill-user-meta {
  min-width: 0;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
}

.pill-user-sep {
  color: rgba(255, 255, 255, 0.28);
  user-select: none;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
}

/* Ссылка «Выйти» в бейдже: как метка — без повышенной жирности, белое подчёркивание. */
body:not(.admin) .pill-user .pill-logout {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: inherit;
  color: var(--muted);
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.42);
  text-underline-offset: 3px;
}

body:not(.admin) .pill-user .pill-logout:hover {
  color: rgba(255, 255, 255, 0.88);
  text-decoration-color: rgba(255, 255, 255, 0.62);
}

body:not(.admin) .pill-user .pill-logout:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.35);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 520px) {
  /* На мобильных держим бейдж в одну строку, иначе «Выйти» визуально съезжает. */
  .pill-user {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .pill-user-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(46, 229, 157, 0.18);
}

.hero {
  margin-top: clamp(20px, 3.2vw, 32px);
  padding: clamp(12px, 2.4vw, 24px) 0 clamp(16px, 2.8vw, 28px);
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.hero-product {
  --hero-art-card-fill: rgba(255, 255, 255, 0.92);
  --hero-ink: var(--color-text);
  --hero-ink-soft: var(--muted);
  --hero-ink-faint: var(--subtle);
  position: relative;
}

body.theme-light:not(.admin) .hero-product {
  --hero-art-card-fill: rgba(255, 255, 255, 0.88);
  --hero-ink: rgba(14, 18, 42, 0.94);
  --hero-ink-soft: rgba(14, 18, 42, 0.68);
  --hero-ink-faint: rgba(14, 18, 42, 0.5);
}

body.theme-dark:not(.admin) .hero-product {
  --hero-art-card-fill: rgba(18, 24, 48, 0.82);
}

.hero-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(28px, 4vw, 48px);
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
}

@media (max-width: 768px) {
  .hero-inner {
    width: 100%;
    max-width: 100%;
  }
}

.hero-copy {
  flex: 0 1 auto;
  min-width: min(100%, 280px);
  max-width: 36rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-eyebrow {
  margin: 0 0 2px;
  font-size: var(--text-caption-size);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
  color: rgba(124, 92, 255, 0.72);
}

body.theme-light:not(.admin) .hero-eyebrow {
  color: rgba(90, 63, 212, 0.78);
}

body.theme-dark:not(.admin) .hero-eyebrow {
  color: rgba(196, 181, 255, 0.82);
}

.hero-product .hero-title {
  margin: 0 0 10px;
  background: linear-gradient(
    118deg,
    var(--hero-ink) 18%,
    #6b54d4 62%,
    rgba(50, 170, 220, 0.95) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.theme-light:not(.admin) .hero-product .hero-title {
  background: linear-gradient(118deg, rgba(14, 18, 42, 0.96) 12%, #5a48c8 58%, #3a9ec4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.theme-dark:not(.admin) .hero-product .hero-title {
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.98) 10%, #b8a8ff 55%, #7ad4f0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.theme-dark:not(.admin) {
  --brand-gradient: linear-gradient(
    var(--brand-gradient-angle),
    #6e58e8 0%,
    #8a78f4 40%,
    #38c4ec 100%
  );
  --brand-gradient-hover: linear-gradient(
    var(--brand-gradient-angle),
    #7c66f0 0%,
    #9688fa 40%,
    #4ad0f4 100%
  );
  --brand-btn-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 10px 28px rgba(124, 92, 255, 0.22),
    0 4px 14px rgba(50, 200, 230, 0.1);
}

.hero-product .hero-lead {
  margin: 0 0 12px;
  max-width: 42ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--hero-ink-soft);
}

.hero-lead-accent {
  font-weight: 650;
  color: rgba(124, 92, 255, 0.82);
}

body.theme-light:not(.admin) .hero-lead-accent {
  color: rgba(90, 63, 212, 0.85);
}

body.theme-dark:not(.admin) .hero-lead-accent {
  color: rgba(200, 190, 255, 0.9);
}

.hero-points {
  margin: 0;
  padding: 0 0 0 14px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 40ch;
}

.hero-points li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--hero-ink-soft);
}

.hero-points li::before {
  content: "";
  flex-shrink: 0;
  width: 5px;
  height: 5px;
  margin-top: 0.45em;
  border-radius: 50%;
  background: rgba(124, 92, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.1);
}

.hero-points li:nth-child(2)::before {
  background: rgba(50, 180, 220, 0.55);
  box-shadow: 0 0 0 2px rgba(50, 211, 255, 0.1);
}

.hero-points li:nth-child(3)::before {
  background: rgba(46, 200, 150, 0.5);
  box-shadow: 0 0 0 2px rgba(46, 229, 157, 0.1);
}

/* Hero art: абстракция «лента записей» (CTA-зона) */
.hero-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: min(300px, 40vw);
  min-width: 220px;
}

.hero-art {
  position: relative;
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
  aspect-ratio: 320 / 280;
}

.hero-art-svg {
  display: block;
  width: 100%;
  height: auto;
  color: rgba(14, 18, 42, 0.48);
  opacity: 0.9;
}

body.theme-light:not(.admin) .hero-art-svg {
  opacity: 0.92;
}

body.theme-dark:not(.admin) .hero-art-svg {
  color: rgba(255, 255, 255, 0.42);
  opacity: 0.82;
}

.hero-art-glow {
  opacity: 0.24;
  animation: hero-glow-pulse 6s ease-in-out infinite;
}

.hero-art-flow {
  stroke-dasharray: 420;
  stroke-dashoffset: 420;
  opacity: 0.42;
  animation: hero-flow-draw 2.8s ease-out forwards, hero-flow-shimmer 7s ease-in-out 2.8s infinite;
}

.hero-art-card {
  transform-origin: center;
  animation: hero-card-float 7s ease-in-out infinite;
}

.hero-art-card--1 {
  animation-delay: 0s;
}

.hero-art-card--2 {
  animation-delay: -2.2s;
}

.hero-art-card--3 {
  animation-delay: -4.1s;
}

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

.hero-art-orb--1 {
  top: 8%;
  right: 6%;
  width: 11px;
  height: 11px;
  background: rgba(124, 92, 255, 0.42);
  box-shadow: 0 0 16px rgba(124, 92, 255, 0.28);
  animation: hero-orb-drift 8s ease-in-out infinite;
}

.hero-art-orb--2 {
  bottom: 18%;
  left: 4%;
  width: 9px;
  height: 9px;
  background: rgba(50, 211, 255, 0.45);
  box-shadow: 0 0 14px rgba(50, 211, 255, 0.22);
  animation: hero-orb-drift 6.5s ease-in-out -2s infinite reverse;
}

.hero-art-orb--3 {
  top: 42%;
  left: 38%;
  width: 7px;
  height: 7px;
  background: rgba(46, 229, 157, 0.48);
  box-shadow: 0 0 12px rgba(46, 229, 157, 0.2);
  animation: hero-orb-drift 5.5s ease-in-out -1s infinite;
}

@keyframes hero-glow-pulse {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(1.04);
  }
}

@keyframes hero-flow-draw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes hero-flow-shimmer {
  0%,
  100% {
    opacity: 0.38;
  }
  50% {
    opacity: 0.55;
  }
}

@keyframes hero-card-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes hero-orb-drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(6px, -8px);
  }
  66% {
    transform: translate(-5px, 6px);
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 16px 0 20px;
  }

  .hero-inner {
    flex-direction: column;
    width: 100%;
    gap: 16px;
  }

  .hero-copy {
    max-width: none;
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .hero-product .hero-lead {
    max-width: none;
  }

  .hero-points {
    max-width: none;
  }

  .hero-visual {
    order: -1;
    width: min(280px, 88vw);
    min-width: 0;
    max-height: 180px;
  }

  .hero-art {
    max-width: min(280px, 88vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art-glow,
  .hero-art-flow,
  .hero-art-card,
  .hero-art-orb {
    animation: none;
  }

  .hero-art-flow {
    stroke-dashoffset: 0;
    opacity: 0.55;
  }
}

.grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  min-width: 0;
}

.grid > * {
  min-width: 0;
}

.card {
  grid-column: span 12;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(10px);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 860px) {
  .card.half { grid-column: span 6; }
}

.card h2 {
  margin: 0 0 8px;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.card h2.text-title {
  font-size: var(--text-title-size);
}

.card h2.text-title-lg {
  font-size: var(--text-title-lg-size);
}

.card h2.text-title-xl {
  font-size: var(--text-title-xl-size);
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin: 0 0 10px;
}

.card-head h2 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.card-head h2.text-title {
  font-size: var(--text-title-size);
}

.card-head h2.text-title-lg {
  font-size: var(--text-title-lg-size);
}

.card-head h2.text-title-xl {
  font-size: var(--text-title-xl-size);
}

.card-head-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

/* --- Card content (text panels: About, docs, long copy) --- */

.card-content {
  display: grid;
  gap: clamp(14px, 2vw, 20px);
  min-width: 0;
}

/* Format: display-заголовок + оформленный текст (prose) без утилит text-* */
.card-content--format {
  gap: 12px;
}

.card-content--format .card-content__title {
  font-size: var(--text-display-sm-size);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--color-text);
}

.card .card-content--format .card-content__title.text-display,
.card .card-content--format .card-content__title.text-display-sm,
.card .card-content--format .card-content__title.text-display-xs {
  margin: 0;
}

.card-content--format .card-content__subtitle {
  font-size: var(--text-title-size);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.card-content--format .card-content__lead,
.card-content--format .card-content__section > p,
.card-content--format .card-content__section > ul:not(.card-content__list),
.card-content--format .card-content__section > ol:not(.card-content__list) {
  margin: 0;
  max-width: 72ch;
  font-size: var(--text-body-size);
  line-height: 1.55;
  color: var(--muted);
}

.card-content--format .card-content__lead {
  font-size: var(--text-body-lg-size);
  line-height: 1.55;
}

.card-content--format .card-content__section > ul:not(.card-content__list),
.card-content--format .card-content__section > ol:not(.card-content__list) {
  padding-left: 1.25em;
}

.card-content--format .card-content__section > ul:not(.card-content__list) li + li,
.card-content--format .card-content__section > ol:not(.card-content__list) li + li {
  margin-top: 6px;
}

.card-content--format .card-content__list {
  color: var(--muted);
}

.card-content--format code {
  font-family: var(--mono);
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  word-break: break-word;
}

.card-content--format pre {
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
}

.card-content--format pre code {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: inherit;
  color: inherit;
}

.card-content--format blockquote {
  margin: 0;
  max-width: 72ch;
  padding: 10px 14px 10px 16px;
  border-left: 3px solid var(--accent, rgba(124, 92, 255, 0.55));
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: var(--text-body-size);
  line-height: 1.55;
}

.card-content--format blockquote p {
  margin: 0;
}

.card-content--format blockquote p + p {
  margin-top: 8px;
}

body.theme-light:not(.admin) .card-content--format code {
  background: rgba(14, 18, 42, 0.06);
  border-color: rgba(14, 18, 42, 0.1);
  color: rgba(14, 18, 42, 0.82);
}

body.theme-light:not(.admin) .card-content--format pre {
  background: rgba(14, 18, 42, 0.05);
  color: rgba(14, 18, 42, 0.9);
}

body.theme-light:not(.admin) .card-content--format blockquote {
  background: rgba(14, 18, 42, 0.04);
  border-left-color: rgba(124, 92, 255, 0.45);
}

.card-content--format a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(124, 92, 255, 0.45);
  text-underline-offset: 3px;
}

.card-content--format a:hover {
  color: var(--accent-2);
  text-decoration-color: rgba(50, 211, 255, 0.65);
}

body.theme-light:not(.admin) .card-content--format a {
  color: #5b45d6;
  text-decoration-color: rgba(91, 69, 214, 0.35);
}

body.theme-light:not(.admin) .card-content--format a:hover {
  color: #3d8fd4;
  text-decoration-color: rgba(61, 143, 212, 0.5);
}

.card-content__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
}

.card-content__title {
  flex: 1 1 200px;
  margin: 0;
  color: var(--color-text);
}

.card .card-content__title.text-title,
.card .card-content__title.text-title-lg,
.card .card-content__title.text-title-xl {
  margin: 0;
}

.card-content__head .entry-meta {
  flex: 0 1 auto;
}

.card-content__lead {
  margin: 0;
  max-width: 72ch;
}

.card-content__section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.card-content__section + .card-content__section {
  padding-top: clamp(14px, 2vw, 18px);
  border-top: 1px solid var(--border);
}

.card-content__subtitle {
  margin: 0;
  color: var(--color-text);
}

.card .card-content__subtitle.text-title {
  margin: 0;
}

.card-content__section > .text-body,
.card-content__section > .text-body-lg {
  margin: 0;
  max-width: 72ch;
}

.card-content__list {
  margin: 0;
  padding-left: 1.25em;
  max-width: 72ch;
  color: var(--muted);
  font-size: var(--text-body-size);
  line-height: 1.55;
}

.card-content__list li + li {
  margin-top: 6px;
}

.card-content__list--ordered {
  list-style: decimal;
}

.card-content__foot {
  margin: 0;
  padding-top: 4px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

.card-content--format .card-content__section + .card-content__section {
  padding-top: 10px;
}

.card-content--format .card-content__foot {
  padding-top: 2px;
}

@media (max-width: 640px) {
  .card-content__head .entry-meta {
    justify-content: flex-start;
    width: 100%;
  }
}

/* Key–value list: единый компонент (правки только здесь → везде). */
.kv {
  display: grid;
  gap: 0;
  margin-top: 8px;
}

.kv > .kv-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.kv > .kv-row:last-child {
  border-bottom: 0;
}

.kv-row b {
  color: var(--text);
  font-weight: 600;
}

/* Публичная лента записей: читаемая типографика title/subtitle. */
.kv-row-entry {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.entry-title {
  display: block;
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.entry-subtitle {
  display: block;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  white-space: normal;
  overflow-wrap: anywhere;
}

.card-auth {
  max-width: 520px;
  width: 100%;
  margin-inline: auto;
  padding: 32px 32px 36px;
  border-radius: 18px;
}

/* Заголовок страницы входа/регистрации — явная иерархия. */
.card-auth > h2 {
  margin: 0 0 6px;
  font-size: clamp(22px, 4.2vw, 28px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.98);
}

.card-auth > h2::after {
  content: "";
  display: block;
  margin-top: 18px;
  height: 3px;
  width: 48px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.95), rgba(50, 211, 255, 0.55));
}

.card-auth .kv {
  margin-top: 22px;
  gap: 0;
}

.card-auth > p {
  margin: 28px 0 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.public-auth {
  width: 100%;
}

/* Поля: лейбл над полем, больше вертикального воздуха. */
.public-auth .kv-row {
  flex-direction: column;
  align-items: stretch;
  align-content: stretch;
  gap: 10px;
  padding: 22px 0;
  flex-wrap: nowrap;
}

.public-auth .kv-row:first-of-type {
  padding-top: 0;
}

.public-auth .kv-row > b {
  flex: none;
  min-width: 0;
  width: 100%;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}

.public-auth .kv-row > input {
  flex: none;
  width: 100%;
}

.public-auth .kv-row.public-auth-actions {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 28px;
  margin-top: 4px;
  border-bottom: 0;
}

.public-auth .kv-row.public-auth-actions > b {
  display: none;
}

.public-auth .public-auth-actions {
  justify-content: flex-end;
}

.public-auth input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.22);
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  min-height: 48px;
}

.public-auth input:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.22);
}

.mono {
  font-family: var(--mono);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62%;
  text-align: right;
}

/* Public pages: allow long content to wrap (prevents horizontal scroll). */
body:not(.admin) .mono {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  max-width: 100%;
  text-align: left;
  overflow-wrap: anywhere;
}

.footer {
  margin-top: 16px;
  color: var(--subtle);
  font-size: 12px;
  line-height: 1.5;
}

.footer code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
}


body:not(.admin) a.btn {
  text-decoration: none;
}

.logo .public-logo-svg {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: block;
}

.link {
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
}

.link:hover { text-decoration: underline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 0 14px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.01em;
  min-height: var(--control-h-m);
  height: var(--control-h-m);
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.btn > .i {
  flex: 0 0 auto;
}

.btn > span {
  white-space: nowrap;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
}

.btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
}

.btn:focus-visible {
  outline: 3px solid rgba(124, 92, 255, 0.55);
  outline-offset: 2px;
}

/* Gradient CTAs: avoid Chromium edge seams (border vs fill + filter stacking). */
.btn.btn-primary,
.btn.btn-brand,
.btn.btn-danger {
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Primary: fill on ::before (same layering as .btn-brand; light theme shadows below). */
.btn.btn-primary {
  position: relative;
  isolation: isolate;
  border-color: rgba(255, 255, 255, 0.22);
  background-color: transparent;
  color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(124, 92, 255, 0.22);
}

.btn.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.95), rgba(50, 211, 255, 0.55));
}

.btn.btn-primary:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background-color: transparent;
  box-shadow: 0 14px 34px rgba(124, 92, 255, 0.28);
}

.btn.btn-primary:hover::before {
  background: linear-gradient(135deg, rgba(136, 104, 255, 0.98), rgba(62, 220, 255, 0.62));
}

/* Brand CTA: fill on ::before so pill corners stay clean; body = ring + soft shadow only. */
.btn.btn-brand {
  position: relative;
  isolation: isolate;
  border-color: rgba(255, 255, 255, 0.2);
  background-color: transparent;
  color: rgba(255, 255, 255, 0.98);
  box-shadow: var(--brand-btn-shadow);
}

.btn.btn-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
  background: var(--brand-gradient);
}

.btn.btn-brand:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background-color: transparent;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 12px 32px rgba(90, 72, 200, 0.24),
    0 4px 16px rgba(45, 130, 165, 0.14);
}

.btn.btn-brand:hover::before {
  background: var(--brand-gradient-hover);
}

.btn.btn-brand:focus-visible {
  outline-color: color-mix(in srgb, #5a48c8 55%, transparent);
}

.btn-secondary {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.18);
}

.btn-ghost {
  background: transparent;
}

.btn.btn-danger {
  border-color: var(--color-danger-border);
  background: linear-gradient(135deg, rgba(220, 60, 60, 0.96), rgba(255, 100, 80, 0.88));
  color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px var(--color-danger-shadow);
}

.btn.btn-danger:hover {
  border-color: rgba(255, 120, 120, 0.9);
  background: linear-gradient(135deg, rgba(232, 69, 69, 0.98), rgba(255, 120, 100, 0.92));
  color: rgba(255, 255, 255, 0.98);
  box-shadow: 0 14px 34px rgba(232, 69, 69, 0.34);
}

.btn.btn-danger:focus-visible {
  outline-color: rgba(255, 92, 92, 0.65);
}

.btn-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-s,
.btn-sm {
  min-height: var(--control-h-s);
  height: var(--control-h-s);
  padding: 0 12px;
  font-size: 12px;
  border-radius: 10px;
  gap: 6px;
}

.btn-s > .i,
.btn-sm > .i {
  width: 14px;
  height: 14px;
}

.btn-l {
  min-height: var(--control-h-l);
  height: var(--control-h-l);
  padding: 0 18px;
  font-size: 15px;
  border-radius: 14px;
}

.btn-xl {
  min-height: var(--control-h-xl);
  height: var(--control-h-xl);
  padding: 0 24px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-radius: 16px;
  gap: 10px;
}

/* Form controls: s / m / l */
.control-s,
.control-m,
.control-l,
input.control-s,
input.control-m,
input.control-l,
select.control-s,
select.control-m,
select.control-l,
textarea.control-s,
textarea.control-m,
textarea.control-l {
  box-sizing: border-box;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font-family: var(--sans);
  font-size: 13px;
}

.control-s,
input.control-s,
select.control-s {
  min-height: var(--control-h-s);
  height: var(--control-h-s);
  padding: 0 10px;
  font-size: 12px;
}

.control-m,
input.control-m,
select.control-m,
textarea.control-m {
  min-height: var(--control-h-m);
  padding: 8px 12px;
}

input.control-m,
select.control-m {
  height: var(--control-h-m);
  padding: 0 12px;
}

.control-l,
input.control-l,
select.control-l,
textarea.control-l {
  min-height: var(--control-h-l);
  font-size: 15px;
}

input.control-l,
select.control-l {
  height: var(--control-h-l);
  padding: 0 14px;
}

textarea.control-m {
  min-height: calc(var(--control-h-m) * 2);
}

.control-s:focus-visible,
.control-m:focus-visible,
.control-l:focus-visible,
input.control-s:focus-visible,
input.control-m:focus-visible,
input.control-l:focus-visible,
select.control-s:focus-visible,
select.control-m:focus-visible,
select.control-l:focus-visible {
  outline: none;
  border-color: rgba(124, 92, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.22);
}

body.theme-light:not(.admin) input.control-s,
body.theme-light:not(.admin) input.control-m,
body.theme-light:not(.admin) input.control-l,
body.theme-light:not(.admin) select.control-s,
body.theme-light:not(.admin) select.control-m,
body.theme-light:not(.admin) select.control-l,
body.theme-light:not(.admin) textarea.control-s,
body.theme-light:not(.admin) textarea.control-m,
body.theme-light:not(.admin) textarea.control-l {
  background: var(--color-input-bg);
  border-color: var(--color-input-border);
}

body.theme-light:not(.admin) input.control-s:focus-visible,
body.theme-light:not(.admin) input.control-m:focus-visible,
body.theme-light:not(.admin) input.control-l:focus-visible,
body.theme-light:not(.admin) select.control-s:focus-visible,
body.theme-light:not(.admin) select.control-m:focus-visible,
body.theme-light:not(.admin) select.control-l:focus-visible,
body.theme-light:not(.admin) textarea.control-s:focus-visible,
body.theme-light:not(.admin) textarea.control-m:focus-visible,
body.theme-light:not(.admin) textarea.control-l:focus-visible {
  background: #ffffff;
  border-color: rgba(90, 63, 212, 0.42);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

/* Datepicker */
.datepicker {
  display: block;
  width: 100%;
}

.datepicker input[type="date"] {
  color-scheme: light dark;
}

body.theme-light:not(.admin) .datepicker input[type="date"] {
  color-scheme: light;
}

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(124, 92, 255, 0.14);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  overflow: hidden;
}

.avatar-s {
  width: var(--control-h-s);
  height: var(--control-h-s);
}

.avatar-m {
  width: var(--control-h-m);
  height: var(--control-h-m);
}

.avatar-l {
  width: var(--control-h-l);
  height: var(--control-h-l);
}

.avatar-svg {
  width: 58%;
  height: 58%;
  display: block;
}

/* Ghost: только иконка, без «второго круга» (profile trigger и т.п.) */
.avatar-ghost {
  background: transparent;
  border: none;
  box-shadow: none;
}

.profile-menu-trigger .avatar {
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  background: transparent;
  border: none;
  color: var(--color-primary);
}

.profile-menu-trigger .avatar-svg {
  width: 100%;
  height: 100%;
}

/* Theme switch (tumbler, size s) */
.theme-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-decoration: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.theme-switch-s {
  width: calc(var(--control-h-s) * 1.75);
  height: var(--control-h-s);
}

.theme-switch-track {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.theme-switch-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: calc(var(--control-h-s) - 8px);
  height: calc(var(--control-h-s) - 8px);
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: left 0.15s ease;
}

.theme-switch-thumb .i,
.theme-switch-thumb .i-public {
  width: 12px;
  height: 12px;
  color: rgba(255, 255, 255, 0.98);
}

.theme-switch-thumb .i-public.i-solid,
.theme-switch-thumb .i-public.i-link {
  color: rgba(255, 255, 255, 0.98);
}

.theme-switch[aria-checked="true"] .theme-switch-thumb {
  left: calc(100% - var(--control-h-s) + 5px);
}

body.theme-light:not(.admin) .theme-switch-track {
  background: rgba(14, 18, 42, 0.06);
}

body.theme-dark:not(.admin) .theme-switch-thumb {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
}

/* Palette swatches (Storybook Foundation) */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.palette-swatch {
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
  background: var(--color-surface);
}

.palette-swatch-color {
  height: 56px;
}

.palette-swatch-meta {
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-muted);
}

.palette-swatch-meta strong {
  display: block;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 650;
}

.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.topbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

@media (max-width: 640px) {
  .topbar {
    align-items: center;
    gap: 10px 12px;
    padding: 12px 14px;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar .brand-title span {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .topbar-actions .theme-switch {
    order: 2;
    flex-shrink: 0;
  }

  .topbar-actions .profile-menu,
  .topbar-actions > .stack-row {
    order: 1;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .profile-menu-login {
    max-width: min(140px, 36vw);
  }
}

/* --- Публичная лента публикаций --- */
.feed-section {
  margin-top: clamp(18px, 2.8vw, 28px);
  gap: 12px;
}

.hero-product + .feed-section {
  margin-top: clamp(20px, 3vw, 32px);
}

/* --- AI Radar dashboard --- */
.radar-hero {
  margin-top: clamp(12px, 2vw, 20px);
  padding: clamp(10px, 1.8vw, 18px) 0 clamp(8px, 1.6vw, 14px);
}

.radar-hero .hero-inner {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: clamp(14px, 3vw, 22px);
  box-sizing: border-box;
}

.radar-hero .hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  min-width: 0;
  max-width: none;
  justify-content: center;
}

.radar-hero .hero-title {
  margin-bottom: 4px;
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: -0.055em;
}

.radar-hero .hero-lead {
  margin-bottom: 10px;
  max-width: 48ch;
  font-size: 14px;
  line-height: 1.42;
}

.radar-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  max-width: min(100%, 36rem);
}

.radar-hero-stat {
  display: grid;
  gap: 2px;
  min-width: 4.5rem;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--color-border) 82%, transparent);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-surface) 90%, transparent);
}

.radar-hero-stat-value {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text);
}

.radar-hero-stat-label {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.radar-hero-scope {
  margin: 0 0 12px;
  max-width: 48ch;
  line-height: 1.5;
  color: var(--color-muted);
}

.radar-hero .hero-points {
  flex-flow: row wrap;
  gap: 6px;
  max-width: none;
  padding-left: 0;
}

.radar-hero .hero-points li {
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--color-border) 78%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 72%, transparent);
  font-size: 11px;
  line-height: 1.25;
}

.radar-hero .hero-points li::before {
  margin-top: 0;
}

.radar-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: clamp(8px, 1.5vw, 12px);
}

.radar-status-strip span,
.radar-status-strip__item {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 84%, transparent);
  box-shadow: 0 8px 24px rgba(20, 28, 62, 0.06);
  font-family: var(--mono);
  font-size: var(--text-caption-size);
  color: var(--color-muted);
}

.radar-status-strip b {
  color: var(--color-text);
}

.radar-hero-panel {
  position: relative;
  z-index: 1;
  justify-self: stretch;
  align-self: start;
  align-items: flex-start;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 9px;
  padding: clamp(12px, 1.6vw, 16px);
  padding-left: clamp(12px, 1.8vw, 18px);
  border: 0;
  border-radius: 0;
  border-left: 2px solid color-mix(in srgb, var(--color-primary) 52%, var(--color-border));
  background: transparent;
  box-shadow: none;
}

.radar-watch-copy {
  margin: 0;
  max-width: 36rem;
  color: var(--color-text);
  font-size: clamp(15px, 1.45vw, 18px);
  font-weight: 720;
  line-height: 1.4;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.radar-watch-cta {
  margin-top: 8px;
  align-self: flex-start;
  min-width: min(100%, 18rem);
  text-decoration: none;
}

.radar-watch-icon {
  flex: 0 0 auto;
  opacity: 0.95;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.18));
}

.radar-watch-cta span::after { content: ""; }

body:not(.admin) a.radar-watch-cta {
  text-decoration: none;
}

body:not(.admin) a.radar-watch-cta:hover {
  text-decoration: none;
}

.radar-hero-panel .text-caption {
  margin-top: 2px;
  color: var(--color-muted);
}

.radar-summary-card {
  grid-column: 1 / -1;
}

.radar-briefing {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.radar-briefing::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--color-primary), var(--color-secondary), var(--color-success));
  opacity: 0.8;
}

.radar-briefing-lead,
.radar-signal-panel {
  min-width: 0;
  position: relative;
}

.radar-briefing-lead {
  display: grid;
  gap: 14px;
  padding-left: 10px;
}

.radar-briefing-lead .text-body-lg {
  max-width: 68ch;
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
}

/* Methodology note: standalone typography (do not depend on .text-caption cascade). */
.radar-methodology,
.text-caption.radar-methodology {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  max-width: 72ch;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--color-muted);
}

.radar-methodology::before {
  content: "Методология";
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-subtle);
}

.radar-signal-panel {
  display: grid;
  gap: 12px;
  padding: clamp(12px, 2vw, 16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  /* Match the public “glass” surfaces (topbar/card) in dark theme. */
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.radar-signal-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.14), transparent 45%);
  opacity: 0.9;
}

.radar-signal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.radar-signal-list {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: radar-signal;
}

.radar-signal-item {
  counter-increment: radar-signal;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 0 0 12px 28px;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.radar-signal-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.radar-signal-item::before {
  content: counter(radar-signal, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 2px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--color-muted);
}

.radar-signal-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--color-muted);
  font-size: var(--text-body-size);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.radar-signal-copy > span {
  min-width: 0;
}

.radar-signal-copy b {
  display: block;
  color: var(--color-text);
  font-size: var(--text-title-size);
  line-height: 1.35;
}

.radar-signal-copy p {
  margin: 0;
}

.radar-signal-meta,
.radar-lifecycle {
  display: block;
  color: var(--color-muted);
}

.radar-section {
  align-items: start;
}

.radar-card-grid {
  grid-column: 1 / -1;
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, var(--radar-card-col-min)), 1fr)
  );
  gap: clamp(12px, 2vw, 18px);
}

.radar-card-grid > .card {
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
}

.radar-model-card,
.radar-tool-card,
.radar-breakthrough-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}

.radar-model-card .entry-meta,
.radar-tool-card .entry-meta,
.radar-breakthrough-card .entry-meta {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.radar-tool-card .text-body-lg,
.radar-tool-card .text-caption,
.radar-model-card .text-body,
.radar-breakthrough-card .text-body {
  overflow-wrap: anywhere;
}

.radar-section--models .radar-card-grid {
  grid-template-columns: minmax(0, 1fr);
}

.radar-section--models .radar-model-card {
  gap: 12px;
  width: 100%;
  max-width: 100%;
}

.radar-section--tools .radar-tool-card {
  background:
    linear-gradient(180deg, rgba(50, 211, 255, 0.06), transparent 38%),
    var(--color-surface);
}

.radar-section--breakthroughs .radar-breakthrough-card {
  background:
    linear-gradient(145deg, rgba(124, 92, 255, 0.07), transparent 45%),
    var(--color-surface);
}

.radar-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.radar-card-head > div {
  flex: 1 1 auto;
  min-width: 0;
}

.radar-card-head h3 {
  margin: 0 0 4px;
  overflow-wrap: anywhere;
}

.radar-status,
.radar-impact {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: min(100%, 240px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: var(--text-caption-size);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

.radar-status--leader {
  color: var(--label-new-text);
  background: var(--label-new-bg);
}

.radar-status--challenger {
  color: var(--label-tone-b-text);
  background: var(--label-tone-b-bg);
}

.radar-status--niche_innovator {
  color: var(--label-tone-a-text);
  background: var(--label-tone-a-bg);
}

.radar-impact {
  min-width: 42px;
  color: var(--label-tone-a-text);
  background: var(--label-tone-a-bg);
}

.radar-model-card__lead {
  display: grid;
  gap: 14px 20px;
  width: 100%;
  min-width: 0;
  align-items: start;
}

@media (min-width: 640px) {
  .radar-model-card__lead {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.radar-model-card__copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.radar-model-card__copy .text-body {
  margin: 0;
}

.radar-model-card__tags.entry-meta {
  justify-content: flex-start;
}

/* best_for · variant C (outline) — production */
.radar-model-card__tags .entry-label--tone-b {
  background: transparent;
  color: var(--color-muted);
  border: 1px solid color-mix(in srgb, var(--color-border) 85%, var(--color-text) 12%);
  font-weight: 500;
  box-shadow: none;
}

/* Storybook: сравнение A/B (C = production по умолчанию) */
.radar-model-card__tags--variant-a .entry-label--tone-b {
  background: var(--label-tone-b-bg);
  color: var(--label-tone-b-text);
  border: 1px solid transparent;
  font-weight: 600;
}

.radar-model-card__tags--variant-b .entry-label--tone-b {
  background: var(--label-radar-use-bg);
  color: var(--label-radar-use-text);
  border: 1px solid var(--label-radar-use-border);
  font-weight: 500;
}

.radar-model-card__instrument {
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  justify-self: end;
}

.radar-score-list {
  display: grid;
  gap: 8px;
}

.radar-score-list--instrument {
  width: fit-content;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--color-border) 90%, var(--color-primary) 8%);
  background: color-mix(in srgb, var(--color-surface-elevated) 94%, var(--color-primary) 3%);
  box-sizing: border-box;
}

.radar-score-list--instrument .radar-score {
  grid-template-columns:
    var(--radar-score-label-col)
    var(--radar-score-track-width)
    var(--radar-score-value-col);
  gap: 10px 12px;
}

.radar-score-list--instrument .radar-score-track {
  height: 7px;
}

.radar-score-list--instrument .radar-score > span:first-child {
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* Tiles: Storybook concepts only (not paired with instrument in production). */
.radar-score-list--tiles {
  display: grid;
  grid-template-columns: repeat(2, var(--radar-score-tile-cell));
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
}

.radar-score-tile {
  display: grid;
  gap: 6px;
  padding: 9px 10px;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-elevated);
}

.radar-score-tile__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.radar-score-tile__label {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radar-score-tile__value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
  flex-shrink: 0;
}

.radar-score-tile__track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(127, 127, 150, 0.16);
}

.radar-score-tile__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.radar-score {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 8px;
  font-size: var(--text-caption-size);
  color: var(--color-muted);
}

.radar-score b {
  color: var(--color-text);
  text-align: right;
}

.radar-score-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(127, 127, 150, 0.16);
}

.radar-score-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
}

.radar-evidence-footer,
.radar-source-refs {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  min-width: 0;
}

.radar-evidence-footer p,
.radar-source-refs p {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.radar-evidence-footer b,
.radar-source-refs b {
  font-weight: inherit;
  color: inherit;
}

.radar-source-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.radar-source-refs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.radar-source-refs li {
  min-width: 0;
}

.radar-source-chip,
.radar-source-refs a.radar-source-chip {
  display: inline-flex;
  align-items: center;
  max-width: min(100%, 220px);
  min-width: 0;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--color-border) 88%, var(--color-primary));
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface-elevated) 92%, var(--color-primary) 4%);
  color: var(--color-primary);
  font-family: var(--mono);
  font-weight: 650;
  font-size: var(--text-caption-size);
  line-height: 1.25;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.radar-source-chip:hover,
.radar-source-refs a.radar-source-chip:hover {
  text-decoration: none;
  border-color: color-mix(in srgb, var(--color-primary) 48%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary) 12%, var(--color-surface-elevated));
  color: var(--color-text);
  box-shadow: 0 6px 16px rgba(124, 92, 255, 0.14);
  transform: translateY(-1px);
}

.radar-source-chip:active,
.radar-source-refs a.radar-source-chip:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(124, 92, 255, 0.1);
}

.radar-source-chip:focus-visible,
.radar-source-refs a.radar-source-chip:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-primary) 55%, transparent);
  outline-offset: 2px;
  text-decoration: none;
}

body.theme-light:not(.admin) .radar-source-chip,
body.theme-light:not(.admin) .radar-source-refs a.radar-source-chip {
  color: #5a3fd4;
}

body.theme-light:not(.admin) .radar-source-chip:hover,
body.theme-light:not(.admin) .radar-source-refs a.radar-source-chip:hover {
  color: rgba(14, 18, 42, 0.92);
  text-decoration: none;
}

@media (min-width: 900px) {
  .radar-hero .hero-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .radar-hero-panel {
    justify-self: start;
    width: fit-content;
    max-width: min(46ch, 440px);
  }

  .radar-briefing {
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  }
}

/* Radar cards: single column + shrink-to-fit content (mobile / narrow) */
@media (max-width: 820px) {
  .radar-card-grid {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  .radar-card-grid > * {
    min-width: 0;
    max-width: 100%;
  }

  .radar-model-card .entry-meta,
  .radar-tool-card .entry-meta,
  .radar-breakthrough-feed-section .entry-meta,
  .radar-breakthrough-feed-extra .entry-meta {
    justify-content: flex-start;
  }

  .radar-model-card__instrument {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
  }

  .radar-score-list--instrument {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .radar-score-list--instrument .radar-score {
    grid-template-columns:
      minmax(4.5rem, 30%)
      minmax(5rem, 1fr)
      var(--radar-score-value-col);
  }

  .radar-source-chip-list,
  .radar-source-refs ul {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .radar-source-chip,
  .radar-source-refs a.radar-source-chip {
    display: inline-flex;
    width: auto;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    text-align: center;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
  }

  .radar-source-link {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .radar-breakthrough-feed-extra,
  .radar-breakthrough-entry .media-card__actions {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 24px max(16px, env(safe-area-inset-right)) 44px max(16px, env(safe-area-inset-left));
  }

  .card {
    padding: 14px;
  }

  .radar-hero {
    padding-top: 6px;
  }

  .radar-hero .hero-title {
    font-size: clamp(28px, 9vw, 40px);
    line-height: 1.06;
    overflow-wrap: anywhere;
  }

  .radar-hero .hero-lead,
  .radar-hero-scope {
    max-width: none;
  }

  .radar-hero .hero-points {
    flex-direction: column;
    align-items: stretch;
  }

  .radar-hero .hero-points li {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .radar-hero-stat {
    flex: 1 1 calc(50% - 8px);
    min-width: calc(50% - 8px);
  }

  .radar-watch-cta {
    width: 100%;
    justify-content: center;
  }

  .radar-status-strip span {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .radar-signal-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .radar-card-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .radar-model-card__instrument {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
  }

  .radar-score-list--instrument {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .radar-score-list--instrument .radar-score {
    grid-template-columns:
      minmax(4.25rem, 30%)
      minmax(5rem, 1fr)
      var(--radar-score-value-col);
    gap: 8px 10px;
  }

  .radar-score {
    grid-template-columns: minmax(72px, 28%) minmax(0, 1fr) 28px;
    gap: 6px;
  }

  .media-card__title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .media-card--layout-row .media-card__body {
    grid-template-columns: 1fr;
  }

  .feed-section-head h2 {
    font-size: clamp(20px, 6vw, 28px);
    overflow-wrap: anywhere;
  }
}

.feed-section-head {
  grid-column: 1 / -1;
  margin: 0 0 4px;
}

.feed-section-head h2 {
  margin: 0;
  color: var(--color-text);
}

.feed-section-head__title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.feed-section-head__title > .i-public {
  flex-shrink: 0;
  margin-top: 3px;
}

.radar-watch-updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.feed-show-more summary.feed-show-more__trigger {
  gap: 8px;
  align-items: center;
}

/* Evidence в карточках: текстовая ссылка + иконка (без pill) */
.radar-source-link,
.radar-source-refs a.radar-source-link,
.radar-evidence-footer a.radar-source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(100%, 28rem);
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-primary);
  font-family: var(--mono);
  font-weight: 600;
  font-size: var(--text-caption-size);
  line-height: 1.35;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: none;
  transform: none;
  transition: color 0.16s ease;
}

.radar-source-link:hover,
.radar-source-refs a.radar-source-link:hover,
.radar-evidence-footer a.radar-source-link:hover {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: transparent;
  border: none;
  box-shadow: none;
  transform: none;
}

.radar-source-link:active,
.radar-source-refs a.radar-source-link:active,
.radar-evidence-footer a.radar-source-link:active {
  transform: none;
  box-shadow: none;
}

.radar-source-link:focus-visible,
.radar-source-refs a.radar-source-link:focus-visible,
.radar-evidence-footer a.radar-source-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-primary) 55%, transparent);
  outline-offset: 2px;
  text-decoration: none;
}

body.theme-light:not(.admin) .radar-source-link,
body.theme-light:not(.admin) .radar-source-refs a.radar-source-link,
body.theme-light:not(.admin) .radar-evidence-footer a.radar-source-link {
  color: #5a3fd4;
}

body.theme-light:not(.admin) .radar-source-link:hover,
body.theme-light:not(.admin) .radar-source-refs a.radar-source-link:hover,
body.theme-light:not(.admin) .radar-evidence-footer a.radar-source-link:hover {
  color: rgba(14, 18, 42, 0.92);
}

.radar-source-link--with-icon,
.radar-source-chip--with-icon {
  gap: 6px;
}

.radar-source-link--with-icon > .i-public,
.radar-source-chip--with-icon > .i-public {
  flex-shrink: 0;
  color: inherit;
}

.radar-source-link--with-icon:hover > .i-public,
.radar-source-link--with-icon:focus-visible > .i-public,
.radar-source-chip--with-icon:hover > .i-public,
.radar-source-chip--with-icon:focus-visible > .i-public {
  color: inherit;
}

.i-public.i-link {
  color: inherit;
}

/* --- Media cards (content tiles) --- */

.card-grid {
  display: grid;
  gap: clamp(12px, 2vw, 20px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 320px));
  justify-content: start;
}

.card-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 360px));
}

.card-grid--dense {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 240px));
}

.card-grid--list {
  grid-template-columns: 1fr;
  max-width: 100%;
}

.card-grid--center {
  justify-content: center;
}

.media-card {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

.media-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.media-card__title {
  flex: 1 1 200px;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--color-text);
}

.media-card__body {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 16px);
  min-width: 0;
}

.media-card__media {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.media-card__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: var(--media-aspect-publication);
  object-fit: cover;
}

.media-card__text {
  margin: 0;
  min-width: 0;
}

.media-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

/* Layout: row (media + text side by side) */
.media-card--layout-row .media-card__body {
  display: grid;
  grid-template-columns: minmax(140px, 32%) minmax(0, 1fr);
  gap: clamp(16px, 2.5vw, 24px);
  align-items: start;
}

.media-card--layout-row .media-card__media {
  grid-row: 1;
}

.media-card--layout-row .media-card__text {
  grid-row: 1;
}

.media-card--no-media.media-card--layout-row .media-card__body {
  display: block;
}

/* Layout: stack (media on top) */
.media-card--layout-stack {
  width: 100%;
  max-width: var(--media-card-stack-max);
  align-self: start;
}

.media-card--layout-stack .media-card__body {
  flex-direction: column;
}

/* Layout: compact */
.media-card--layout-compact .media-card__head {
  margin-bottom: 8px;
}

.media-card--layout-compact .media-card__title {
  font-size: var(--text-title-size);
}

.media-card--layout-compact .media-card__actions {
  margin-top: 8px;
}

/* Kind: aspect ratios */
.media-card--publication .media-card__img {
  aspect-ratio: var(--media-aspect-publication);
}

.media-card--book .media-card__img {
  aspect-ratio: var(--media-aspect-book);
}

.media-card--film .media-card__img {
  aspect-ratio: var(--media-aspect-film);
}

.media-card--product .media-card__img {
  aspect-ratio: var(--media-aspect-product);
}

.media-card--stage .media-card__img {
  aspect-ratio: var(--media-aspect-stage);
}

.media-card--resume .media-card__media--avatar {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}

.media-card--resume .media-card__img {
  aspect-ratio: var(--media-aspect-resume);
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.media-card--resume.media-card--layout-stack .media-card__body {
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
}

.media-card--empty .media-card__head {
  margin-bottom: 8px;
}

.media-card--empty .media-card__media {
  display: none;
}

.media-card--empty .media-card__body {
  display: block;
}

/* Feed list shell (publication rows in .entry-feed) */
.entry-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.entry-card {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.entry-card:last-child {
  border-bottom: 0;
}

.radar-breakthrough-entry .media-card__actions {
  display: grid;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

.radar-breakthrough-feed-extra {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.radar-breakthrough-feed-extra > .text-body {
  margin: 0;
  color: var(--color-muted);
}

.radar-breakthrough-entry .radar-evidence-footer {
  margin-top: 0;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.entry-meta .entry-label {
  flex: 0 1 auto;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
}

.entry-label {
  display: inline-block;
  vertical-align: middle;
  width: fit-content;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-label--date {
  background: var(--label-date-bg);
  color: var(--label-date-text);
  font-weight: 500;
}

.entry-label--new {
  background: var(--label-new-bg);
  color: var(--label-new-text);
}

.entry-label--watch-now {
  padding-inline: 10px;
  padding-block: 4px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.entry-label--tone-a {
  background: var(--label-tone-a-bg);
  color: var(--label-tone-a-text);
}

.entry-label--tone-b {
  background: var(--label-tone-b-bg);
  color: var(--label-tone-b-text);
}

.feed-show-more {
  border: 0;
  margin: 0;
  padding: 14px 0 2px;
}

.feed-show-more summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
}

.feed-show-more summary::-webkit-details-marker {
  display: none;
}

.feed-show-more summary::marker {
  content: "";
}

.feed-show-more[open] summary {
  display: none;
}

.feed-show-more__trigger {
  min-height: var(--control-h-s);
}

.entry-feed-more {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.entry-card.entry-card--empty,
.entry-card.media-card--empty {
  padding: 12px 0;
}

@media (max-width: 640px) {
  .media-card--layout-row .media-card__body {
    grid-template-columns: 1fr;
  }
  .entry-meta {
    justify-content: flex-start;
    width: 100%;
  }
}

/* Icon catalog (Storybook + future public icon slots) */
.icon-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.icon-catalog-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.icon-catalog-tile__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.icon-catalog-tile__slug {
  font-size: 13px;
  line-height: 1.2;
}

.icon-catalog-tile__zone {
  margin: 0;
  opacity: 0.75;
}

.icon-catalog-tile__usage {
  margin: 0;
  line-height: 1.35;
}

.icon-catalog-tile__badge {
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.icon-catalog-tile__badge--exists {
  border: 1px solid color-mix(in srgb, var(--color-success) 35%, var(--color-border));
  background: color-mix(in srgb, var(--color-success) 12%, transparent);
  color: var(--color-success);
}

.icon-catalog-tile__badge--planned {
  border: 1px solid color-mix(in srgb, var(--color-warning) 40%, var(--color-border));
  background: color-mix(in srgb, var(--color-warning) 14%, transparent);
  color: var(--color-warning);
}

.icon-catalog-tile__badge--glyph {
  border: 1px solid color-mix(in srgb, var(--color-primary) 40%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary) 14%, transparent);
  color: var(--color-primary);
}

.icon-thumb {
  flex: 0 0 auto;
  display: inline-flex;
}

.icon-thumb__frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px dashed var(--color-border);
  background: var(--color-surface-elevated);
  color: var(--color-muted);
}

.icon-thumb__abbrev {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1;
  user-select: none;
}

.icon-thumb--planned .icon-thumb__frame {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--color-warning) 55%, var(--color-border));
  background: color-mix(in srgb, var(--color-warning) 8%, var(--color-surface-elevated));
  color: color-mix(in srgb, var(--color-warning) 85%, var(--color-muted));
}

.icon-catalog-section {
  margin-bottom: 20px;
}

.icon-catalog-section h3 {
  margin: 0 0 10px;
}

.icon-thumb--glyph .icon-thumb__frame {
  border-style: solid;
  color: var(--color-text);
}

.icon-thumb--glyph .icon-thumb__frame .i-public {
  display: block;
}

.i-public {
  flex: 0 0 auto;
  display: block;
}

.i-public.i-s {
  width: 14px;
  height: 14px;
}

.i-public.i-m {
  width: 18px;
  height: 18px;
}

.i-public.i-l {
  width: 22px;
  height: 22px;
}

.i-public.i-xl {
  width: 24px;
  height: 24px;
}

.i-public.i-solid {
  color: var(--color-text);
}

.btn > .i-public.i-solid,
.btn-primary > .i-public.i-solid,
.btn-brand > .i-public.i-solid {
  color: inherit;
}

.i-public.i-gradient {
  color: transparent;
}

.btn > .i-public.i-gradient,
.btn-primary > .i-public.i-gradient,
.btn-brand > .i-public.i-gradient {
  color: inherit;
}

.icon-variant-matrix {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}

.icon-variant-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 48px;
}

.icon-variant-cell__label {
  font-size: 10px;
  font-family: var(--mono);
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-menu-item--with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.profile-menu-item--with-icon .i-public {
  flex-shrink: 0;
  color: inherit;
}

.profile-menu-item--with-icon:hover .i-public,
.profile-menu-item--with-icon:focus-visible .i-public {
  color: inherit;
}
