/* ===================== GrantHub app — dark luxury, monochrome (matches the landing) ===================== */
:root {
  --ink: #050505; --bg: #050505; --fg: #ffffff;
  --card: rgba(255, 255, 255, 0.05); --card-solid: #0d0d0f; --card-fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.07); --muted-fg: rgba(255, 255, 255, 0.68); --faint: rgba(255, 255, 255, 0.42);
  --border: rgba(255, 255, 255, 0.10); --border-strong: rgba(255, 255, 255, 0.22);
  --online: #3ddc84; --accent: #f5b301; --brand: #3ddc84; --danger: #ef4444;
  --btn-bg: #ffffff; --btn-fg: #050505;
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, .9); --shadow-lg: 0 40px 120px -40px rgba(0, 0, 0, .95);
  --radius: 20px; --radius-lg: 28px; --pill: 999px;
  --ease: cubic-bezier(.16, 1, .3, 1); --dur: 400ms;
  /* три длительности на весь сайт: наведение / смена состояния / появление экрана */
  --fast: 150ms; --base: 250ms; --slow: 400ms;
  /* Пружины (как в Motion: visualDuration / bounce), сэмплированы в linear(). Длительность включает досадку,
     визуально движение занимает ~0.3–0.35 с. pop — отклик переключателей (звёздочка, сравнение, галочка),
     spring — перемещения без заметного перелёта (подсветка пункта меню, панель окна) */
  --spring-pop-dur: .8s;
  --spring-pop: linear(0, 0.058, 0.193, 0.366, 0.548, 0.717, 0.86, 0.971, 1.049, 1.097, 1.119, 1.123, 1.112, 1.094, 1.072, 1.05, 1.03, 1.013, 1.001, 0.992, 0.987, 0.985, 0.985, 0.987, 0.989, 0.992, 0.994, 0.997, 0.999, 1, 1.001, 1.002, 1.002, 1.002, 1.002, 1.001, 1.001, 1.001, 1, 1, 1);
  --spring-dur: .64s;
  --spring: linear(0, 0.03, 0.091, 0.181, 0.27, 0.372, 0.461, 0.553, 0.628, 0.701, 0.758, 0.812, 0.852, 0.889, 0.916, 0.94, 0.957, 0.972, 0.982, 0.99, 0.996, 1, 1.002, 1.004, 1.005, 1.005, 1.005, 1.005, 1.004, 1.004, 1.004, 1.003, 1.003, 1.002, 1.002, 1.001, 1.001, 1.001, 1.001, 1.001, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 400; font-size: 15px; line-height: 1.55;
  background: var(--bg); color: var(--fg); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; }
input, textarea { font: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.muted { color: var(--muted-fg); }
.small { font-size: .85rem; }
.center { text-align: center; }
.grad { color: #fff; }
h1, h2, h3 { font-weight: 400; letter-spacing: -0.03em; }

/* ===================== Background: vignette + soft glow ===================== */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 30%, transparent 40%, rgba(0,0,0,.6) 100%); }
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .10; background: #fff; }
.o1 { width: 520px; height: 520px; top: -200px; left: -160px; }
.o2 { width: 620px; height: 320px; bottom: -160px; left: 50%; transform: translateX(-50%); opacity: .08; animation-delay: -8s; }
.o3 { display: none; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -20px) scale(1.05); } }

/* ===================== Topbar (same as landing navbar) ===================== */
.topbar {
  position: sticky; top: 0; z-index: 50; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  max-width: 1200px; margin: 0 auto; padding: 22px clamp(16px, 4vw, 40px) 14px;
  background: linear-gradient(180deg, rgba(5,5,5,.95), rgba(5,5,5,.6) 70%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; justify-self: start; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff 0, #cfcfd4 30%, #6b6b72 100%); box-shadow: 0 6px 16px -6px rgba(255,255,255,.4); transition: transform var(--base) var(--ease); }
.brand-mark svg { width: 14px; height: 14px; stroke-width: 2.2; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-weight: 500; font-size: 13px; letter-spacing: -0.01em; }
.brand-text i { font-style: normal; font-weight: 300; font-size: 11px; color: var(--muted-fg); }
.nav { position: relative; display: flex; gap: 6px; }
.nav a { position: relative; z-index: 1; padding: 8px 10px; border-radius: 10px; font-size: 13px; font-weight: 400; white-space: nowrap; color: rgba(255,255,255,.5); transition: color var(--base) var(--ease); }
.nav a:hover, .nav a.active { color: #fff; }
.nav-ink { position: absolute; top: 0; left: 0; height: 100%; width: 0; border-radius: 10px; background: rgba(255,255,255,.06); transition: left var(--spring-dur) var(--spring), width var(--spring-dur) var(--spring); z-index: 0; }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: var(--pill); font-size: .7rem; font-weight: 500; color: var(--ink); background: #fff; animation: pop .35s var(--ease); }
.topbar-actions { display: flex; align-items: center; gap: 10px; justify-self: end; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: var(--pill); font-size: 12px; white-space: nowrap; transition: transform var(--base) var(--ease), box-shadow var(--base) var(--ease); }
.pill--dark { background: rgba(255,255,255,.06); border: 1px solid var(--border); color: rgba(255,255,255,.85); }
.pill--white { background: #fff; color: var(--ink); font-weight: 500; }
.pill--white:hover { transform: translateY(-1px) scale(1.03); box-shadow: 0 10px 30px -10px rgba(255,255,255,.5); }
/* Пульс точки «онлайн»: расходящееся кольцо — псевдоэлемент на transform/opacity (композитор), а не box-shadow,
   который перерисовывал точку каждый кадр бесконечно */
.dot-online, .pulse-dot, .scan-live i { position: relative; }
.dot-online::after, .pulse-dot::after, .scan-live i::after { content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: inherit; opacity: .6; animation: ping 2s cubic-bezier(0, 0, .2, 1) infinite; pointer-events: none; }
.scan-live i::after { animation-duration: 1.6s; }
.dot-online { width: 7px; height: 7px; border-radius: 50%; background: var(--online); }
@keyframes ping { 70%, 100% { transform: scale(2.3); opacity: 0; } }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-strong); background: rgba(255,255,255,.08); color: #fff; display: grid; place-items: center; transition: transform var(--fast) var(--ease), background var(--fast); }
.icon-btn:hover { transform: translateY(-2px); background: rgba(255,255,255,.14); }
.menu-btn { display: none; }

/* ===================== Language switch ===================== */
.lang { display: inline-flex; height: 36px; padding: 3px; border-radius: var(--pill); border: 1px solid var(--border); background: rgba(255,255,255,.06); }
.lang button { height: 28px; padding: 0 10px; border-radius: var(--pill); border: 0; background: transparent; color: var(--muted-fg); font-size: 12px; transition: color var(--fast), background var(--fast); }
.lang button:hover { color: #fff; }
.lang button.is-on { background: #fff; color: var(--ink); font-weight: 500; }

/* ===================== Auth: user chip & modal ===================== */
.user-chip { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 6px 0 4px; border-radius: var(--pill); border: 1px solid var(--border); background: rgba(255,255,255,.06); }
.user-avatar, .user-initial { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-initial { display: grid; place-items: center; background: #fff; color: var(--ink); font-size: 12px; font-weight: 500; }
.user-name { font-size: 12px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-logout { width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--muted-fg); display: grid; place-items: center; transition: color var(--fast), background var(--fast); }
.user-logout:hover { color: #fff; background: rgba(255,255,255,.1); }
.user-logout svg { width: 16px; height: 16px; }
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.6); backdrop-filter: blur(10px); animation: fadeIn var(--base) ease both; }
@keyframes fadeIn { from { opacity: 0; } }
/* Уход окна и палитры: фон гаснет, панель опускается — короче входа, ничего не ждёт (класс ставит hideAnimated в app.js) */
.modal.closing, .palette.closing { animation: fadeOut var(--fast) ease forwards; pointer-events: none; }
.modal.closing .modal__panel, .palette.closing .palette__panel { animation: sinkOut var(--fast) ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes sinkOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal__panel { position: relative; width: min(440px, 100%); padding: 36px 32px 28px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(255,255,255,.10), rgba(255,255,255,.03) 60%, rgba(120,95,70,.14)), var(--ink); backdrop-filter: blur(30px);
  box-shadow: var(--shadow-lg); animation: riseIn var(--spring-dur) var(--spring) both; }
.modal__close { position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-strong); background: rgba(255,255,255,.08); display: grid; place-items: center; transition: transform var(--base) var(--ease); }
.modal__close:hover { transform: rotate(90deg); }
.modal__close span { position: absolute; width: 14px; height: 1.5px; background: #fff; border-radius: 2px; }
.modal__close span:first-child { transform: rotate(45deg); } .modal__close span:last-child { transform: rotate(-45deg); }
.modal__title { margin: 0 0 6px; font-size: 2rem; letter-spacing: -.03em; }
.modal .form { margin-top: 18px; max-width: none; }
.modal .form-actions .btn { width: 100%; }
.oauth { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.oauth-btn { width: 100%; justify-content: center; }
.oauth-ico { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 4px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-switch { margin: 16px 0 0; text-align: center; }
.linklike { border: 0; background: none; color: #fff; text-decoration: underline; padding: 0; font-size: inherit; }

/* ===================== Layout ===================== */
main { max-width: 1280px; margin: 0 auto; padding: 8px clamp(12px, 2.5vw, 24px) 60px; }
/* Каждая вкладка — «hero-экран», как на лендинге: рамка 28px, виньетка, мягкое свечение снизу */
.view { position: relative; min-height: calc(100vh - 150px); padding: clamp(24px, 4vw, 56px) clamp(20px, 4vw, 60px) clamp(40px, 5vw, 70px);
  border-radius: 28px; border: 1px solid rgba(255,255,255,.08); background: var(--ink); overflow: hidden;
  box-shadow: 0 40px 120px -40px rgba(0,0,0,.9), 0 0 0 1px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  animation: viewIn var(--slow) var(--ease) both; }
.view::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(0,0,0,.55) 100%), linear-gradient(180deg, rgba(255,255,255,.025), transparent 30%); }
.view::after { content: ""; position: absolute; left: 50%; bottom: -10%; width: 70%; height: 36%; transform: translateX(-50%); pointer-events: none; z-index: 0;
  background: radial-gradient(50% 50% at 50% 50%, rgba(255,255,255,.14), rgba(255,255,255,.04) 45%, transparent 70%); filter: blur(30px); }
.view > * { position: relative; z-index: 1; }
.view-art { position: absolute; right: -8%; top: -6%; width: min(58%, 760px); z-index: 0; pointer-events: none; opacity: .95;
  filter: drop-shadow(0 40px 60px rgba(0,0,0,.7)); -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%); mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  animation: artIn var(--slow) ease-out both; }
@keyframes artIn { from { opacity: 0; } to { opacity: .95; } }
.view-art--low { opacity: .35; width: min(46%, 600px); right: -6%; top: 0; }
@keyframes artInLow { from { opacity: 0; } to { opacity: .35; } }
.view-art--low { animation-name: artInLow; }
.view.leaving { animation: viewOut var(--fast) ease both; }
/* View Transitions между разделами: старый экран уходит вверх и гаснет, новый въезжает снизу.
   Шапка — отдельный слой без анимации, чтобы меню и «чернильная» подсветка пункта не двоились при наплыве. */
.view:not([hidden]) { view-transition-name: gh-view; }
.topbar { view-transition-name: gh-topbar; }
::view-transition-old(gh-topbar) { display: none; }
::view-transition-new(gh-topbar) { animation: none; }
/* Высота разделов разная: рамку не растягиваем, снимки прижаты к верху и не искажаются */
::view-transition-group(gh-view) { animation: none; }
::view-transition-old(gh-view), ::view-transition-new(gh-view) { height: auto; width: 100%; object-fit: none; object-position: top; }
::view-transition-old(gh-view) { animation: viewOut var(--fast) ease both; }
::view-transition-new(gh-view) { animation: viewIn var(--slow) var(--ease) both; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes viewOut { to { opacity: 0; transform: translateY(-6px); } }
.section-head { margin: 18px 0 28px; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin: 0 0 6px; line-height: 1.05; }
.section-head p { margin: 0; font-weight: 300; }
.footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 1200px; margin: 0 auto; padding: 20px clamp(16px, 4vw, 40px) 40px; font-size: 12px; color: var(--muted-fg); letter-spacing: .15em; }

/* ===================== Buttons ===================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: var(--pill); border: 1px solid transparent; font-weight: 500; font-size: 13px; position: relative; overflow: hidden;
  transition: transform var(--base) var(--ease), box-shadow var(--base) var(--ease), background var(--base), opacity var(--fast); }
.btn:active { transform: scale(.97); }
.btn-primary { color: var(--ink); background: #fff; }
.btn-primary:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 40px rgba(255,255,255,.22), 0 16px 40px -16px rgba(255,255,255,.6); }
.btn-ghost { background: rgba(255,255,255,.06); border-color: var(--border); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); transform: translateY(-2px); }
.btn-danger { background: rgba(239,68,68,.15); border-color: rgba(239,68,68,.4); color: #fca5a5; }
.btn-lg { padding: 0 32px; height: 64px; font-size: 14px; }
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ===================== Home (hero) ===================== */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 40px 0 30px; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.05; margin: 16px 0; }
.lead { font-size: 1.05rem; font-weight: 300; color: var(--muted-fg); max-width: 560px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: var(--pill); background: rgba(255,255,255,.06); border: 1px solid var(--border); font-size: 12px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--online); }
.hero-card { perspective: 1000px; }
.hero-card-inner { background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.04) 60%, rgba(120,95,70,.14)); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px;
  backdrop-filter: blur(24px); box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.08); transition: transform var(--base) var(--ease); transform-style: preserve-3d; }
.hc-row { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--border); }
.hc-row:last-of-type { border-bottom: 0; }
.hc-label { color: var(--muted-fg); font-size: .9rem; font-weight: 300; }
.count { font-size: 1.7rem; font-weight: 400; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.count.green { color: var(--online); }
.hc-foot { margin-top: 10px; font-size: .78rem; color: var(--faint); }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 36px; }
.feature { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: transform var(--base) var(--ease), border-color var(--base), background var(--base); }
.feature:hover { transform: translateY(-6px); border-color: var(--border-strong); background: rgba(255,255,255,.08); }
.feature h3 { margin: 14px 0 6px; font-size: 1rem; font-weight: 500; letter-spacing: -.01em; }
.feature p { margin: 0; color: var(--muted-fg); font-size: .88rem; font-weight: 300; }
.f-icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.08); border: 1px solid var(--border); }
.f-icon svg { width: 20px; height: 20px; }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===================== View headers (cinematic, like the landing) ===================== */
.vhead { padding: 34px 0 34px; max-width: 860px; }
.vhead--row { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; max-width: none; }
.vhead--row .vlead { margin: 0 0 6px; text-align: right; }
.eyebrow { margin: 0 0 14px; font-size: 12px; font-weight: 300; color: var(--muted-fg); letter-spacing: .02em; }
.vtitle { margin: 0; font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 500; }
.vlead { margin: 18px 0 0; font-size: 1rem; font-weight: 300; color: var(--muted-fg); max-width: 560px; line-height: 1.6; }
@keyframes riseIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ===================== Catalog steps ===================== */
.step { display: none; }
.step.active { display: block; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.choice-grid.three { grid-template-columns: repeat(3, 1fr); }
.choice { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; min-height: 260px; padding: 30px 32px; border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.03) 60%, rgba(120,95,70,.14)); backdrop-filter: blur(20px); color: #fff; overflow: hidden;
  transition: transform var(--base) var(--ease), border-color var(--base), box-shadow var(--base); }
.choice-grid .choice:nth-child(2) { animation-delay: .1s; } .choice-grid .choice:nth-child(3) { animation-delay: .2s; }
.choice::after { content: ""; position: absolute; inset: auto -20% -60% auto; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 65%); filter: blur(20px); opacity: 0; transition: opacity var(--base) var(--ease); }
.choice:hover::after { opacity: 1; }
.choice-idx { font-size: 12px; letter-spacing: .15em; color: var(--faint); font-variant-numeric: tabular-nums; }
.choice b { margin-top: auto; font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 400; letter-spacing: -.03em; line-height: 1.05; }
.choice > span:nth-of-type(2) { color: var(--muted-fg); font-size: .9rem; font-weight: 300; max-width: 320px; }
.choice-arrow { position: absolute; top: 24px; right: 24px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; background: rgba(255,255,255,.06); transition: transform var(--base) var(--ease), background var(--base), color var(--base); }
.choice-arrow svg { width: 18px; height: 18px; }
.choice:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.choice:hover .choice-arrow { background: #fff; color: var(--ink); transform: rotate(-45deg); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 26px; }
.quick button { height: 34px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--muted-fg); font-size: 12px;
  transition: color var(--base) var(--ease), border-color var(--base) var(--ease), background-color var(--base) var(--ease), transform var(--base) var(--ease); }
.quick button:hover { color: #fff; border-color: var(--border-strong); transform: translateY(-2px); }
.empty-mark { width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; color: rgba(255,255,255,.7); background: rgba(255,255,255,.04); }
.empty-mark svg { width: 28px; height: 28px; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: start; }
.split .card { margin-top: 40px; padding: 32px; border-radius: var(--radius-lg); }
.bullets { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: .92rem; font-weight: 300; color: var(--muted-fg); }
.bullets li { padding-left: 18px; position: relative; }
.bullets li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.bullets b { color: #fff; font-weight: 500; }
.back { margin-top: 18px; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs span { padding: 7px 13px; border-radius: var(--pill); background: rgba(255,255,255,.06); border: 1px solid var(--border); font-size: 12px; }
.load-more { display: flex; justify-content: center; margin-top: 28px; }

/* ===================== Grant cards ===================== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.gcard { position: relative; display: flex; flex-direction: column; gap: 10px; border-radius: var(--radius); padding: 22px; border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.03) 60%, rgba(120,95,70,.10)); backdrop-filter: blur(20px);
  opacity: 0; transform: translateY(20px) scale(.98); animation: cardIn var(--base) var(--ease) forwards; animation-delay: calc(var(--i, 0) * 30ms);
  transition: transform var(--base) var(--ease), border-color var(--base), box-shadow var(--base); }
.gcard:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow); }
@keyframes cardIn { to { opacity: 1; transform: none; } }
.gcard.removing { animation: cardOut var(--fast) ease forwards; }
@keyframes cardOut { to { opacity: 0; transform: scale(.96); } }
.g-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.g-title { font-weight: 500; font-size: 1.02rem; line-height: 1.3; letter-spacing: -.01em; margin: 0; }
.g-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 4px 10px; border-radius: var(--pill); background: rgba(255,255,255,.06); border: 1px solid var(--border); color: var(--muted-fg); }
.tag.open { color: var(--online); border-color: rgba(61,220,132,.35); }
.tag.upcoming { color: var(--accent); border-color: rgba(245,179,1,.35); }
.tag.abroad, .tag.kz { color: #fff; }
.tag.urgent { color: #fca5a5; border-color: rgba(239,68,68,.4); }
.g-row { display: flex; gap: 8px; font-size: .88rem; color: var(--muted-fg); font-weight: 300; }
.g-row svg { flex: none; width: 16px; height: 16px; margin-top: 3px; color: rgba(255,255,255,.7); }
.g-row b { color: #fff; font-weight: 500; }
.g-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.g-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 13px; color: #fff; }
.g-link svg { width: 15px; height: 15px; transition: transform var(--fast) var(--ease); }
.g-link:hover svg { transform: translateX(4px); }   /* стрелка уезжает сама — раньше анимировался gap и сдвигалась строка */
.fav { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: rgba(255,255,255,.05); color: var(--muted-fg); display: grid; place-items: center; transition: transform var(--base) var(--ease), color var(--base), background var(--base), border-color var(--base); }
.fav:hover { transform: scale(1.1); color: var(--accent); border-color: var(--border-strong); }
.fav.on { color: var(--accent); border-color: rgba(245,179,1,.45); background: rgba(245,179,1,.10); }
.fav.on svg { fill: currentColor; animation: pop var(--spring-pop-dur) var(--spring-pop); }
.cmp-check.on svg { animation: pop var(--spring-pop-dur) var(--spring-pop); }
/* перелёт и досадку даёт сама пружина (--spring-pop), ключевой кадр только один */
@keyframes pop { from { transform: scale(.55); } }
.skeleton { height: 210px; border-radius: var(--radius); }
/* Блик скелетона — полоса-псевдоэлемент на transform, а не background-position (тот перерисовывал каждый кадр) */
.sk { position: relative; overflow: hidden; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.empty { text-align: center; padding: 60px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; font-weight: 300; }
.empty-icon { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; color: var(--muted-fg); }
.empty-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* ===================== Search ===================== */
.search-box { position: relative; display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 20px; border-radius: var(--pill); background: rgba(255,255,255,.05); border: 1px solid var(--border); margin-bottom: 14px;
  transition: border-color var(--base), box-shadow var(--base), background var(--base); }
.search-box:focus-within { border-color: var(--border-strong); background: rgba(255,255,255,.08); box-shadow: 0 0 0 4px rgba(255,255,255,.06); }
.search-box svg { color: var(--muted-fg); }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; color: #fff; padding: 12px 0; font-size: 1rem; font-weight: 300; }
.search-box input::placeholder { color: var(--faint); }
.spinner { width: 18px; height: 18px; margin-right: 12px; border-radius: 50%; border: 2px solid var(--border); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== Chat ===================== */
.chat { display: flex; flex-direction: column; height: min(78vh, 760px); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)); backdrop-filter: blur(20px); box-shadow: var(--shadow-lg); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.chat-head b { font-weight: 500; }
.ai-avatar { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0, #cfcfd4 30%, #6b6b72 100%); display: grid; place-items: center; }
.ai-avatar span { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
@keyframes breathe { 50% { transform: scale(.7); opacity: .7; } }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.msg { display: flex; animation: msgIn var(--base) var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user { justify-content: flex-end; }
.bubble { max-width: 78%; padding: 12px 16px; border-radius: 18px; line-height: 1.5; font-weight: 300; }
.msg.ai .bubble { background: rgba(255,255,255,.06); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.msg.user .bubble { background: #fff; color: var(--ink); font-weight: 400; border-bottom-right-radius: 6px; }
.bubble p { margin: 0 0 8px; } .bubble p:last-child { margin: 0; }
.bubble ul, .bubble ol { margin: 6px 0; padding-left: 20px; }
.bubble strong { font-weight: 500; }
.bubble a { text-decoration: underline; }
.typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.6); animation: dots 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes dots { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-6px); opacity: 1; } }
.fb { display: flex; gap: 6px; margin-top: 10px; }
.fb button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--muted-fg); transition: transform var(--fast) var(--ease), color var(--fast), border-color var(--fast); }
.fb button:hover { transform: scale(1.12); color: #fff; border-color: var(--border-strong); }
.fb.done button { opacity: .4; pointer-events: none; }
.fb.done button.picked { opacity: 1; color: #fff; border-color: #fff; }
.suggestions { display: flex; gap: 8px; padding: 0 20px 12px; overflow-x: auto; scrollbar-width: none; }
.suggestions::-webkit-scrollbar { display: none; }
.suggestions button { flex: none; height: 34px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--muted-fg); font-size: 12px;
  transition: color var(--base) var(--ease), border-color var(--base) var(--ease), background-color var(--base) var(--ease), transform var(--base) var(--ease); }
.suggestions button:hover { color: #fff; border-color: var(--border-strong); transform: translateY(-2px); }
.chat-form { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); }
.chat-form textarea { flex: 1; resize: none; border: 1px solid var(--border); border-radius: 16px; padding: 12px 16px; background: rgba(255,255,255,.04); color: #fff; outline: 0; max-height: 140px; font-weight: 300; transition: border-color var(--fast), box-shadow var(--fast); }
.chat-form textarea::placeholder { color: var(--faint); }
.chat-form textarea:focus { border-color: var(--border-strong); box-shadow: 0 0 0 4px rgba(255,255,255,.06); }
.send { width: 48px; height: 48px; border-radius: 50%; border: 0; color: var(--ink); background: #fff; display: grid; place-items: center; transition: transform var(--base) var(--ease), box-shadow var(--base), opacity var(--fast); }
.send:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 0 30px rgba(255,255,255,.3); }
.send[disabled] { opacity: .5; pointer-events: none; }

/* ===================== Forms & cards ===================== */
.card { background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; backdrop-filter: blur(20px); }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 500; letter-spacing: -.01em; }
.form { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 400; font-size: 13px; }
.form input { padding: 13px 16px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.04); color: #fff; outline: 0; font-weight: 300; transition: border-color var(--fast), box-shadow var(--fast); }
.form input::placeholder { color: var(--faint); }
.form input:focus { border-color: var(--border-strong); box-shadow: 0 0 0 4px rgba(255,255,255,.06); }
.form-actions { display: flex; gap: 10px; }
.inline-form { display: flex; gap: 10px; }
.inline-form input { flex: 1; padding: 10px 14px; border-radius: var(--pill); border: 1px solid var(--border); background: rgba(255,255,255,.04); color: #fff; }

/* ===================== Admin ===================== */
.admin-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 16px; }
.admin-grid .wide { grid-column: 1 / -1; }
.scan-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.scan-status { font-size: .88rem; color: var(--muted-fg); font-weight: 300; }
.progress { height: 4px; border-radius: var(--pill); background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: 12px; }
.progress span { display: block; height: 100%; width: 40%; border-radius: var(--pill); background: #fff; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.stat { padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid var(--border); }
.stat b { display: block; font-size: 1.5rem; font-weight: 400; letter-spacing: -.02em; }
.stat span { font-size: .78rem; color: var(--muted-fg); font-weight: 300; }
.mon-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.mon-table td, .mon-table th { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--border); font-size: .85rem; font-weight: 300; }
.mon-table th { color: var(--muted-fg); font-weight: 400; font-size: .78rem; letter-spacing: .05em; }

/* ===================== Reminders & toasts ===================== */
.reminders { max-width: 1200px; margin: 6px auto 0; padding: 0 clamp(16px, 4vw, 40px); display: flex; flex-direction: column; gap: 8px; }
.rem { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 16px; background: rgba(245,179,1,.08); border: 1px solid rgba(245,179,1,.3); font-weight: 300; animation: viewIn .5s var(--ease) both; }
.rem b { color: var(--accent); font-weight: 500; }
.rem a { margin-left: auto; font-weight: 500; white-space: nowrap; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
.toast { padding: 12px 18px; border-radius: var(--pill); background: #fff; color: var(--ink); font-weight: 500; font-size: 13px; box-shadow: var(--shadow-lg); animation: toastIn .4s var(--ease) both; max-width: 340px; }
.toast.out { animation: toastOut .3s ease forwards; }
.toast.err { background: #ef4444; color: #fff; }
.toast.ok { background: var(--online); color: var(--ink); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ===================== Responsive ===================== */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; gap: 26px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  .nav { gap: 0; }
  .nav a { padding: 8px 9px; font-size: 12px; }
}
@media (max-width: 760px) {
  .topbar { display: flex; justify-content: space-between; padding: 14px 16px; }
  .menu-btn { display: grid; }
  .topbar-actions .pill { display: none; }
  .topbar-actions #loginBtn { display: inline-flex; }
  .lang button { padding: 0 7px; }
  .user-name { display: none; }
  .nav { position: fixed; top: 68px; left: 12px; right: 12px; flex-direction: column; padding: 8px; border-radius: 20px; background: rgba(10,10,10,.9); backdrop-filter: blur(20px); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
    transform: translateY(-10px); opacity: 0; pointer-events: none; transition: transform var(--base) var(--ease), opacity var(--base); }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { padding: 12px 14px; font-size: 14px; }
  .nav-ink { display: none; }
  .view { min-height: auto; border-radius: 22px; padding: 22px 18px 32px; }
  .view-art { width: 90%; right: -25%; top: 2%; opacity: .45; }
  .features, .choice-grid, .choice-grid.three, .split, .vhead--row { grid-template-columns: 1fr; }
  .vhead--row .vlead { text-align: left; }
  .choice { min-height: 200px; }
  .split .card { margin-top: 0; }
  .bubble { max-width: 90%; }
  .chat { height: calc(100vh - 150px); border-radius: 22px; }
  .grid { grid-template-columns: 1fr; }
  .footer { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal, .gcard { opacity: 1; transform: none; }
}


/* ===================== v3: brand logo ===================== */
.brand-mark { background: none; box-shadow: none; width: 32px; height: 32px; }
.brand-mark .logo { width: 32px; height: 32px; filter: drop-shadow(0 6px 16px rgba(255,255,255,.25)); }
.nav a.active::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 4px; height: 4px; border-radius: 50%; background: var(--brand); transform: translateX(-50%); }
.icon-btn .i-moon { display: none; }
:root[data-theme="light"] .icon-btn .i-sun { display: none; }
:root[data-theme="light"] .icon-btn .i-moon { display: block; }

/* ===================== v3: light theme ===================== */
:root[data-theme="light"] {
  --ink: #f5f5f3; --bg: #f5f5f3; --fg: #0a0a0a; --card: rgba(0,0,0,.035); --card-fg: #0a0a0a;
  --muted: rgba(0,0,0,.06); --muted-fg: rgba(0,0,0,.55); --faint: rgba(0,0,0,.35); --border: rgba(0,0,0,.10); --border-strong: rgba(0,0,0,.22);
  --shadow: 0 20px 50px -24px rgba(0,0,0,.25); --shadow-lg: 0 40px 120px -40px rgba(0,0,0,.3); --btn-bg: #0a0a0a; --btn-fg: #ffffff; color-scheme: only light; /* only — запрет авто-затемнения браузером */
}
:root[data-theme="light"] .bg-orbs { background: radial-gradient(120% 90% at 50% 30%, transparent 40%, rgba(0,0,0,.06) 100%); }
:root[data-theme="light"] .orb { background: #000; opacity: .04; }
:root[data-theme="light"] .topbar { background: linear-gradient(180deg, rgba(245,245,243,.95), rgba(245,245,243,.6) 70%, transparent); }
:root[data-theme="light"] .brand-mark .logo { filter: drop-shadow(0 6px 16px rgba(0,0,0,.2)); }
:root[data-theme="light"] .brand-mark .logo rect { fill: #0a0a0a; }
:root[data-theme="light"] .brand-mark .logo path { stroke: #fff; }
:root[data-theme="light"] .nav a { color: rgba(0,0,0,.5); } :root[data-theme="light"] .nav a:hover, :root[data-theme="light"] .nav a.active { color: #0a0a0a; }
:root[data-theme="light"] .nav-ink { background: rgba(0,0,0,.06); }
:root[data-theme="light"] .pill--dark { background: rgba(0,0,0,.05); color: rgba(0,0,0,.8); }
:root[data-theme="light"] .lang button.is-on, :root[data-theme="light"] .user-initial, :root[data-theme="light"] .badge, :root[data-theme="light"] .toast { background: #0a0a0a; color: #fff; }
:root[data-theme="light"] .icon-btn, :root[data-theme="light"] .lang, :root[data-theme="light"] .user-chip { background: rgba(0,0,0,.05); color: #0a0a0a; }
:root[data-theme="light"] .lang button { color: rgba(0,0,0,.5); } :root[data-theme="light"] .lang button:hover { color: #0a0a0a; }
:root[data-theme="light"] .view { background: #fff; border-color: rgba(0,0,0,.06); box-shadow: 0 30px 80px -40px rgba(0,0,0,.25); }
:root[data-theme="light"] .view::before { background: linear-gradient(180deg, rgba(0,0,0,.02), transparent 30%); }
:root[data-theme="light"] .view::after { background: radial-gradient(50% 50% at 50% 50%, rgba(0,0,0,.06), transparent 70%); }
:root[data-theme="light"] .view-art { opacity: .5; filter: drop-shadow(0 30px 40px rgba(0,0,0,.25)); }
:root[data-theme="light"] .choice, :root[data-theme="light"] .gcard, :root[data-theme="light"] .card, :root[data-theme="light"] .chat, :root[data-theme="light"] .modal__panel, :root[data-theme="light"] .palette__panel { background: #fff; color: #0a0a0a; }
:root[data-theme="light"] .choice-idx { color: rgba(0,0,0,.35); }
:root[data-theme="light"] .choice-arrow { background: rgba(0,0,0,.04); } :root[data-theme="light"] .choice:hover .choice-arrow { background: #0a0a0a; color: #fff; }
:root[data-theme="light"] .g-row svg { color: rgba(0,0,0,.6); } :root[data-theme="light"] .g-row b, :root[data-theme="light"] .g-link, :root[data-theme="light"] .bullets b { color: #0a0a0a; }
:root[data-theme="light"] .tag { background: rgba(0,0,0,.04); } :root[data-theme="light"] .tag.abroad, :root[data-theme="light"] .tag.kz { color: #0a0a0a; }
:root[data-theme="light"] .msg.ai .bubble, :root[data-theme="light"] .search-box, :root[data-theme="light"] .form input, :root[data-theme="light"] .chat-form textarea, :root[data-theme="light"] .stat, :root[data-theme="light"] .crumbs span, :root[data-theme="light"] .quick button, :root[data-theme="light"] .suggestions button { background: rgba(0,0,0,.04); color: #0a0a0a; }
:root[data-theme="light"] .msg.user .bubble { background: #0a0a0a; color: #fff; }
:root[data-theme="light"] .search-box input, :root[data-theme="light"] .form input, :root[data-theme="light"] .chat-form textarea { color: #0a0a0a; }
:root[data-theme="light"] .ai-avatar { background: #0a0a0a; } :root[data-theme="light"] .ai-avatar span { background: #fff; }
:root[data-theme="light"] .typing i { background: rgba(0,0,0,.5); }
:root[data-theme="light"] .fav { background: rgba(0,0,0,.04); }
:root[data-theme="light"] .modal, :root[data-theme="light"] .palette { background: rgba(255,255,255,.55); }
:root[data-theme="light"] .modal__close span, :root[data-theme="light"] .slide__close span { background: #0a0a0a; }
:root[data-theme="light"] .modal__close { background: rgba(0,0,0,.05); }
:root[data-theme="light"] .linklike { color: #0a0a0a; }
:root[data-theme="light"] .empty-mark { background: rgba(0,0,0,.04); color: rgba(0,0,0,.7); }
:root[data-theme="light"] .rem { background: rgba(245,179,1,.12); }
:root[data-theme="light"] .rem a { color: #0a0a0a; }
:root[data-theme="light"] .cmp-bar { background: #fff; color: #0a0a0a; }
:root[data-theme="light"] .dl-days { color: #0a0a0a; }
:root[data-theme="light"] .cmp-check.on { background: #0a0a0a; color: #fff; border-color: #0a0a0a; }
:root[data-theme="light"] .palette__item.is-active { background: rgba(0,0,0,.06); }
:root[data-theme="light"] kbd { background: rgba(0,0,0,.06); color: #0a0a0a; }

/* ===================== v3: grant cards ===================== */
.g-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted-fg); }
.g-flag { font-size: 18px; line-height: 1; filter: none; }
.g-main { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; }
.g-dl { text-align: right; min-width: 78px; }
.g-dl b { display: block; font-size: 30px; font-weight: 400; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.g-dl b.soon { color: var(--brand); } .g-dl b.hot { color: var(--accent); } .g-dl b.tbd { font-size: 16px; color: var(--muted-fg); padding-top: 6px; }
.g-dl span { display: block; font-size: 11px; color: var(--muted-fg); margin-top: 4px; }
.g-meter { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted-fg); }
.g-meter i { flex: 1; height: 4px; border-radius: 4px; background: var(--muted); overflow: hidden; }
.g-meter i::after { content: ""; display: block; height: 100%; width: var(--w, 50%); border-radius: 4px; background: linear-gradient(90deg, var(--brand), #fff); transform-origin: left; animation: meterIn .6s var(--ease) both; }
@keyframes meterIn { from { transform: scaleX(0); } }
.g-foot { gap: 8px; }
.g-apply { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--pill); background: var(--btn-bg); color: var(--btn-fg); font-size: 13px; font-weight: 500; transition: transform var(--base) var(--ease), box-shadow var(--base); }
.g-apply:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(255,255,255,.2); }
.g-apply svg { width: 15px; height: 15px; }
.g-actions { display: flex; gap: 6px; margin-left: auto; }
.cmp-check { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border); background: rgba(255,255,255,.05); color: var(--muted-fg); display: grid; place-items: center; }   /* переходы — в общем правиле кнопок ниже */
.cmp-check:hover { transform: scale(1.1); color: var(--fg); border-color: var(--border-strong); }
.cmp-check.on { background: #fff; color: var(--ink); border-color: #fff; }
.cmp-check svg { width: 16px; height: 16px; }
.cmp-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: var(--pill); background: #fff; color: var(--ink); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; animation: toastIn .4s var(--ease) both; }
.cmp-bar .btn-ghost { background: rgba(0,0,0,.06); color: inherit; border-color: transparent; }
.modal__panel--wide { width: min(1080px, 100%); max-height: 88vh; overflow: auto; }
.cmp-table { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; margin-top: 14px; }
.cmp-row { display: grid; grid-template-columns: 150px repeat(var(--n, 2), 1fr); background: var(--card-solid, #0d0d0f); }
:root[data-theme="light"] .cmp-row { background: #fff; }
.cmp-row > div { padding: 12px 14px; font-size: 13px; font-weight: 300; }
.cmp-row > div:first-child { color: var(--muted-fg); font-size: 12px; }
.cmp-row.head > div { font-weight: 500; font-size: 14px; }

/* ===================== v3: home ===================== */
.home-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 6px 0 22px; }
.tile { padding: 18px 20px; border-radius: 20px; border: 1px solid var(--border); background: var(--card); animation: riseIn .45s var(--ease) both; }
.tile:nth-child(2) { animation-delay: .06s; } .tile:nth-child(3) { animation-delay: .12s; } .tile:nth-child(4) { animation-delay: .18s; }
.tile b { display: block; font-size: 34px; font-weight: 300; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile b.brand { color: var(--brand); }
.tile span { display: block; margin-top: 8px; font-size: 12px; color: var(--muted-fg); }
.tile .bar { height: 4px; border-radius: 4px; background: var(--muted); margin-top: 12px; overflow: hidden; }
.tile .bar i { display: block; height: 100%; width: var(--w, 0%); background: var(--brand); border-radius: 4px; transition: width .5s var(--ease); }
.home-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 12px; margin-bottom: 26px; }
.home-tip { display: flex; flex-direction: column; gap: 12px; border-color: rgba(61,220,132,.25); background: linear-gradient(135deg, rgba(61,220,132,.10), rgba(255,255,255,.03) 60%); }
.home-tip .eyebrow { margin: 0; color: var(--brand); }
.home-tip p { margin: 0; font-size: 1.05rem; line-height: 1.5; font-weight: 300; }
.home-tip .btn { align-self: flex-start; margin-top: auto; }
.dl-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.dl-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); cursor: pointer; }
.dl-list li:first-child { border-top: 0; }
/* Сроки появляются сверху вниз, ближайший — первым */
.dl-list li { animation: riseIn var(--slow) var(--ease) both; }
.dl-list li:nth-child(2) { animation-delay: 40ms; } .dl-list li:nth-child(3) { animation-delay: 80ms; }
.dl-list li:nth-child(4) { animation-delay: 120ms; } .dl-list li:nth-child(n+5) { animation-delay: 160ms; }
.dl-days { min-width: 54px; font-size: 22px; font-weight: 400; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dl-days.soon { color: var(--brand); } .dl-days.hot { color: var(--accent); }
.dl-name { flex: 1; font-size: 13.5px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-meta { font-size: 11px; color: var(--muted-fg); white-space: nowrap; }
.home-section-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 14px; }
.home-section-head h3 { margin: 0; font-size: 1.3rem; font-weight: 400; letter-spacing: -.02em; }
.why { display: flex; gap: 6px; flex-wrap: wrap; }
.why span { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(61,220,132,.12); color: var(--brand); }
.scan-live { display: inline-flex; align-items: center; gap: 8px; }
.scan-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

/* ===================== v3: command palette ===================== */
.palette { position: fixed; inset: 0; z-index: 95; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(0,0,0,.55); backdrop-filter: blur(10px); animation: fadeIn .2s var(--ease) both; }
.palette__panel { width: min(640px, 100%); border-radius: 22px; border: 1px solid var(--border); background: var(--card-solid, #0d0d0f); box-shadow: var(--shadow-lg); overflow: hidden; animation: riseIn .35s var(--ease) both; }
.palette__input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.palette__input svg { color: var(--muted-fg); }
.palette__input input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--fg); font-size: 16px; font-weight: 300; }
kbd { font: inherit; font-size: 11px; padding: 3px 7px; border-radius: 7px; background: rgba(255,255,255,.08); color: var(--muted-fg); }
.palette__list { max-height: 52vh; overflow: auto; padding: 8px; }
.palette__group { padding: 10px 12px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.palette__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; font-size: 14px; }
.palette__item:hover, .palette__item.is-active { background: rgba(255,255,255,.07); }
.palette__item .pi-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--muted); font-size: 15px; flex: none; }
.palette__item .pi-ico svg { width: 15px; height: 15px; }
.palette__item .pi-sub { margin-left: auto; font-size: 11px; color: var(--muted-fg); white-space: nowrap; }
.palette__empty { padding: 24px; text-align: center; color: var(--muted-fg); font-size: 13px; }

/* ===================== v3: micro-interactions ===================== */
.btn:active, .pill:active, .icon-btn:active, .fav:active, .choice:active { transform: scale(.96) !important; transition-duration: .08s; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.gcard { will-change: transform; }
.topbar { max-width: 1280px; gap: 16px; }
@media (max-width: 1500px) { .topbar-actions .pill--dark { display: none; } }
@media (max-width: 1100px) { .topbar-actions .pill--white { display: none; } .user-name { display: none; } }
@media (max-width: 1024px) { .home-tiles { grid-template-columns: repeat(2, 1fr); } .home-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .home-tiles { grid-template-columns: 1fr 1fr; } .tile b { font-size: 28px; } .g-main { grid-template-columns: 1fr; } .g-dl { text-align: left; } .cmp-row { grid-template-columns: 110px repeat(var(--n, 2), 1fr); } .cmp-bar { left: 12px; right: 12px; transform: none; justify-content: space-between; } #paletteBtn { display: none; } }


/* ---------- Фильтры каталога и переключатель раздела ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--pill); border: 1px solid var(--border); background: rgba(255,255,255,.04); }
.seg button { height: 30px; padding: 0 14px; border-radius: var(--pill); border: 0; background: transparent; color: var(--muted-fg); font-size: 12px; transition: background var(--base) var(--ease), color var(--base) var(--ease); }
.seg button.is-on { background: #fff; color: var(--ink); }
.filters select { height: 38px; padding: 0 12px; border-radius: var(--pill); border: 1px solid var(--border); background: rgba(255,255,255,.04); color: inherit; font: inherit; font-size: 12px; max-width: 100%; }
.filters select.is-set { border-color: var(--border-strong); color: #fff; }
.filters select option { color: #0a0a0a; background: #fff; }
#searchScope { margin-bottom: 4px; }
.review-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.review-item .inline-form input { flex: 0 0 84px; width: 84px; text-transform: uppercase; }
:root[data-theme="light"] .seg, :root[data-theme="light"] .filters select { background: rgba(0,0,0,.04); color: #0a0a0a; }
:root[data-theme="light"] .seg button.is-on { background: #0a0a0a; color: #fff; }
:root[data-theme="light"] .filters select.is-set { color: #0a0a0a; }
@media (max-width: 720px) { .review-item { grid-template-columns: 1fr; } .filters select { flex: 1 1 40%; } }

/* ---------- Флаги стран: эмодзи из кода ISO, без картинок ---------- */
/* Windows не рисует эмодзи-флаги (выводит буквы «KZ»), поэтому там подключается шрифт только с флагами */
@font-face { font-family: "Twemoji Country Flags"; unicode-range: U+1F1E6-1F1FF; font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2") format("woff2"); }
.flag { font-style: normal; line-height: 1; }
.flag-font .flag, .flag-font select, .flag-font .crumbs span { font-family: "Twemoji Country Flags", Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
.g-head .flag { font-size: 16px; vertical-align: -1px; }
.fav.bell.on svg { fill: none; }

/* ---------- Полоса прокрутки как в iOS: тонкая «пилюля», видна только во время прокрутки и плавно гаснет ---------- */
@property --sb-thumb { syntax: "<color>"; inherits: true; initial-value: transparent; }
html { --sb-thumb: transparent; --sb-on: rgba(255,255,255,.6); --sb-hover: rgba(255,255,255,.65); transition: --sb-thumb var(--slow) ease var(--fast); }
html.is-scrolling { --sb-thumb: var(--sb-on); transition: --sb-thumb .12s ease; }
::-webkit-scrollbar { width: 11px; height: 11px; background: transparent; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; }
::-webkit-scrollbar-thumb { background-color: var(--sb-thumb); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; min-height: 44px; }
::-webkit-scrollbar-thumb:hover, ::-webkit-scrollbar-thumb:active { background-color: var(--sb-hover); border-width: 2px; }
@supports not selector(::-webkit-scrollbar) { * { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; } }
:root[data-theme="light"] { --sb-on: rgba(0,0,0,.4); --sb-hover: rgba(0,0,0,.6); }
/* Полоса прокрутки страницы рисуется своим элементом поверх контента (как в iOS) — одинаково в любом браузере */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; width: 0; }
.ios-sb { position: fixed; top: 6px; bottom: 6px; right: 3px; width: 12px; z-index: 2147483000; pointer-events: none; opacity: 0; transition: opacity var(--slow) ease var(--fast); }
.ios-sb.on { opacity: 1; transition: opacity .12s ease; }
.ios-sb i { position: absolute; top: 0; right: 0; width: 5px; min-height: 36px; border-radius: 999px; background: var(--sb-on); box-shadow: 0 0 0 .5px rgba(0,0,0,.25); transition: width var(--fast) ease, background var(--fast) ease; }
.ios-sb.on i { pointer-events: auto; cursor: default; touch-action: none; }
.ios-sb i:hover, .ios-sb.drag i { width: 9px; background: var(--sb-hover); }

/* ---------- Выпадающие списки фильтров в стиле сайта (вместо системных) ---------- */
.dd-native { display: none !important; }
.dd { position: relative; }
.dd[hidden] { display: none; }
.dd-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 16px; border-radius: var(--pill); border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--muted-fg); font: inherit; font-size: 12px; white-space: nowrap; transition: border-color var(--base) var(--ease), color var(--base) var(--ease), background var(--base) var(--ease); }
.dd-btn:hover, .dd.open .dd-btn { border-color: var(--border-strong); color: #fff; }
.dd.is-set .dd-btn { border-color: var(--border-strong); color: #fff; background: rgba(255,255,255,.09); }
.dd-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--base) var(--ease); }
.dd.open .dd-btn svg { transform: rotate(180deg); }
.dd-menu { position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; min-width: 100%; max-height: 320px; overflow-y: auto; padding: 6px; border-radius: 18px; border: 1px solid var(--border-strong); background: rgba(16,16,18,.96); backdrop-filter: blur(20px); box-shadow: var(--shadow-lg); display: grid; gap: 2px; opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98); transform-origin: top left; transition: opacity var(--fast) ease, transform var(--base) var(--ease), visibility 0s linear var(--base); }
.dd.open .dd-menu { opacity: 1; visibility: visible; transform: none; transition: opacity var(--fast) ease, transform var(--base) var(--ease); }
.dd-opt { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 9px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--muted-fg); font: inherit; font-size: 13px; text-align: left; white-space: nowrap; transition: background var(--fast) ease, color var(--fast) ease; }
.dd-opt:hover, .dd-opt:focus-visible { background: rgba(255,255,255,.08); color: #fff; outline: none; }
.dd-opt.is-on { background: #fff; color: var(--ink); }
.dd-opt.is-on::after { content: "\2713"; font-size: 12px; }
.filters { position: relative; z-index: 5; }
.flag-font .dd { font-family: "Twemoji Country Flags", Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
:root[data-theme="light"] .dd-btn { background: rgba(0,0,0,.04); color: rgba(0,0,0,.6); }
:root[data-theme="light"] .dd-btn:hover, :root[data-theme="light"] .dd.open .dd-btn, :root[data-theme="light"] .dd.is-set .dd-btn { color: #0a0a0a; border-color: rgba(0,0,0,.3); }
:root[data-theme="light"] .dd-menu { background: rgba(255,255,255,.98); border-color: rgba(0,0,0,.12); box-shadow: 0 30px 80px -30px rgba(0,0,0,.35); }
:root[data-theme="light"] .dd-opt { color: rgba(0,0,0,.65); }
:root[data-theme="light"] .dd-opt:hover, :root[data-theme="light"] .dd-opt:focus-visible { background: rgba(0,0,0,.06); color: #0a0a0a; }
:root[data-theme="light"] .dd-opt.is-on { background: #0a0a0a; color: #fff; }
@media (max-width: 720px) { .dd { flex: 1 1 40%; } .dd-btn { width: 100%; justify-content: space-between; } }
.g-title a { color: inherit; text-decoration: none; }
.g-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.review-item .inline-form input.rv-date { flex: 0 0 150px; width: 150px; text-transform: none; }

/* ---------- Компактные шапки разделов: картинка и огромный заголовок только на главной ---------- */
.view:not(.view--home) .view-art { display: none; }
.view:not(.view--home) .vhead { padding: 6px 0 22px; }
.view:not(.view--home) .vtitle { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
.view:not(.view--home) .vlead { margin-top: 10px; font-size: .95rem; }
.view[data-view="catalog"] .filters { margin-top: 4px; }
/* ---------- Карточка: источник в одну строку, уровень — тегом ---------- */
.g-head { min-width: 0; }
.g-src { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-actions .fav em, .g-actions .cmp-check em { display: none; }
.g-actions .fav, .g-actions .cmp-check { position: relative; }
.g-actions button em { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 4px 9px; border-radius: var(--pill); background: #fff; color: var(--ink); font-size: 11px; font-style: normal; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity var(--fast) ease; z-index: 3; }
@media (hover: hover) { .g-actions button:hover em, .g-actions button:focus-visible em { display: block; opacity: 1; } }
:root[data-theme="light"] .g-actions button em { background: #0a0a0a; color: #fff; }

/* ---------- Иконки вместо эмодзи (флаги стран остаются эмодзи) ---------- */
.ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.15em; flex: none; }
.crumbs span .ico, .rem .ico { width: 15px; height: 15px; margin-right: 6px; }
.rem .ico { color: var(--accent); }
.pi-ico .ico { width: 16px; height: 16px; }
/* Светлая тема: жёлтый на белом не читается — темнее оттенок */
:root[data-theme="light"] { --accent: #b45309; --online: #15803d; }
/* Кому движение мешает — всё появляется сразу, без каскадов и покачиваний */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .gcard { opacity: 1; transform: none; }
}

/* ---------- «Мне подходит» ---------- */
.match-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 6px 0 22px; }
.match-summary .tile b { font-size: 28px; }
.tag.gap { color: #fca5a5; border-color: rgba(239,68,68,.4); }
#matchNearHead { margin-top: 30px; flex-wrap: wrap; gap: 6px 14px; }
/* ---------- Привязка Telegram ---------- */
.tg-card { margin-top: 26px; position: relative; z-index: 1; }
.tg-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.tg-head h3 { margin: 0 0 4px; }
.tg-head p { margin: 0; }
.tg-ico { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(42,171,238,.14); border: 1px solid rgba(42,171,238,.35); color: #2aabee; }
.tg-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tg-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tg-col { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: rgba(255,255,255,.03); }
.tg-col p { margin: 0; }
.tg-col .btn { align-self: flex-start; }
.tg-codebox { display: flex; flex-direction: column; gap: 10px; }
.tg-code { font-size: 30px; letter-spacing: .3em; font-weight: 500; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px dashed var(--border); align-self: flex-start; user-select: all; }
.tg-ok { margin: 0; color: var(--online); }
#tgInput { text-transform: uppercase; letter-spacing: .15em; }
@media (max-width: 760px) { .match-summary, .tg-cols { grid-template-columns: 1fr; } }

/* ---------- Аудитория (админ) ---------- */
.stat small { display: block; margin-top: 4px; font-size: .72rem; color: var(--muted-fg); }
.aud-chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 120px; margin-top: 18px; padding-top: 8px; border-top: 1px solid var(--border); }
.aud-col { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; font-size: 10px; color: var(--muted-fg); }
.aud-bars { display: flex; gap: 2px; align-items: flex-end; flex: 1; width: 100%; justify-content: center; }
.aud-bars i { display: block; width: 40%; border-radius: 4px 4px 0 0; min-height: 2px; }
.aud-bars .a { background: var(--brand); }
.aud-bars .n { background: rgba(42,171,238,.8); }
.aud-legend { display: flex; gap: 16px; margin-top: 8px; font-size: .75rem; color: var(--muted-fg); }
.aud-sub { margin: 26px 0 6px; font-size: 1rem; }
/* ---------- Избранное: статус заявки и экспорт дедлайнов ---------- */
.fav-tools { display: flex; justify-content: flex-end; margin: -6px 0 14px; }
.fav-status { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted-fg); }
.fav-status select { flex: 1; height: 34px; padding: 0 12px; border-radius: var(--pill); border: 1px solid var(--border); background: rgba(255,255,255,.05); color: var(--fg); font: inherit; font-size: 12px; outline: 0; }
.fav-status select:focus { border-color: var(--border-strong); }
:root[data-theme="light"] .fav-status select { background: rgba(0,0,0,.04); }
.fav.share:hover { color: var(--fg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.recent-wrap { overflow-x: auto; }
.recent { width: 100%; border-collapse: collapse; font-size: .82rem; }
.recent th { text-align: left; font-weight: 400; color: var(--muted-fg); padding: 6px 10px; border-bottom: 1px solid var(--border); }
.recent td { padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.recent td:nth-child(2) { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.recent .tag { margin-left: 6px; }
.aud-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }


/* =====================================================================
   v4: система кнопок на токенах
   Три уровня: primary (белая, одна на экран) → ghost (полупрозрачная) → link (текст со стрелкой).
   Отдельный зелёный «go» — только для главного действия продукта: «Подать заявку».
   Наведение: меняется фон и мягкое свечение, без прыжков и увеличения.
   ===================================================================== */
:root {
  --btn-primary-bg: #ffffff; --btn-primary-fg: #050505; --btn-primary-hover: #e8e8ec; --btn-primary-glow: 0 0 24px rgba(255,255,255,.16);
  --btn-ghost-bg: rgba(255,255,255,.06); --btn-ghost-hover: rgba(255,255,255,.12); --btn-ghost-fg: #ffffff; --btn-ghost-border: rgba(255,255,255,.12);
  --btn-go-bg: #3ddc84; --btn-go-fg: #03210f; --btn-go-hover: #5be59a; --btn-go-glow: 0 0 26px rgba(61,220,132,.28);
  --focus: #ffffff; --tap: 40px;
}
:root[data-theme="light"] {
  --btn-primary-bg: #0a0a0a; --btn-primary-fg: #ffffff; --btn-primary-hover: #2a2a2e; --btn-primary-glow: 0 10px 24px -12px rgba(0,0,0,.45);
  --btn-ghost-bg: rgba(0,0,0,.04); --btn-ghost-hover: rgba(0,0,0,.08); --btn-ghost-fg: #0a0a0a; --btn-ghost-border: rgba(0,0,0,.12);
  --btn-go-bg: #15803d; --btn-go-fg: #ffffff; --btn-go-hover: #166534; --btn-go-glow: 0 10px 24px -12px rgba(21,128,61,.55);
  --focus: #0a0a0a;
}
@media (pointer: coarse) { :root { --tap: 44px; } }

.btn, .pill, .g-apply, .icon-btn, .send, .fav, .cmp-check, .dd-btn {
  transition: background-color var(--fast) ease, border-color var(--fast) ease, color var(--fast) ease, box-shadow var(--base) ease, transform var(--fast) ease;
}
.btn { min-height: var(--tap); }
.btn-sm { min-height: 36px; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }

.btn-primary, .pill--white, .send { background: var(--btn-primary-bg); color: var(--btn-primary-fg); border-color: transparent; }
.btn-primary:hover, .pill--white:hover, .send:hover { background: var(--btn-primary-hover); box-shadow: var(--btn-primary-glow); transform: translateY(-1px); }
.btn-ghost { background: var(--btn-ghost-bg); color: var(--btn-ghost-fg); border-color: var(--btn-ghost-border); }
.btn-ghost:hover { background: var(--btn-ghost-hover); transform: none; }
.icon-btn:hover { transform: none; }
.btn-link { min-height: auto; padding: 6px 2px; background: none; border: 0; color: var(--fg); font-weight: 500; }
.btn-link::after { content: "→"; display: inline-block; transition: transform var(--fast) ease; }
.btn-link:hover { background: none; box-shadow: none; transform: none; }
.btn-link:hover::after { transform: translateX(3px); }
.btn:active, .pill:active, .g-apply:active, .send:active { transform: translateY(0) scale(.98); }

/* Главное действие продукта — зелёное */
.g-apply { position: relative; min-height: var(--tap); background: var(--btn-go-bg); color: var(--btn-go-fg); }
.g-apply:hover { background: var(--btn-go-hover); box-shadow: var(--btn-go-glow); transform: translateY(-1px); }

/* Карточки: спокойнее при наведении */
.gcard:hover { transform: translateY(-3px); }

/* Фокус с клавиатуры: единое кольцо (контур повторяет скругление) */
:where(.btn, .pill, .g-apply, .icon-btn, .send, .fav, .cmp-check, .dd-btn, .seg button, .lang button, .nav a, .choice, .user-chip, .fav-status select):focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px; border-radius: inherit;
}

/* Загрузка: спиннер внутри кнопки, ширина не меняется */
.is-loading { position: relative; color: transparent !important; pointer-events: none; opacity: 1 !important; }
.is-loading > * { visibility: hidden; }
.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--spin, var(--btn-primary-fg)); border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-ghost.is-loading, .btn-link.is-loading { --spin: var(--btn-ghost-fg); }
.g-apply.is-loading { --spin: var(--btn-go-fg); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Кнопки-иконки на карточке: крупнее для пальца */
@media (pointer: coarse) { .g-actions .fav, .g-actions .cmp-check { width: 44px; height: 44px; } }
/* На телефоне подсказок при наведении нет — подписи видны под иконками */
@media (max-width: 760px) {
  .g-foot { padding-bottom: 18px; }
  .g-actions { gap: 22px; }
  .g-actions .fav em, .g-actions .cmp-check em { display: block; opacity: 1; top: calc(100% + 3px); max-width: 60px; overflow: hidden; text-overflow: ellipsis;
    padding: 0; background: none; color: var(--muted-fg); font-size: 9.5px; }
  :root[data-theme="light"] .g-actions button em { background: none; color: var(--muted-fg); }
}

/* Теги статусов: не только цвет, но и форма — заметно при дальтонизме */
.tag.open::before, .tag.upcoming::before, .tag.urgent::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; vertical-align: 1px; border-radius: 50%; }
.tag.open::before { background: currentColor; }
.tag.upcoming::before { border: 1.5px solid currentColor; width: 5px; height: 5px; }
.tag.urgent::before { border-radius: 1px; width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid currentColor; background: none; }

/* Читаемость: тонкий серый текст на тёмном фоне — тяжелее */
.g-row, .vlead, .empty, .lead { font-weight: 400; }

/* Требования в карточке: три строки, полностью — по клику */
.g-req { flex-wrap: wrap; }
.g-req > div { flex: 1; min-width: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.g-req.clamped { cursor: pointer; }
.g-req.clamped::after { content: attr(data-more); flex-basis: 100%; padding-left: 24px; font-size: 12px; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.g-req.open > div { -webkit-line-clamp: unset; display: block; }
.g-req.open::after { content: none; }

/* Пустые состояния: мягкое свечение вокруг значка и строка о пользе */
.empty-mark { position: relative; }
.empty-mark::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.10), transparent 70%); filter: blur(6px); z-index: -1; }
:root[data-theme="light"] .empty-mark::before { background: radial-gradient(circle, rgba(0,0,0,.06), transparent 70%); }
.empty .empty-why { margin: -4px 0 4px; max-width: 420px; font-size: .88rem; color: var(--muted-fg); }


/* =====================================================================
   v5: глубина, ритм, срок в карточке, плитки-действия, настройки, фильтры, скелетоны
   ===================================================================== */
:root {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --surface-0: #08080a; --surface-1: rgba(255,255,255,.035); --surface-2: rgba(255,255,255,.065);
  --edge: inset 0 1px 0 rgba(255,255,255,.07);
}
:root[data-theme="light"] { --brand: #15803d; --surface-0: #ffffff; --surface-1: #ffffff; --surface-2: #f6f6f4; --edge: none; }

/* Слои: фон страницы → вкладка → карточка, каждая ступень чуть светлее, сверху тонкая кромка */
.view { background-color: var(--surface-0); }
.gcard, .tile, .card:not(.home-tip) { background: linear-gradient(180deg, var(--surface-2), var(--surface-1)); box-shadow: var(--edge); }
.gcard:hover { box-shadow: var(--edge), var(--shadow); }
:root[data-theme="light"] .gcard, :root[data-theme="light"] .tile, :root[data-theme="light"] .card:not(.home-tip) { background: #fff; }

/* Ритм отступов: шаг 4 и 8 */
.gcard { padding: var(--s5); gap: var(--s3); }
.home-tiles { gap: var(--s3); margin: var(--s2) 0 var(--s5); }
.tile { padding: 20px var(--s5); }
.home-grid { gap: var(--s3); }

/* Карточка: название во всю ширину, срок строкой ниже */
.g-main { display: flex; flex-direction: column; gap: var(--s2); }
.g-when { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 26px; padding: 0 10px; border-radius: var(--pill);
  font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted-fg); }
.chip svg { width: 13px; height: 13px; }
.chip.ok { color: var(--online); border-color: rgba(61,220,132,.35); background: rgba(61,220,132,.08); }
.chip.soon { color: var(--accent); border-color: rgba(245,179,1,.38); background: rgba(245,179,1,.08); }
.chip.hot { color: #fca5a5; border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.10); }
:root[data-theme="light"] .chip.hot { color: #b91c1c; }
.g-when-note { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted-fg); }
.g-foot { margin-top: auto; padding-top: var(--s4); border-top: 1px solid var(--border); }
.g-head .flag { font-size: 18px; }

/* Плитки-действия на главной вместо нулей */
.tile--cta { position: relative; display: block; color: inherit; text-decoration: none; background: transparent !important; box-shadow: none;
  border: 1px dashed var(--border-strong); transition: border-color var(--fast) ease, background-color var(--fast) ease; }
.tile--cta:hover { border-style: solid; background: var(--surface-2) !important; }
.tile--cta b.tile-cta { font-size: 16px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; padding-right: 24px; }
.tile-arrow { position: absolute; top: 20px; right: 22px; font-style: normal; color: var(--muted-fg); transition: transform var(--fast) ease, color var(--fast) ease; }
.tile--cta:hover .tile-arrow { transform: translateX(3px); color: var(--fg); }

/* «Ближайшие дедлайны» без дат */
.dl-list li.dl-note { cursor: default; border-top: 0; padding: 2px 0 10px; font-size: 13px; color: var(--muted-fg); line-height: 1.5; }
.dl-list li.dl-note + li { border-top: 0; }
.dl-days.open { flex: none; width: 10px; height: 10px; min-width: 0; margin: 0 10px 0 4px; padding: 0; border-radius: 50%; background: var(--online); }

/* Меню настроек: тема и язык */
.settings { position: relative; }
.settings-pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 80; min-width: 250px; padding: 8px; border-radius: 18px;
  border: 1px solid var(--border-strong); background: rgba(16,16,18,.96); backdrop-filter: blur(20px); box-shadow: var(--shadow-lg);
  display: grid; gap: 2px; animation: riseIn var(--fast) ease both; }
.settings-pop[hidden] { display: none !important; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 6px 6px 12px; font-size: 13px; color: var(--muted-fg); }
.settings-pop .lang, .settings-pop #themeToggle, .settings-pop #langBox { display: inline-flex !important; }
.settings-pop #themeToggle { display: grid !important; }
:root[data-theme="light"] .settings-pop { background: rgba(255,255,255,.97); }

/* Фильтры на телефоне: кнопка со счётчиком, панель раскрывается */
.filters-toggle { display: none; }
.f-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill);
  background: var(--btn-primary-bg); color: var(--btn-primary-fg); font-size: 11px; font-weight: 600; }
@media (max-width: 760px) {
  .filters-toggle { display: inline-flex; margin-bottom: var(--s3); }
  .filters:not(.open) > :not(.seg) { display: none !important; }
  .filters.open { padding: var(--s3); border-radius: 20px; border: 1px solid var(--border); background: var(--surface-1); }
}

/* Скелетон повторяет карточку: заголовок, срок, строки, кнопка */
.skeleton { height: auto; min-height: 290px; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5);
  background: var(--surface-1); border: 1px solid var(--border); animation: none; }
.sk { display: block; height: 12px; border-radius: 6px; background: rgba(255,255,255,.06); }
.sk.w30 { width: 30%; } .sk.w60 { width: 60%; } .sk.w85 { width: 85%; } .sk.w100 { width: 100%; } .sk.h20 { height: 20px; }
.sk.chip-s { width: 110px; height: 26px; border-radius: 999px; }
.sk-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: var(--s4); border-top: 1px solid var(--border); }
.sk.btn-s { width: 140px; height: 40px; border-radius: 999px; } .sk.dot { width: 38px; height: 38px; border-radius: 50%; }
:root[data-theme="light"] .sk { background: linear-gradient(90deg, rgba(0,0,0,.05) 25%, rgba(0,0,0,.09) 50%, rgba(0,0,0,.05) 75%); background-size: 200% 100%; }

/* ---------- Сообщить об ошибке, сброс и смена пароля ---------- */
.g-report { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: flex-end; margin-top: 6px; min-height: 20px; }
.g-report-btn { border: 0; background: none; padding: 2px 0; color: var(--muted-fg); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; transition: color .2s, text-decoration-color .2s; }
.g-report-btn:hover, .g-report-btn:focus-visible { color: inherit; text-decoration-color: currentColor; }
.g-report-done { font-size: 12px; color: var(--ok, #3ddc84); }
.auth-forgot { margin-top: 4px; }
.pw-card { margin-top: 24px; max-width: 520px; }
.pw-card h3 { margin: 0 0 6px; }
@media (pointer: coarse) { .g-report-btn { padding: 8px 0; } }

/* Chat history and answer controls */
.chat { display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto minmax(300px, 1fr) auto auto; }
.chat-history { grid-column: 1; grid-row: 1 / 5; padding: 14px; border-right: 1px solid var(--border); }
.chat-history .chat-new { width: 100%; }
.chat-threads { display: grid; gap: 5px; margin-top: 12px; }
.chat-thread { width: 100%; overflow: hidden; padding: 10px; border: 0; border-radius: 10px; background: transparent; color: var(--muted-fg); text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread:hover, .chat-thread.is-active { background: var(--surface-1, rgba(255,255,255,.06)); color: var(--fg); }
.chat-head, .chat-log, .suggestions, .chat-form { grid-column: 2; }
.chat-answer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chat-answer-actions button { min-height: 32px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 9px; background: transparent; color: var(--muted-fg); font-size: .78rem; }
.chat-answer-actions button:hover { color: var(--fg); border-color: var(--border-strong); }
@media (max-width: 760px) {
  .chat { grid-template-columns: minmax(0, 1fr); }
  .chat-history { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 10px; overflow-x: auto; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .chat-history .chat-new { flex: 0 0 auto; width: auto; }
  .chat-threads { display: flex; flex: 1; margin: 0; }
  .chat-thread { flex: 0 0 150px; }
  .chat-head, .chat-log, .suggestions, .chat-form { grid-column: 1; }
}

/* UI refinement: clearer hierarchy, better touch/keyboard feedback, and useful empty states. */
:root { --surface-3: rgba(255,255,255,.09); --focus-ring: 0 0 0 3px rgba(61,220,132,.38); }
:root[data-theme="light"] { --surface-3: rgba(0,0,0,.07); --focus-ring: 0 0 0 3px rgba(21,128,61,.25); }
:where(a, button, input, textarea, select, [tabindex]):focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; box-shadow: var(--focus-ring); }
.icon-btn:focus-visible { border-radius: 50%; }
.skip-link { position: fixed; z-index: 1000; top: 12px; left: 12px; padding: 12px 16px; border-radius: 10px; color: var(--btn-fg); background: var(--btn-bg); transform: translateY(-160%); }
.skip-link:focus-visible { transform: none; }
.view { width: min(100% - 32px, 1320px); margin: 0 auto 28px; }
.vhead { max-width: 760px; padding-top: clamp(28px, 5vw, 54px); padding-bottom: clamp(24px, 4vw, 40px); }
.vtitle { text-wrap: balance; line-height: 1.08; }
.vlead { max-width: 68ch; color: var(--muted-fg); line-height: 1.7; }
.home-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile { min-height: 112px; display: flex; flex-direction: column; justify-content: center; }
.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); align-items: stretch; }
.gcard { min-width: 0; transition: border-color var(--fast) ease, background-color var(--fast) ease, box-shadow var(--fast) ease, transform var(--fast) ease; }
.gcard:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.g-title { text-wrap: pretty; line-height: 1.35; }
.g-apply { min-height: 44px; }
.filters { padding: 12px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface-1); }
.filters select, .dd-btn { min-height: 42px; }
.results-bar { margin-bottom: 10px; }
.crumbs { flex-wrap: wrap; }
.search-box { max-width: 760px; min-height: 58px; border-radius: 18px; }
.search-box input { min-width: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 20px; }
.quick button { min-height: 38px; }
.search-empty, .catalog-empty { grid-column: 1 / -1; width: 100%; min-height: 230px; justify-content: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-1); }
.search-empty p, .catalog-empty p { max-width: 52ch; }
.empty .btn { margin-top: 4px; }
.nav a[aria-current="page"] { color: var(--fg); }
.nav a:focus-visible, .btn-link:focus-visible { z-index: 2; }
@media (max-width: 1024px) { .home-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .view { width: calc(100% - 20px); margin-bottom: 18px; padding: 22px 16px 28px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .nav { background: var(--surface-0); }
  .home-tiles { gap: 9px; }
  .tile { min-height: 100px; padding: 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .gcard { padding: 18px; }
  .filters { gap: 8px; }
  .filters select, .dd { flex: 1 1 calc(50% - 8px); min-width: 0; }
  .search-box { border-radius: 16px; }
  .quick { flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
  .quick button { flex: 0 0 auto; }
}
@media (max-width: 380px) {
  .view { width: calc(100% - 12px); padding-left: 12px; padding-right: 12px; }
  .home-tiles { grid-template-columns: 1fr 1fr; }
  .tile { padding: 13px; }
}
@media (prefers-reduced-motion: reduce) { .gcard:hover { transform: none; } }

/* Profile wizard */
.profile-wizard { width: 100%; max-width: 620px; gap: 18px; }
.profile-completion { display: grid; gap: 9px; }
.profile-completion__top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; }
.profile-completion__top b { font-size: .9rem; font-weight: 500; }
.profile-completion__top span, .profile-save-status { color: var(--muted-fg); font-size: .8rem; }
.profile-progress { height: 7px; overflow: hidden; border-radius: 999px; background: var(--muted); }
.profile-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--brand); transition: width var(--base) ease; }
.wizard-heading span { color: var(--muted-fg); font-size: .82rem; }
.wizard-heading h3 { margin: 5px 0 0; font-size: 1.25rem; }
.profile-step { display: grid; gap: 16px; }
.profile-step[hidden] { display: none; }
.profile-step select { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--card-solid); color: var(--fg); }
.choice-field { min-width: 0; margin: 0; padding: 0; border: 0; }
.choice-field legend { margin-bottom: 8px; font-size: 13px; }
.choice-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice-chips--wrap { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }
.choice-chip { min-height: 44px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-1, rgba(255,255,255,.04)); color: var(--muted-fg); text-align: center; transition: border-color var(--fast), background var(--fast), color var(--fast); }
.choice-chip:hover, .choice-chip.is-selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--fg); }
.choice-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wizard-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wizard-actions #profileNext { margin-left: auto; }
.profile-error { margin: 0; padding: 10px 12px; border: 1px solid var(--danger); border-radius: 12px; color: var(--danger); font-size: .9rem; }
.profile-save-status { min-height: 1.2em; margin: -10px 0 0; }
@media (max-width: 760px) {
  .profile-wizard { padding: 20px 16px; }
  .wizard-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wizard-actions #profileNext { margin-left: 0; }
  .wizard-actions .btn { justify-content: center; }
}

/* Polish pass: align the product shell, brand, and controls across screens. */
main { max-width: 1520px; }
.topbar { max-width: 1520px; }
.brand { gap: 10px; }
.brand-mark { position: static; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; overflow: visible; background: none; box-shadow: none; }
.brand-mark::after { content: none; }
.brand-mark .logo { width: 32px; height: 32px; filter: drop-shadow(0 6px 16px rgba(255,255,255,.25)); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-text b { font-size: 13px; font-weight: 500; }
.brand-text i { font-size: 11px; }
.nav-ink { border: 1px solid rgba(61,220,132,.15); background: linear-gradient(135deg, rgba(61,220,132,.105), rgba(255,255,255,.035) 75%); box-shadow: inset 0 1px rgba(255,255,255,.035); }
.nav a.active::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 9px rgba(61,220,132,.65); transform: translateX(-50%); animation: navDotIn .28s var(--ease) both; }
.nav a { transition: color var(--base) var(--ease), transform var(--fast) var(--ease); }
.nav a:hover { transform: translateY(-1px); }
.form input, .form textarea, .form select, .profile-wizard select {
  width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px;
  background: rgba(255,255,255,.045); color: var(--fg); font: inherit; line-height: 1.45; outline: 0;
  transition: border-color var(--fast) ease, box-shadow var(--fast) ease, background var(--fast) ease;
}
.form textarea { min-height: 92px; resize: vertical; }
.form textarea[name="project_description"] { min-height: 112px; }
.form input::placeholder, .form textarea::placeholder { color: var(--faint); opacity: 1; }
.form input:focus, .form textarea:focus, .form select:focus, .profile-wizard select:focus { border-color: var(--brand); background: rgba(61,220,132,.045); box-shadow: 0 0 0 3px rgba(61,220,132,.14); }
.form select, .profile-wizard select { padding-right: 36px; color-scheme: dark; }
.form select option, .profile-wizard select option { background: #111214; color: #f5f5f5; }
.form select option:checked, .profile-wizard select option:checked { background: #173d2c; color: #fff; }
.form select:has(option:checked), .profile-wizard select:has(option:checked) { color: var(--fg); }
.choice-chips { gap: 9px; }
.choice-chip { min-width: 0; min-height: 48px; padding: 10px 12px; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.choice-chip:hover { transform: translateY(-1px); }
.profile-step { animation: stepIn .32s var(--ease) both; }
.profile-step[hidden] { animation: none; }
.profile-progress i { background: linear-gradient(90deg, #31c978, #74edab); box-shadow: 0 0 12px rgba(61,220,132,.28); }
.profile-save-status { transition: color var(--fast) ease; }
.view:not([hidden]) { animation: viewIn .42s var(--ease) both; }
.gcard, .tile, .feature, .card { transition: transform var(--base) var(--ease), border-color var(--base) ease, box-shadow var(--base) ease, background-color var(--base) ease; }
.gcard:hover, .tile:hover { transform: translateY(-3px); }
@keyframes navDotIn { from { opacity: 0; transform: translate(-50%, 3px) scale(.6); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes stepIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
:root[data-theme="light"] .nav-ink { border-color: rgba(21,128,61,.16); background: linear-gradient(135deg, rgba(21,128,61,.11), rgba(0,0,0,.025) 75%); }
:root[data-theme="light"] .form input, :root[data-theme="light"] .form textarea, :root[data-theme="light"] .form select, :root[data-theme="light"] .profile-wizard select { background: rgba(0,0,0,.025); color: #111; color-scheme: light; }
:root[data-theme="light"] .form select option, :root[data-theme="light"] .profile-wizard select option { background: #fff; color: #111; }
:root[data-theme="light"] .form select option:checked, :root[data-theme="light"] .profile-wizard select option:checked { background: #d8f3e2; color: #111; }
@media (max-width: 760px) {
  main { padding: 6px 10px 32px; }
  .topbar { padding: 12px 16px; }
  .nav a.active::after { left: auto; right: 14px; bottom: 50%; transform: translateY(50%); }
  .choice-chips--wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-wizard { gap: 16px; }
  .profile-step { gap: 14px; }
}
@media (max-width: 380px) {
  .choice-chip { min-height: 44px; padding: 9px 8px; font-size: 13px; }
  .brand-text i { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav a.active::after, .profile-step { animation: none; }
  .nav a:hover, .gcard:hover, .tile:hover, .choice-chip:hover { transform: none; }
}

/* Country picker: a styled listbox instead of the browser's native popup. */
.country-field { position: relative; }
.country-select { position: relative; width: 100%; }
#countrySelect input[type="hidden"] { display: none; }
.country-trigger { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 52px;
  padding: 0 16px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.045); color: var(--fg);
  text-align: left; font: inherit; transition: border-color var(--fast) ease, background var(--fast) ease, box-shadow var(--fast) ease; }
.country-trigger:hover, .country-trigger[aria-expanded="true"] { border-color: rgba(61,220,132,.65); background: rgba(61,220,132,.045); }
.country-trigger[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(61,220,132,.12); }
.country-trigger svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--muted-fg); transition: transform var(--fast) ease, color var(--fast) ease; }
.country-trigger[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--brand); }
.country-options { position: relative; z-index: 2; width: 100%; margin-top: 8px; display: grid; gap: 4px; max-height: min(300px, 45vh); overflow-y: auto;
  padding: 7px; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: rgba(15,16,18,.98);
  box-shadow: 0 18px 48px rgba(0,0,0,.52), inset 0 1px rgba(255,255,255,.04); backdrop-filter: blur(18px);
  transform-origin: top center; animation: countryMenuIn .16s var(--ease) both; }
.country-options[hidden] { display: none; }
.country-option { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted-fg); text-align: left; font: inherit;
  transition: color var(--fast) ease, background var(--fast) ease, border-color var(--fast) ease; }
.country-option::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.country-option:hover, .country-option:focus-visible { outline: none; border-color: rgba(255,255,255,.09); background: rgba(255,255,255,.07); color: var(--fg); }
.country-option:focus-visible { box-shadow: inset 0 0 0 1px rgba(61,220,132,.62); }
.country-option.is-selected, .country-option[aria-selected="true"] { border-color: rgba(61,220,132,.2); background: linear-gradient(100deg, rgba(61,220,132,.17), rgba(61,220,132,.07)); color: #f4fff8; }
.country-option.is-selected::after, .country-option[aria-selected="true"]::after { background: var(--brand); box-shadow: 0 0 10px rgba(61,220,132,.55); }
@keyframes countryMenuIn { from { opacity: 0; transform: translateY(-5px) scale(.99); } to { opacity: 1; transform: none; } }
:root[data-theme="light"] .country-trigger { background: rgba(0,0,0,.025); color: #111; }
:root[data-theme="light"] .country-options { border-color: rgba(0,0,0,.12); background: rgba(255,255,255,.98); box-shadow: 0 18px 48px rgba(0,0,0,.16); }
:root[data-theme="light"] .country-option { color: rgba(0,0,0,.68); }
:root[data-theme="light"] .country-option:hover, :root[data-theme="light"] .country-option:focus-visible { border-color: rgba(0,0,0,.08); background: rgba(0,0,0,.045); color: #111; }
:root[data-theme="light"] .country-option.is-selected, :root[data-theme="light"] .country-option[aria-selected="true"] { border-color: rgba(21,128,61,.2); background: #e2f6ea; color: #102d1b; }
@media (prefers-reduced-motion: reduce) { .country-options { animation: none; } .country-trigger svg { transition: none; } }

/* ===================== Публичная страница гранта (/grant/{id}) ===================== */
.gp-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; max-width: 880px; margin: 0 auto; padding: 22px 16px 0; }
.gp { max-width: 880px; margin: 0 auto; padding: 28px 16px 56px; }
.gp-crumbs { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-bottom: 28px; font-size: 12.5px; color: var(--muted-fg); }
.gp-crumbs a { color: var(--muted-fg); transition: color var(--fast); } .gp-crumbs a:hover { color: var(--fg); }
.gp-crumbs [aria-current] { color: var(--fg); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-title { margin: 0; font-size: clamp(30px, 5vw, 52px); line-height: 1.05; }
.gp-when { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 20px; font-size: 14px; color: var(--muted-fg); }
.gp-when b { color: var(--fg); font-weight: 500; }
.gp-tags { margin-top: 14px; }
.gp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 30px; }
.gp-actions svg { width: 16px; height: 16px; }
.gp-facts { display: grid; gap: 0; margin: 0; padding: 6px 24px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--card); }
.gp-fact { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.gp-fact:first-child { border-top: 0; }
.gp-fact dt { font-size: 13px; color: var(--muted-fg); }
.gp-fact dd { margin: 0; font-size: 15px; line-height: 1.6; }
.gp-note { margin-top: 16px; }
.gp-similar { margin-top: 48px; }
.gp-similar h2 { margin: 0 0 16px; font-size: 24px; }
.gp-sim-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gp-sim { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); transition: transform var(--base) var(--ease), border-color var(--base); }
.gp-sim:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.gp-sim b { font-weight: 500; font-size: 14.5px; line-height: 1.35; }
.gp-sim span { font-size: 13px; color: var(--muted-fg); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 720px) {
  .gp-fact { grid-template-columns: 1fr; gap: 4px; }
  .gp-facts { padding: 4px 18px; }
  .gp-sim-grid { grid-template-columns: 1fr; }
  .gp-actions .btn { flex: 1 1 100%; }
}

/* ===================== Ближайшие дедлайны на главной: строки — настоящие ссылки ===================== */
.dl-list li { cursor: default; }
.dl-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; color: inherit; border-radius: 10px; transition: background var(--fast); }
.dl-link:hover { background: rgba(255,255,255,.04); }
.dl-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
:root[data-theme="light"] .dl-link:hover { background: rgba(0,0,0,.04); }

/* Колонки главной не растягиваются под длинное название гранта: текст обрезается многоточием внутри карточки */
.home-grid > *, .home-tiles > * { min-width: 0; }
.dl-list li, .dl-link { min-width: 0; }

/* ===================== Профиль: сводка, вкладки, карточки разделов ===================== */
.psum { margin: 8px 0 22px; padding: 22px 24px; border-radius: var(--radius-lg); }
.psum-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.psum-head h3 { margin: 0; font-size: 18px; }
.psum-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.psum-item { min-width: 0; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.03); }
.psum-item dt { font-size: 12px; color: var(--muted-fg); margin-bottom: 4px; }
.psum-item dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.psum-item.is-empty dd { color: var(--faint); }

.ptabs { display: inline-flex; gap: 4px; padding: 4px; margin: 4px 0 20px; border-radius: var(--pill); border: 1px solid var(--border); background: rgba(255,255,255,.04); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ptabs::-webkit-scrollbar { display: none; }
.ptabs button { flex: none; min-height: 40px; padding: 0 18px; border: 0; border-radius: var(--pill); background: transparent; color: var(--muted-fg); font-size: 13.5px; transition: color var(--fast), background var(--fast); }
.ptabs button:hover { color: var(--fg); }
.ptabs button[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 500; }
.ptabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ppanel { display: grid; gap: 18px; animation: stepIn .32s var(--ease) both; }
.ppanel[hidden] { display: none; }
.wizard-aside { padding-top: 8px; }

.pcard { padding: 24px; border-radius: var(--radius-lg); }
.pcard h3 { margin: 0 0 6px; font-size: 18px; }
.pcard > .muted { margin: 0 0 16px; }
.pform { max-width: 720px; }
.pform select { width: 100%; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field-row:has(.field-narrow) { grid-template-columns: minmax(0, 1fr) minmax(120px, 180px); }
.field-row:has(.field-narrow:first-child) { grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) minmax(90px, 120px); }
.field-row:has(.field-narrow:first-child):has(> :nth-child(2):last-child) { grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.plist { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.pitem { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.03); }
.pitem-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pitem-main b { font-weight: 500; overflow-wrap: anywhere; }
.pitem .chip { height: 28px; padding: 0 10px; flex: none; }
.pitem-empty { padding: 4px 2px; }

@media (max-width: 900px) { .psum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .psum { padding: 18px 16px; }
  .pcard { padding: 20px 16px; }
  .field-row, .field-row:has(.field-narrow), .field-row:has(.field-narrow:first-child) { grid-template-columns: 1fr; }
  .pitem { flex-wrap: wrap; }
  .ptabs { display: flex; }
  .ptabs button { flex: 1; padding: 0 10px; }
}
:root[data-theme="light"] .psum-item, :root[data-theme="light"] .pitem, :root[data-theme="light"] .ptabs { background: rgba(0,0,0,.025); }
:root[data-theme="light"] .ptabs button[aria-selected="true"] { background: #0a0a0a; color: #fff; }
/* Уровень цели: слова не рвутся посреди («Магистр-атура»), кнопки переносятся целиком */
#goalLevels { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
#goalLevels .choice-chip { overflow-wrap: normal; word-break: normal; hyphens: manual; }
/* Карточка Telegram на телефоне: поле кода сжимается, колонка не шире экрана */
.inline-form input { min-width: 0; }
@media (max-width: 760px) { .tg-cols { grid-template-columns: minmax(0, 1fr); } }

/* ===================== Трекер заявок ===================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.app-new { margin-bottom: 16px; padding: 0; }
.app-new summary { list-style: none; cursor: pointer; padding: 18px 24px; font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.app-new summary::-webkit-details-marker { display: none; }
.app-new summary::before { content: "+"; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--ink); font-weight: 600; transition: transform var(--base) var(--ease); }
.app-new[open] summary::before { transform: rotate(45deg); }
.app-new summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: var(--radius-lg); }
.app-new form { padding: 0 24px 22px; }
.app-quota { margin: 0 0 12px; }
.app-list { display: grid; gap: 14px; }
.app-card { display: grid; gap: 12px; padding: 20px 22px; border-radius: var(--radius-lg); border-left: 3px solid var(--border-strong); }
.app-card--collecting { border-left-color: var(--accent); }
.app-card--submitted, .app-card--waiting { border-left-color: #6aa8ff; }
.app-card--accepted { border-left-color: var(--online); }
.app-card--rejected { border-left-color: var(--danger); opacity: .85; }
.app-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.app-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-title h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.app-status select { min-height: 40px; padding: 0 34px 0 14px; border-radius: var(--pill); border: 1px solid var(--border); background: var(--card-solid); color: var(--fg); color-scheme: dark; font-size: 13px; }
.app-status select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.app-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.app-meta .chip { height: 28px; padding: 0 10px; }
.app-count { font-size: 14px; }
.app-bar { height: 6px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.app-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #31c978, #74edab); transition: width var(--base) var(--ease); }
.app-toggle { justify-self: start; }
.app-body { display: grid; gap: 18px; padding-top: 6px; border-top: 1px solid var(--border); }
.app-section h4 { margin: 12px 0 10px; font-size: 14px; font-weight: 500; color: var(--muted-fg); }
.app-items { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.app-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.025); }
.app-item--overdue { border-color: rgba(239,68,68,.45); background: rgba(239,68,68,.06); }
.app-item--done .app-check span { color: var(--muted-fg); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.3); }
.app-check { display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; }
.app-check input { flex: none; width: 20px; height: 20px; accent-color: var(--brand); }
/* Пункт только что отмечен: галочка «щёлкает», строка коротко подсвечивается цветом бренда и гаснет */
.app-item.just-done .app-check input { animation: pop var(--spring-pop-dur) var(--spring-pop); }
.app-item.just-done { animation: doneGlow .9s ease-out; }
@keyframes doneGlow { from { box-shadow: inset 0 0 0 1px rgba(61,220,132,.55), 0 0 0 4px rgba(61,220,132,.12); } }
.app-check span { overflow-wrap: anywhere; font-size: 14px; }
.app-item-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.app-item-tools .chip { height: 28px; padding: 0 10px; }
.app-item-tools input[type="date"], .app-additem input { min-height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--fg); color-scheme: dark; font: inherit; font-size: 13px; }
.chip.muted-chip { color: var(--muted-fg); border-style: dashed; }
.icon-x { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1px solid var(--border); background: transparent; color: var(--muted-fg); font-size: 18px; line-height: 1; }
.icon-x:hover { color: var(--fg); border-color: var(--border-strong); }
.icon-x:focus-visible, .app-item-tools input:focus-visible, .app-additem input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.app-files { grid-column: 1 / -1; list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.app-file { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.app-file a { color: var(--fg); text-decoration: underline; text-decoration-color: rgba(255,255,255,.3); text-underline-offset: 3px; overflow-wrap: anywhere; }
.app-file .icon-x { width: 26px; height: 26px; font-size: 15px; }
.app-additem { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; }
.app-noupload { margin: 0; }
.app-notes { max-width: none; }
.app-notes textarea { min-height: 80px; }
.app-portal { justify-self: start; align-self: flex-start; }
.check-row { flex-direction: row !important; align-items: flex-start; gap: 10px !important; cursor: pointer; }
.check-row input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--danger); }
.acc-card { border-color: rgba(239,68,68,.3); }
.rem--hot { background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.35); }
/* карточка гранта: кнопка «В заявки» добавила шестую кнопку — ряд переносится, а не обрезается */
.g-actions { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) {
  .app-card { padding: 16px; }
  .app-item { grid-template-columns: 1fr; }
  .app-item-tools { justify-content: flex-start; }
  .app-additem { grid-template-columns: 1fr 1fr; }
  .app-additem input[name="title"] { grid-column: 1 / -1; }
  .app-new summary { padding: 16px; }
  .app-new form { padding: 0 16px 18px; }
}
:root[data-theme="light"] .app-status select, :root[data-theme="light"] .app-item-tools input[type="date"], :root[data-theme="light"] .app-additem input { background: #fff; color: #111; color-scheme: light; }
:root[data-theme="light"] .app-item { background: rgba(0,0,0,.02); }

/* ===================== Шкала профиля по блокам ===================== */
.pscore { margin: 8px 0 18px; padding: 22px 24px; border-radius: var(--radius-lg); display: grid; gap: 12px; }
.pscore-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pscore-top h3 { margin: 0; font-size: 18px; }
.pscore-top h3 b { color: var(--brand); font-weight: 500; }
.pscore-next { margin: 0; font-size: 14px; color: var(--muted-fg); }
.pscore-blocks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.pscore-block button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: baseline; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--fg); text-align: left; transition: border-color var(--fast), background var(--fast); }
.pscore-block button:hover { border-color: var(--border-strong); background: rgba(255,255,255,.06); }
.pscore-block button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pscore-block span { font-size: 13px; }
.pscore-block b { font-weight: 500; font-variant-numeric: tabular-nums; }
.pscore-block i { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: linear-gradient(90deg, #31c978, #74edab) 0 0 / var(--w, 0%) 100% no-repeat, var(--muted); }
.pscore-block small { grid-column: 1 / -1; font-size: 11.5px; color: var(--faint); }
.pscore-block.is-full b { color: var(--brand); }

/* ===================== Готовность к подаче на главной ===================== */
.home-ready { margin-bottom: 14px; padding: 22px 24px; border-radius: var(--radius-lg); display: grid; gap: 12px; }
.ready-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ready-head h3 { margin: 0; font-size: 18px; }
.ready-pct { font-size: 34px; font-weight: 400; letter-spacing: -.03em; color: var(--brand); font-variant-numeric: tabular-nums; }
.ready-parts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ready-parts li { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.03); }
.ready-parts li span { font-size: 13px; } .ready-parts li small { color: var(--faint); }
.ready-parts li b { font-weight: 500; font-variant-numeric: tabular-nums; }
.ready-parts li i { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: linear-gradient(90deg, #31c978, #74edab) 0 0 / var(--w, 0%) 100% no-repeat, var(--muted); }
.ready-empty { margin: 0; font-size: 14.5px; max-width: 640px; }
.ready-hint { margin: 0; font-size: 14px; }
.ready-hint a { margin-left: 6px; font-weight: 500; }
.acc-code { display: grid; gap: 10px; }
.acc-code .btn { justify-self: start; }
@media (max-width: 560px) {
  .pscore, .home-ready { padding: 18px 16px; }
  .ready-parts { grid-template-columns: 1fr; }
  .pscore-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
:root[data-theme="light"] .pscore-block button, :root[data-theme="light"] .ready-parts li { background: rgba(0,0,0,.025); color: #111; }

/* ===================== 3D-наклон к курсору (motion3d.js) ===================== */
/* входная анимация с fill перекрыла бы transform пружины: после неё снимаем её, состояние то же */
.gcard.tilt-live:not(.removing), .tile.tilt-live { animation: none; opacity: 1; }
/* пока пружина ведёт transform, CSS-переход по нему выключен, иначе он запаздывает за каждым кадром */
.is-tilting { transition-property: border-color, background-color, box-shadow !important; will-change: transform; }
.tilt { position: relative; }
.tilt-glare { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.tilt-glare i { position: absolute; left: -360px; top: -360px; width: 720px; height: 720px; opacity: 0;
  background: radial-gradient(closest-side, rgba(255,255,255,.09), transparent 60%); }
.is-tilting .tilt-glare i { will-change: transform, opacity; }
.tilt.is-tilting { border-color: var(--border-strong); box-shadow: var(--edge, 0 0 0 transparent), 0 34px 70px -34px rgba(0,0,0,.95); }
:root[data-theme="light"] .tilt-glare i { background: radial-gradient(closest-side, rgba(255,255,255,.55), transparent 60%); }
:root[data-theme="light"] .tilt.is-tilting { box-shadow: 0 30px 60px -30px rgba(0,0,0,.28); }

/* ---------- Правовые элементы: согласие (№94-V), метка ИИ, достоверность карточек, документы ---------- */
.consent-box { display: grid; gap: .5rem; margin: .75rem 0; }
.consent-check { display: flex !important; gap: .55rem; align-items: flex-start; font-size: .85rem; line-height: 1.4; flex-direction: row !important; }
.consent-check input[type="checkbox"], .consent-check input[type="radio"] { width: 1.05rem; height: 1.05rem; margin-top: .15rem; flex: none; accent-color: currentColor; }
.age-choice { display: grid; gap: .5rem; }
/* Слабые телефоны (класс ставит app.js): без каскада появления карточек и анимаций смены разделов. Стекло и фон не меняются. */
.gh-lite .gcard { animation: none; opacity: 1; transform: none; }
.gh-lite .view, .gh-lite .tile, .gh-lite .dl-list li, .gh-lite .msg { animation: none; }
:root.gh-lite::view-transition-group(*), :root.gh-lite::view-transition-old(*), :root.gh-lite::view-transition-new(*) { animation: none !important; }
.age-note { margin: 0; }
.consent-check a, .footer a, .legal-doc a, .g-verify a { text-decoration: underline; text-underline-offset: 2px; }
.ai-mark { margin: .5rem 0 0; font-size: .75rem; opacity: .7; }
.g-verify { font-size: .75rem; opacity: .75; margin-top: .35rem; overflow-wrap: anywhere; }
.footer-disclaimer { flex-basis: 100%; margin: .5rem 0 0; font-size: .72rem; opacity: .65; line-height: 1.45; }
.footer { flex-wrap: wrap; }
.legal-doc { max-width: 760px; }
.legal-doc h2 { font-size: 1.1rem; margin: 1.6rem 0 .5rem; }
.legal-doc p { line-height: 1.6; margin: .4rem 0; overflow-wrap: anywhere; }
