/* ============================================================
   Креативный Хаб — Portrait (Style Reference)
   Стена поляроидов на кремовой бумаге. Глубокий navy-инк как единственный
   структурный цвет + единственная рукописная радуга на CTA и слове курсивом.
   ============================================================ */
:root {
  /* Colors */
  --color-portrait-ink: #08304c;
  --color-nautical-teal: #084e72;
  --color-charcoal-outline: #353535;
  --color-graphite-body: #2c2c2c;
  --color-slate-helper: #797979;
  --color-iron-quiet: #585858;
  --color-ash-divider: #dedede;
  --color-fog-edge: #c7c7c7;
  --color-mist-hairline: #eeeeee;
  --color-white-canvas: #ffffff;
  --color-mint-wash: #d7ffe2;
  --color-sky-wash: #e8f1ff;
  --color-peach-wash: #ffebd6;

  --gradient-rainbow: linear-gradient(90deg, #26c0ff, #e600c2 20%, #ff4940 40%, #ffa130 60%, #ffc837 80%, #00cc3d);

  /* Typography */
  --font-switzer: 'Inter', 'Manrope', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-basier: 'Plus Jakarta Sans', 'General Sans', 'Satoshi', ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-system-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Motion */
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-glide: 0.6s;
  --dur-slow: 1s;

  /* Layout */
  --page-max-width: 1200px;
  --section-gap: 80px;
  --card-padding: 16px;
  --element-gap: 16px;

  /* Radii */
  --radius-nav: 28px;
  --radius-tags: 9999px;
  --radius-cards: 24px;
  --radius-images: 24px;
  --radius-inputs: 16px;
  --radius-buttons: 28px;

  /* Shadows (barely-there, stacked thin layers) */
  --ring-soft: 0 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-soft: 0 0 0 1px rgba(0, 0, 0, 0.05),
    0 16px 16px -8px rgba(0, 0, 0, 0.03), 0 10px 10px -5px rgba(0, 0, 0, 0.03),
    0 5px 5px -2.5px rgba(0, 0, 0, 0.03), 0 3px 3px -1.5px rgba(0, 0, 0, 0.03),
    0 2px 2px -1px rgba(0, 0, 0, 0.03), 0 1px 1px -0.5px rgba(0, 0, 0, 0.03);
  --shadow-nav: 0 16px 16px -8px rgba(0, 0, 0, 0.03), 0 10px 10px -5px rgba(0, 0, 0, 0.03),
    0 5px 5px -2.5px rgba(0, 0, 0, 0.03), 0 3px 3px -1.5px rgba(0, 0, 0, 0.03),
    0 2px 2px -1px rgba(0, 0, 0, 0.03), 0 1px 1px -0.5px rgba(0, 0, 0, 0.03);

  /* Legacy aliases (для inline-стилей в app.js) */
  --color-ink: #08304c;
  --display: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  --font-helvetica-now: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --bg: #ffffff;
  --color-ember: #08304c;
  --color-sulfur: #e8f1ff;
  --color-pumice: #dedede;
  --color-plasma-violet: #084e72;
  --amber: #084e72;
  --success: #08304c;
  --danger: #797979;
  --info: #084e72;
  --primary: #08304c;
  --primary-2: #084e72;
  --primary-soft: #e8f1ff;
  --grad: #08304c;
  --amber-soft: #ffebd6;
  --success-soft: #d7ffe2;
  --danger-soft: #ffebd6;
  --info-soft: #e8f1ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-switzer);
  font-weight: 400;
  color: var(--color-portrait-ink);
  background: var(--color-white-canvas);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--color-portrait-ink); max-width: 100%; }
img, svg, video, canvas, audio { max-width: 100%; }
.hidden { display: none !important; }
::selection { background: var(--color-sky-wash); color: var(--color-portrait-ink); }

/* ---------------- Типографика ---------------- */
.section-title, .view-title, .hero-display, .login-title, .modal-title, .card-title, .li-title, .lcard h3, .role-card h3, .vignette-title {
  font-family: var(--font-basier);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.06;
}
.rainbow-word {
  font-style: italic;
  background: var(--gradient-rainbow);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbowPan 8s linear infinite;
}

/* ---------------- Кнопки ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-switzer); font-weight: 500; font-size: 15px; line-height: 1;
  border-radius: var(--radius-buttons);
  padding: 10px 18px;
  letter-spacing: 0;
  transition: background var(--dur-glide) var(--ease-soft), color var(--dur-glide) var(--ease-soft),
              border-color var(--dur-glide) var(--ease-soft), letter-spacing var(--dur-glide) var(--ease-soft),
              transform var(--dur-glide) var(--ease-soft);
  white-space: nowrap;
  will-change: transform;
}
.btn:active { transform: scale(.98); }
.btn-primary, .btn-success { background: transparent; border: 1.5px solid var(--color-portrait-ink); color: var(--color-portrait-ink); }
.btn-primary:hover, .btn-success:hover { background: var(--color-sky-wash); letter-spacing: .01em; }
.btn-secondary, .btn-ghost { background: transparent; border: 1px solid transparent; color: var(--color-portrait-ink); }
.btn-secondary:hover, .btn-ghost:hover { color: var(--color-nautical-teal); letter-spacing: .01em; }
.btn-outline { background: transparent; border: 1px solid var(--color-ash-divider); color: var(--color-portrait-ink); }
.btn-outline:hover { border-color: var(--color-portrait-ink); background: var(--color-sky-wash); }
.btn-rainbow, .btn-gosuslugi {
  background: linear-gradient(var(--color-white-canvas), var(--color-white-canvas)) padding-box, var(--gradient-rainbow) border-box;
  border: 1.5px solid transparent;
  color: var(--color-portrait-ink);
  background-size: 200% 100%;
  animation: rainbowBorder 8s linear infinite;
}
.btn-rainbow:hover, .btn-gosuslugi:hover { letter-spacing: .01em; }
.btn-dark { background: transparent; border: 1.5px solid var(--color-portrait-ink); color: var(--color-portrait-ink); }
.btn-dark:hover { background: var(--color-sky-wash); }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-sm { padding: 7px 15px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- Тэги / бейджи / чипы ---------------- */
.badge, .chip, .tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-tags);
  font-family: var(--font-switzer); font-weight: 600; font-size: 11px; line-height: 1.5;
  letter-spacing: .06em; text-transform: uppercase;
  background: var(--color-mist-hairline); color: var(--color-graphite-body);
  white-space: nowrap;
}
.badge.green { background: var(--color-mint-wash); color: var(--color-portrait-ink); }
.badge.amber { background: var(--color-peach-wash); color: var(--color-portrait-ink); }
.badge.violet { background: var(--color-sky-wash); color: var(--color-portrait-ink); }
.badge.blue { background: var(--color-sky-wash); color: var(--color-nautical-teal); }
.badge.red { background: var(--color-portrait-ink); color: var(--color-white-canvas); }
.chip { background: transparent; border: 1px solid var(--color-ash-divider); color: var(--color-slate-helper); text-transform: none; letter-spacing: 0; font-weight: 400; }
.tag { background: var(--color-sky-wash); color: var(--color-portrait-ink); }

/* ============================================================
   ЛЕНДИНГ
   ============================================================ */
.landing { background: var(--color-white-canvas); }

/* Floating pill nav */
.top-nav { position: sticky; top: 16px; z-index: 100; max-width: var(--page-max-width); margin: 0 auto; padding: 0 24px; }
.nav-pill {
  display: flex; align-items: center; gap: 16px;
  background: var(--color-white-canvas); border-radius: var(--radius-nav);
  padding: 8px 14px; height: 56px;
  box-shadow: var(--shadow-nav);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-rainbow { width: 12px; height: 12px; border-radius: 4px; background: var(--gradient-rainbow); flex: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--color-portrait-ink); background: transparent; color: var(--color-portrait-ink); display: flex; align-items: center; justify-content: center; font-family: var(--font-basier); font-size: 14px; font-weight: 600; flex: none; }
.brand-word { font-family: var(--font-basier); font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.announce-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--color-sky-wash); border-radius: var(--radius-tags); padding: 6px 13px; font-size: 12px; color: var(--color-portrait-ink); }
.announce-pill b { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.nav-links { display: flex; gap: 18px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--color-portrait-ink); }
.nav-links a:hover { color: var(--color-nautical-teal); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-social { font-size: 13px; color: var(--color-slate-helper); }
.nav-divider { width: 1px; height: 18px; background: var(--color-ash-divider); }

/* Hero */
.hero { position: relative; max-width: var(--page-max-width); margin: 0 auto; padding: 90px 24px 40px; text-align: center; overflow: visible; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--color-mint-wash); color: var(--color-portrait-ink); border-radius: var(--radius-tags); padding: 5px 13px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 26px; }
.hero-display { font-size: clamp(44px, 7vw, 76px); font-weight: 600; line-height: 1.0; letter-spacing: -0.056em; max-width: 900px; margin: 0 auto; }
.hero-sub { font-size: 18px; line-height: 1.45; color: var(--color-graphite-body); max-width: 520px; margin: 26px auto 0; }
.hero-search { display: flex; align-items: center; max-width: 600px; margin: 34px auto 0; background: var(--color-white-canvas); border: 1px solid var(--color-fog-edge); border-radius: 9999px; padding: 6px 6px 6px 22px; box-shadow: var(--shadow-soft); }
.hero-search .hs-prefix { color: var(--color-fog-edge); font-size: 15px; }
.hero-search .hs-input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; padding: 10px 8px; font-size: 16px; color: var(--color-portrait-ink); }
.hero-login { margin-top: 18px; font-size: 14px; color: var(--color-slate-helper); }
.hero-login a { color: var(--color-portrait-ink); font-weight: 500; }

/* Scattered polaroids */
.polaroid { position: absolute; width: 150px; border-radius: var(--radius-images); box-shadow: var(--ring-soft), 0 10px 16px -10px rgba(0,0,0,.08); background: var(--color-white-canvas); padding: 8px; }
.polaroid .p-img { border-radius: 16px; height: 130px; overflow: hidden; }
.polaroid .p-img svg { width: 100%; height: 100%; display: block; }
.polaroid .p-cap { font-size: 10px; color: var(--color-slate-helper); margin-top: 6px; text-align: left; padding: 0 4px; }
.polaroid.p1 { top: 100px; left: -40px; transform: rotate(-5deg); animation: polaroidFloat 9s ease-in-out infinite; }
.polaroid.p2 { top: 60px; right: -20px; transform: rotate(4deg); animation: polaroidFloat 11s ease-in-out infinite .5s; }
.polaroid.p3 { bottom: 0; left: 6%; transform: rotate(-3deg); animation: polaroidFloat 10s ease-in-out infinite 1s; }
.polaroid.p4 { bottom: -10px; right: 8%; transform: rotate(6deg); animation: polaroidFloat 12s ease-in-out infinite 1.5s; }
@media (max-width: 980px) { .polaroid { display: none; } }

/* Stats */
.stats-band { max-width: var(--page-max-width); margin: 40px auto 0; padding: 0 24px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat-feature { background: var(--color-white-canvas); border-radius: var(--radius-cards); box-shadow: var(--shadow-soft); padding: 26px 24px; display: flex; flex-direction: column; gap: 10px; }
.stat-feature .sf-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--color-slate-helper); }
.stat-feature .sf-num { font-size: clamp(36px, 4vw, 52px); font-weight: 600; line-height: 1; color: var(--color-portrait-ink); font-family: var(--font-basier); letter-spacing: -0.03em; }

/* Sections */
.landing-section { max-width: var(--page-max-width); margin: 0 auto; padding: var(--section-gap) 24px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 44px; flex-wrap: wrap; }
.section-index { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--color-slate-helper); margin-bottom: 16px; }
.section-title { font-size: clamp(34px, 5.5vw, 49px); font-weight: 600; line-height: 1.04; letter-spacing: -0.04em; }
.section-sub { font-size: 16px; color: var(--color-graphite-body); max-width: 46ch; margin-top: 14px; }

/* Card grid */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.lcard {
  background: var(--color-white-canvas); border-radius: var(--radius-cards); box-shadow: var(--shadow-soft);
  padding: 24px; display: flex; flex-direction: column; gap: 12px;
  transition: transform var(--dur-glide) var(--ease-soft), box-shadow var(--dur-glide) var(--ease-soft);
}
.lcard:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 20px 20px -10px rgba(0,0,0,.07), 0 10px 10px -5px rgba(0,0,0,.04); }
.lcard .lcard-top { display: flex; align-items: center; justify-content: space-between; }
.lcard-num { font-size: 13px; color: var(--color-slate-helper); }
.lcard h3 { font-size: 22px; font-weight: 600; line-height: 1.1; }
.lcard p { font-size: 14px; color: var(--color-graphite-body); line-height: 1.5; }

/* Vignette grid */
.vignette-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; text-align: center; }
@media (max-width: 900px) { .vignette-grid { grid-template-columns: 1fr; } }
.vignette { background: var(--color-white-canvas); border-radius: var(--radius-cards); box-shadow: var(--shadow-soft); padding: 28px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; transition: transform var(--dur-glide) var(--ease-soft); }
.vignette:hover { transform: translateY(-3px); }
.vignette-title { font-size: 22px; font-weight: 600; color: var(--color-portrait-ink); }
.vignette-circle {
  width: 120px; height: 120px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-basier); font-size: 40px; font-weight: 600; color: var(--color-portrait-ink);
  background: var(--color-sky-wash);
}
.vignette-desc { font-size: 13px; color: var(--color-graphite-body); max-width: 34ch; }
.hex-dots { display: flex; gap: 8px; justify-content: center; }
.hex { width: 12px; height: 12px; background: var(--color-portrait-ink); opacity: .2; clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0% 50%); }
.hex.active { opacity: 1; background: var(--gradient-rainbow); }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.kpi { background: var(--color-white-canvas); border-radius: var(--radius-cards); box-shadow: var(--shadow-soft); padding: 26px 24px; display: flex; flex-direction: column; gap: 10px; }
.kpi-num { font-family: var(--font-basier); font-size: clamp(34px, 4vw, 48px); font-weight: 600; line-height: 1; letter-spacing: -0.03em; color: var(--color-portrait-ink); }
.kpi span { font-size: 12px; color: var(--color-slate-helper); }

/* Partner marquee */
.partner-strip { border-top: 1px solid var(--color-ash-divider); border-bottom: 1px solid var(--color-ash-divider); margin-top: var(--section-gap); overflow: hidden; background: var(--color-white-canvas); }
.marquee { display: flex; width: max-content; animation: marquee 34s linear infinite; }
.marquee:hover { animation-play-state: paused; }
.partner-item { display: flex; align-items: center; gap: 20px; padding: 15px 20px; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; color: var(--color-slate-helper); }
.partner-item .pdot { color: var(--color-fog-edge); }

/* Footer */
.landing-footer { max-width: var(--page-max-width); margin: 0 auto; padding: 44px 24px 60px; display: flex; align-items: flex-start; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.landing-footer p { font-size: 12px; color: var(--color-slate-helper); max-width: 460px; line-height: 1.5; }

/* ============================================================
   ЭКРАН ВХОДА
   ============================================================ */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px; background: radial-gradient(60% 50% at 50% 0%, rgba(142, 81, 255, .14), transparent 60%), var(--color-white-canvas); }
.login-card { width: 100%; max-width: 480px; background: var(--color-white-canvas); border-radius: var(--radius-cards); box-shadow: var(--shadow-soft); padding: 44px; }
.login-title { font-size: 40px; font-weight: 600; margin-top: 24px; }
.login-sub { font-size: 15px; color: var(--color-graphite-body); margin: 14px 0 26px; line-height: 1.5; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--color-slate-helper); font-size: 12px; margin: 26px 0 18px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--color-ash-divider); }
.gosuslugi-logo { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--color-sky-wash); color: var(--color-portrait-ink); font-weight: 600; }
.gosuslugi-logo.big { width: 40px; height: 40px; font-size: 18px; }
.demo-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.demo-role {
  display: flex; align-items: center; gap: 13px; text-align: left; width: 100%;
  background: var(--color-white-canvas); border-radius: var(--radius-cards); box-shadow: var(--ring-soft);
  padding: 13px 15px;
  transition: transform var(--dur-glide) var(--ease-soft), box-shadow var(--dur-glide) var(--ease-soft);
}
.demo-role:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.demo-role .d-avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; background: var(--color-sky-wash); flex: none; }
.demo-role .d-name { font-weight: 600; font-size: 15px; }
.demo-role .d-desc { font-size: 12px; color: var(--color-slate-helper); }
.demo-role .d-meta { margin-left: auto; }

/* ============================================================
   ПРИЛОЖЕНИЕ
   ============================================================ */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 260px; flex: none; background: var(--color-white-canvas); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px; border-right: 1px solid var(--color-ash-divider); }
.sidebar .brand { padding: 6px 8px 22px; }
.sidebar .brand-word { font-size: 16px; }
.brand-name { font-family: var(--font-basier); font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--color-slate-helper); }
.nav-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--color-slate-helper); padding: 20px 14px 8px; }
.nav-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 10px 14px; border-radius: var(--radius-buttons); color: var(--color-portrait-ink); font-size: 14px; font-weight: 500; margin: 1px 0; transition: background var(--dur-glide) var(--ease-soft), color var(--dur-glide) var(--ease-soft); }
.nav-item:hover { background: var(--color-sky-wash); }
.nav-item.active { background: var(--color-portrait-ink); color: var(--color-white-canvas); }
.nav-item .ico { width: 20px; text-align: center; }
.nav-badge { margin-left: auto; font-size: 11px; background: var(--gradient-rainbow); color: #fff; padding: 2px 9px; border-radius: var(--radius-tags); }
.sidebar-foot { margin-top: auto; padding: 18px 10px; border-top: 1px solid var(--color-ash-divider); font-size: 11px; color: var(--color-slate-helper); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 16px 32px; background: var(--color-white-canvas); position: sticky; top: 0; z-index: 40; border-bottom: 1px solid var(--color-ash-divider); }
.topbar > .topbar-heading { flex: 1; min-width: 0; }
.topbar .page-title { font-family: var(--font-basier); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .page-sub { font-size: 12px; color: var(--color-slate-helper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-right { margin-left: auto; flex: none; display: flex; align-items: center; gap: 14px; }
.stars-pill { display: inline-flex; align-items: center; gap: 7px; background: var(--color-peach-wash); color: var(--color-portrait-ink); padding: 8px 15px; border-radius: var(--radius-tags); font-size: 13px; font-weight: 600; }
.user-pill { display: flex; align-items: center; gap: 10px; }
.user-pill .u-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--color-portrait-ink); color: var(--color-white-canvas); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.user-pill .u-name { font-weight: 600; font-size: 14px; line-height: 1.1; }
.user-pill .u-role { font-size: 11px; color: var(--color-slate-helper); }
.tb-logout-ico { display: none; font-size: 17px; }

.content { padding: 40px 32px 80px; max-width: 1120px; width: 100%; margin: 0 auto; }
.content.view-anim { animation: viewIn var(--dur-glide) var(--ease-soft); }

/* ---------------- Заголовки вью ---------------- */
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 32px; flex-wrap: wrap; }
.view-title { font-size: clamp(32px, 4.5vw, 44px); font-weight: 600; line-height: 1.04; letter-spacing: -0.04em; }
.view-sub { color: var(--color-slate-helper); margin-top: 10px; font-size: 14px; }
.view-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------- Карточки ---------------- */
.card { background: var(--color-white-canvas); border-radius: var(--radius-cards); box-shadow: var(--shadow-soft); }
.card-pad { padding: 24px; }
.card-title { font-size: 24px; font-weight: 600; line-height: 1.08; }
.card-sub { font-size: 12px; color: var(--color-slate-helper); margin-top: 6px; }
.grid { display: grid; gap: 16px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: 1fr; } }

/* Stat cards */
.stat-card { background: var(--color-white-canvas); color: var(--color-portrait-ink); border-radius: var(--radius-cards); box-shadow: var(--shadow-soft); padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.stat-card.ember { background: var(--color-portrait-ink); color: var(--color-white-canvas); }
.stat-card .stat-ico { display: none; }
.stat-card > div:last-child { display: flex; flex-direction: column; gap: 8px; }
.stat-card .stat-label { order: -1; font-size: 12px; color: var(--color-slate-helper); }
.stat-card.ember .stat-label { color: rgba(255, 255, 255, .7); }
.stat-card .stat-num { font-family: var(--font-basier); font-size: clamp(30px, 3vw, 42px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; overflow-wrap: anywhere; }

/* ---------------- Списки ---------------- */
.list { display: flex; flex-direction: column; gap: 14px; }
.list-item { background: var(--color-white-canvas); border-radius: var(--radius-cards); box-shadow: var(--shadow-soft); padding: 20px 22px; transition: transform var(--dur-glide) var(--ease-soft), box-shadow var(--dur-glide) var(--ease-soft); }
.list-item:hover { transform: translateY(-2px); }
.li-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.li-title { font-size: 20px; font-weight: 600; line-height: 1.1; }
.li-body { margin-top: 10px; color: var(--color-graphite-body); font-size: 14px; }
.li-foot { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.li-foot .spacer { margin-left: auto; }
.money { font-size: 19px; font-weight: 600; color: var(--color-portrait-ink); line-height: 1; }

/* ---------------- Таблицы ---------------- */
.table-wrap { overflow-x: auto; background: var(--color-white-canvas); border-radius: var(--radius-cards); box-shadow: var(--shadow-soft); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--color-slate-helper); font-weight: 600; padding: 13px 16px; border-bottom: 1px solid var(--color-ash-divider); }
td { padding: 13px 16px; border-bottom: 1px solid var(--color-mist-hairline); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .3s ease; }
tbody tr:hover { background: var(--color-sky-wash); }
.t-strong { font-weight: 600; }
.t-sub { font-size: 12px; color: var(--color-slate-helper); }

/* ---------------- Рейтинг ---------------- */
.rating { color: var(--color-portrait-ink); font-size: 15px; letter-spacing: 1px; }
.rating .off { color: var(--color-ash-divider); }

/* ---------------- Формы ---------------- */
.field { margin-bottom: 16px; }
.label { display: block; font-size: 12px; color: var(--color-graphite-body); margin-bottom: 7px; font-weight: 500; }
.input, .select, .textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--color-ash-divider); border-radius: var(--radius-inputs);
  background: var(--color-white-canvas); color: var(--color-portrait-ink); outline: none;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--color-portrait-ink); box-shadow: 0 0 0 3px var(--color-sky-wash); }
.textarea { min-height: 96px; resize: vertical; }

/* ---------------- Статусная полоса ---------------- */
.status-strip { display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: var(--color-portrait-ink); color: var(--color-white-canvas); border-radius: var(--radius-cards); font-size: 13px; margin: 14px 0; }
.status-strip.ok { background: var(--color-portrait-ink); color: var(--color-white-canvas); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.red { background: #fff; animation: pulse 1.6s ease-in-out infinite; }
.dot.green { background: #fff; animation: pulse 1.6s ease-in-out infinite; }

/* ---------------- Модалки ---------------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(8, 48, 76, .35); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .3s ease; }
.modal { position: relative; width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; background: var(--color-white-canvas); border-radius: var(--radius-cards); box-shadow: var(--shadow-soft); padding: 32px; animation: pop var(--dur-glide) var(--ease-soft); }
.modal-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--color-ash-divider); background: var(--color-white-canvas); color: var(--color-portrait-ink); font-size: 13px; transition: transform var(--dur-glide) var(--ease-soft); }
.modal-close:hover { transform: rotate(90deg); }
.modal-title { font-size: 28px; font-weight: 600; line-height: 1.08; margin: 10px 0; }
.modal-text { color: var(--color-graphite-body); font-size: 14px; margin: 8px 0; }
.modal-text.small { font-size: 12px; }
.modal-ico { font-size: 32px; margin-bottom: 8px; }
.modal-ico.danger { color: var(--color-portrait-ink); }
.modal-ico.success { color: var(--color-portrait-ink); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }

/* ЕСИА */
.esia-card { max-width: 460px; }
.esia-header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.esia-title { font-family: var(--font-basier); font-size: 26px; font-weight: 600; }
.esia-sub { font-size: 12px; color: var(--color-slate-helper); }
.esia-logo-strip { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 13px; background: var(--color-sky-wash); border-radius: var(--radius-cards); margin-bottom: 20px; font-size: 13px; color: var(--color-portrait-ink); }
.spinner { display: inline-block; width: 22px; height: 22px; border: 2px solid var(--color-ash-divider); border-top-color: var(--color-portrait-ink); border-radius: 50%; animation: spin .7s linear infinite; }
.esia-step-title { font-weight: 600; font-size: 16px; margin-bottom: 8px; }

/* ---------------- Тост ---------------- */
#toasts { position: fixed; bottom: 22px; right: 22px; z-index: 400; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--color-portrait-ink); color: var(--color-white-canvas); padding: 14px 20px; border-radius: var(--radius-cards); font-size: 13px; box-shadow: var(--shadow-soft); animation: toastIn var(--dur-glide) var(--ease-soft); max-width: 380px; }
.toast.success { background: var(--color-portrait-ink); color: #fff; }
.toast.warn { background: var(--color-graphite-body); color: #fff; }
.toast.error { background: var(--color-portrait-ink); color: #fff; }

/* ---------------- Аналитика ---------------- */
.bars { display: flex; align-items: flex-end; gap: 12px; height: 190px; padding: 10px 4px 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 48px; background: var(--color-portrait-ink); border-radius: 8px 8px 0 0; min-height: 4px; transition: height var(--dur-glide) var(--ease-soft); }
.bar-label { font-size: 11px; color: var(--color-slate-helper); text-align: center; }
.bar-val { font-size: 16px; font-weight: 600; color: var(--color-portrait-ink); }
.donut-wrap { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.donut { border-radius: 50%; position: relative; }
.donut::after { content: ""; position: absolute; inset: 26%; background: var(--color-white-canvas); border-radius: 50%; }
.legend { display: flex; flex-direction: column; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.legend-swatch { width: 12px; height: 12px; border-radius: 4px; flex: none; }

/* ---------------- Прогресс ---------------- */
.progress { height: 8px; border-radius: 9999px; background: var(--color-mist-hairline); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 9999px; background: var(--gradient-rainbow); transition: width var(--dur-glide) var(--ease-soft); }

/* ---------------- Смарт-контракт / отзыв ---------------- */
.rev-star { background: none; border: none; cursor: pointer; line-height: 1; transition: transform var(--dur-glide) var(--ease-soft); }
.rev-star:hover { transform: scale(1.2); }
.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: var(--radius-tags); font-size: 12px; border: 1px solid var(--color-ash-divider); color: var(--color-slate-helper); }
.step.done { background: var(--color-portrait-ink); color: var(--color-white-canvas); border-color: var(--color-portrait-ink); }
.step.now { background: var(--color-peach-wash); color: var(--color-portrait-ink); border-color: var(--color-peach-wash); animation: pulse 1.6s ease-in-out infinite; }

/* ---------------- Портфолио (раскрывающиеся блоки) ---------------- */
.pf-item { padding: 0; overflow: hidden; }
.pf-head {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 18px 20px; text-align: left; background: transparent;
  color: var(--color-portrait-ink);
  transition: background var(--dur-glide) var(--ease-soft);
}
.pf-head:hover { background: var(--color-sky-wash); }
.pf-dot { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex: none; }
.pf-head-text { flex: 1; min-width: 0; }
.pf-head-text .li-title { font-size: 19px; }
.pf-chev { transition: transform var(--dur-glide) var(--ease-soft); color: var(--color-slate-helper); font-size: 16px; }
.pf-body { padding: 0 20px 20px; }
.pf-body:not(.hidden) { animation: viewIn var(--dur-glide) var(--ease-soft); }
.pf-media { width: 100%; border-radius: 16px; max-height: 320px; object-fit: cover; display: block; }
.pf-placeholder { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; padding: 36px 20px; font-size: 38px; color: var(--color-portrait-ink); }
.pf-placeholder div { font-size: 13px; }
audio.pf-media { max-height: none; height: 48px; }

/* ---------------- Блокчейн-лог ---------------- */
.chain-log { font-family: var(--font-system-ui); font-size: 12px; background: var(--color-portrait-ink); color: #d6e2ea; padding: 26px; overflow-x: auto; line-height: 1.8; border-radius: var(--radius-cards); }
.chain-log .k { color: #7fd0ff; }
.chain-log .v { color: #ffffff; }
.chain-log .h { color: #8df0b0; }

/* ---------------- Утилиты ---------------- */
.muted { color: var(--color-slate-helper); }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }
.flex { display: flex; } .between { justify-content: space-between; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .items-center { align-items: center; }
.empty { text-align: center; padding: 60px 20px; color: var(--color-slate-helper); }
.empty .e-ico { font-size: 44px; margin-bottom: 14px; color: var(--color-portrait-ink); }
.score-ring { width: 96px; height: 96px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 600; font-size: 34px; color: #fff; line-height: .9; }

/* ---------------- Анимации ---------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity var(--dur-slow) var(--ease-soft) var(--d, 0ms), transform var(--dur-slow) var(--ease-soft) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes heroRise { from { opacity: 0; transform: translateY(46px); } to { opacity: 1; transform: none; } }
@keyframes polaroidFloat { 0%, 100% { transform: rotate(var(--rot, 0deg)) translateY(0); } 50% { transform: rotate(var(--rot, 0deg)) translateY(-12px); } }
@keyframes rainbowPan { to { background-position: 200% 0; } }
@keyframes rainbowBorder { to { background-position: 200% 0; } }

.hero-eyebrow, .hero-display, .hero-sub, .hero-search, .hero-login { animation: heroRise var(--dur-slow) var(--ease-soft) both; }
.hero-eyebrow { animation-delay: .05s; }
.hero-display { animation-delay: .14s; }
.hero-sub { animation-delay: .28s; }
.hero-search { animation-delay: .42s; }
.hero-login { animation-delay: .56s; }
.polaroid.p1 { --rot: -5deg; }
.polaroid.p2 { --rot: 4deg; }
.polaroid.p3 { --rot: -3deg; }
.polaroid.p4 { --rot: 6deg; }

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
   ============================================================ */
.burger {
  display: none; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  border: 1px solid var(--color-ash-divider); background: var(--color-white-canvas);
  color: var(--color-portrait-ink); font-size: 18px;
}
.sidebar-backdrop {
  position: fixed; inset: 0; z-index: 290;
  background: rgba(8, 48, 76, .4); backdrop-filter: blur(2px);
  animation: fade .25s ease;
}

/* --- Планшет / узкие экраны --- */
@media (max-width: 900px) {
  .burger { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 300;
    width: 280px; height: 100vh;
    transform: translateX(-100%);
    transition: transform .32s var(--ease-soft);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .25);
    border-right: none;
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 28px 20px 64px; }
}

/* --- Телефон --- */
@media (max-width: 640px) {
  body { font-size: 15px; }

  /* Навигация */
  .top-nav { top: 8px; padding: 0 12px; }
  .nav-pill { height: 50px; padding: 7px 10px; gap: 8px; }
  .brand-word { font-size: 15px; }
  .announce-pill { display: none; }
  .nav-links { display: none; }

  /* Hero */
  .hero { padding: 72px 16px 36px; }
  .hero-display { letter-spacing: -0.04em; }
  .hero-sub { font-size: 16px; }
  .hero-search { max-width: 100%; padding: 5px 5px 5px 16px; }
  .hero-search .hs-prefix { font-size: 14px; }
  .hero-search .hs-input { font-size: 15px; padding: 9px 6px; }

  /* Метрики */
  .stats-band { margin-top: 24px; padding: 0 16px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-feature { padding: 18px 14px; }
  .stat-feature .sf-num { font-size: 28px; }

  /* Секции */
  .landing-section { padding: 56px 16px 0; }
  .section-head { margin-bottom: 32px; }
  .section-title { font-size: 32px; }
  .section-sub { font-size: 14px; }
  .cards-grid { grid-template-columns: 1fr; }
  .lcard { padding: 20px; }

  /* Виньетки / KPI */
  .vignette { padding: 22px 16px; }
  .vignette-circle { width: 100px; height: 100px; font-size: 32px; }
  .kpi { padding: 20px 16px; }
  .kpi-num { font-size: 32px; }

  /* Подвал */
  .landing-footer { padding: 32px 16px 44px; }

  /* Вход */
  .login-screen { padding: 16px; }
  .login-card { padding: 26px 18px; }
  .login-title { font-size: 32px; }
  /* Кнопка «Госуслуги» — чтобы иконка и текст сидели ровно */
  .btn-gosuslugi { font-size: 14px; padding: 12px 12px; gap: 10px; }

  /* Демо-роли: бейдж переносится под текст, ничего не обрезается */
  .demo-role { flex-wrap: wrap; }
  .demo-role > div:not(.d-avatar):not(.d-meta) { flex: 1; min-width: 0; }
  .demo-role .d-name { overflow-wrap: anywhere; }
  .demo-role .d-meta { margin-left: 53px; margin-top: 2px; flex-basis: 100%; }
  .demo-role .badge { white-space: normal; }

  /* Приложение */
  .topbar { padding: 10px 14px; gap: 10px; }
  .topbar .page-title { font-size: 19px; }
  .topbar .page-sub { display: none; }
  .tb-right { gap: 8px; }
  .user-pill .u-name, .user-pill .u-role { display: none; }
  .user-pill .u-avatar { width: 30px; height: 30px; font-size: 12px; }
  .stars-pill { padding: 6px 10px; font-size: 12px; }
  .tb-logout-txt { display: none; }
  .tb-logout-ico { display: inline; }
  .tb-logout { padding: 7px 10px; }
  .content { padding: 20px 14px 56px; }
  .view-head { flex-direction: column; gap: 12px; }
  .view-title { font-size: 30px; }
  .view-actions { width: 100%; }
  .view-actions .input, .view-actions .select { width: 100%; }

  /* Сетки — одна колонка */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Аналитика — диаграмма и график регионов */
  .donut-wrap { gap: 20px; justify-content: center; }
  .bars { gap: 6px; height: 170px; }
  .bar-col { min-width: 0; gap: 6px; }
  .bar-val { font-size: 14px; }
  .bar-label { font-size: 10px; line-height: 1.15; overflow-wrap: anywhere; }

  /* Карточки и списки */
  .card-pad { padding: 20px; }
  .list-item { padding: 16px; }
  .li-title { font-size: 18px; }
  .money { font-size: 17px; }
  .li-foot { gap: 8px; }
  .table-wrap { border-radius: 16px; }

  /* Модалки */
  .modal { padding: 24px 18px; border-radius: 20px; }
  .modal-title { font-size: 24px; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn { width: 100%; }

  /* Тосты */
  #toasts { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
}

/* --- Очень узкие --- */
@media (max-width: 400px) {
  .hero-display { font-size: 40px; }
  .stat-feature .sf-num { font-size: 24px; }
}
