@font-face {
  font-family: 'Site Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/site-sans-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: 'Site Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/site-sans-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Site Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/site-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Site Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/static/fonts/site-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f2f0e8;
  --surface: #fbfaf5;
  --surface-2: #e9e6dc;
  --ink: #171814;
  --muted: #65675e;
  --faint: #8d9085;
  --line: #d5d7cc;
  --accent: #3157f5;
  --acid: #d9ff45;
  --acid-ink: #161b08;
  --good: #14735b;
  --warn: #8a6a1f;
  --warn-bg: #fdf6d9;
  --gap-bg: #f4eee6;
  --gap-ink: #8a6a4a;
  --radius: 16px;
  --radius-lg: 24px;
}

html[data-theme="dark"] {
  --bg: #151613;
  --surface: #1d1f1a;
  --surface-2: #262922;
  --ink: #f0f1e8;
  --muted: #a4a89b;
  --faint: #85897c;
  --line: #343830;
  --accent: #8ba2ff;
  --acid: #c9f444;
  --acid-ink: #101507;
  --good: #6fd0b0;
  --warn: #e0c26a;
  --warn-bg: #2b2718;
  --gap-bg: #2a251f;
  --gap-ink: #c2a98e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.55 'Site Sans', system-ui, sans-serif;
}

.feed-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.feed-page > main { flex: 1 0 auto; }

button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.shell { width: min(1360px, calc(100% - 40px)); margin: 0 auto; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Шапка */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner { display: flex; align-items: center; gap: 16px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
  width: 32px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--acid);
  color: var(--acid-ink);
  transform: rotate(-8deg);
}
.beta-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 7px;
  background: #d92d20;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
}

.topbar-spacer { margin-left: auto; }
.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  border-radius: 12px;
  color: var(--muted);
}

.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { color: var(--ink); border-color: var(--faint); }
.header-stats { display: flex; align-items: center; gap: 6px; }
.header-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 42px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  line-height: 1.05;
}
.header-stat-month { background: var(--acid); border-color: transparent; color: var(--acid-ink); }
.header-stat-day { background: var(--surface); }
.header-stat-hour { background: var(--surface-2); }
.header-stat-value { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.header-stat-label { margin-top: 3px; font-size: 10px; color: var(--muted); }
.header-stat-month .header-stat-label { color: var(--acid-ink); }

/* Герой: муха слева, заголовок и поиск справа */
.hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  padding: 28px 0 22px;
}
.hero-fly { line-height: 0; }
.hero-fly img { display: block; height: clamp(84px, 9vw, 116px); width: auto; }
.hero-main { min-width: 0; }
.hero-main h1 { margin: 0; font-size: clamp(20px, 2.72vw, 34.4px); line-height: 1.08; letter-spacing: -.045em; }
.hero-description { margin: 7px 0 16px; color: var(--muted); font-size: 14px; }
.search-form { display: flex; width: 100%; align-items: stretch; gap: 8px; }
.search-field {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 0 14px;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 8%, transparent);
}
.search-field svg { width: 19px; height: 19px; flex: none; color: var(--muted); }
.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 8px 0;
  font-size: 15px;
}
.search-field:focus-within { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.search-submit {
  flex: none;
  border: 0;
  border-radius: 14px;
  padding: 0 23px;
  background: var(--accent);
  color: var(--surface);
  font-weight: 800;
  cursor: pointer;
}
.search-submit:hover { filter: brightness(.94); }
.hero-main .chip-row { justify-content: center; padding: 14px 0 0; }
/* Панель фильтров */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 18px; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip em { font-style: normal; color: var(--faint); margin-left: 6px; font-weight: 500; }
.chip[aria-pressed="true"] em { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.layout { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 20px; }
.filters {
  position: sticky;
  top: 82px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 20px;
}

.filters h2 { margin: 0; font-size: 15px; }
.filters-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.text-btn { border: 0; background: none; cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 600; padding: 0; }
.group { border-top: 1px solid var(--line); padding: 14px 0 4px; }
.group:first-of-type { border-top: 0; padding-top: 0; }
#channelGroup { display: none; }
.group-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}

.option { display: flex; align-items: center; gap: 9px; padding: 5px 0; cursor: pointer; font-size: 14px; }
.option input { accent-color: var(--accent); width: 16px; height: 16px; }
.option small { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; }

/* Лента */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.result-count strong { font-size: 20px; font-weight: 800; }
.toolbar select { margin-left: auto; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 12px; }
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line));
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 18px;
  font-size: 13.5px;
}

.notice b { color: inherit; }
.new-pill {
  display: block;
  margin: 0 auto 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 999px;
  padding: 7px 14px;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.new-pill:hover { border-color: var(--accent); }
.new-pill:disabled { cursor: wait; opacity: .6; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 20px 22px;
  margin-bottom: 14px;
}

.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.source { font-weight: 700; color: var(--ink); }
.dot { color: var(--line); }
.published { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.badges { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 12px; }
.badge { border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 700; background: var(--surface-2); }
.badge-lang { background: var(--acid); color: var(--acid-ink); }
.badge-fact { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.badge-gap {
  background: var(--gap-bg);
  color: var(--gap-ink);
  font-weight: 600;
  border: 1px dashed color-mix(in srgb, var(--gap-ink) 40%, transparent);
}

.badge-raw { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; max-width: 100%; overflow-wrap: anywhere; }
.message { position: relative; }
.message pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.55; color: var(--muted); }
.message a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.message a.contact { font-weight: 700; text-decoration-style: dotted; }
.message.folded pre { max-height: calc(4 * 1.55em); overflow: hidden; }
.message.folded.foldable::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 3em;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--surface));
}

.fold-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.fold-button svg { width: 15px; transition: transform .18s ease; }
.card.expanded .fold-button svg { transform: rotate(180deg); }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 13px; }
.card-actions { display: inline-flex; align-items: center; gap: 14px; margin-left: auto; }
.card-telegram-link { white-space: nowrap; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 44px; text-align: center; color: var(--muted); }
.feed-more { display: flex; align-items: center; gap: 12px; margin: 20px 0; }
.feed-more button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  background: var(--surface);
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.feed-more button:hover { border-color: var(--accent); }
.feed-more button:disabled { cursor: wait; opacity: .6; }
#shown { color: var(--faint); font-variant-numeric: tabular-nums; }

/* Страница вакансии */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 26px 0 18px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  color: var(--accent);
  font-weight: 700;
}

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; padding-bottom: 70px; }
.detail-main, .detail-aside { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.detail-main { padding: 28px 32px; }
.detail-main pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; }
.detail-main a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.detail-main a.contact { font-weight: 700; text-decoration-style: dotted; }
.detail-aside { position: sticky; top: 82px; padding: 8px 22px 20px; }
.detail-fact { padding: 14px 0; border-top: 1px solid var(--line); }
.detail-fact:first-child { border-top: 0; }
.detail-fact span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.detail-fact strong { display: block; margin-top: 4px; font-weight: 600; overflow-wrap: anywhere; }
.detail-fact strong.gap { color: var(--gap-ink); font-weight: 500; }
.detail-source { display: block; margin-top: 16px; font-weight: 700; }

.public-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 17px 24px;
  color: var(--muted);
  font-size: 13px;
}

.public-footer a { color: inherit; text-underline-offset: 3px; }
.public-footer a:hover { color: var(--accent); }

.legal-page { min-height: 100vh; }
.legal-main { max-width: 820px; padding-top: 42px; padding-bottom: 24px; }
.legal-main h1 { margin-bottom: 12px; }
.legal-main h2 { margin: 30px 0 10px; font-size: 19px; }
.legal-main p, .legal-main li { line-height: 1.65; }
.legal-main ul { padding-left: 22px; }
.legal-main a { color: var(--accent); }
.legal-note { color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-aside { position: static; }
  .layout { grid-template-columns: 1fr; }
  .filters { position: static; }
}

@media (max-width: 640px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 20px; }
  .hero-fly { justify-self: center; }
  .hero-fly img { height: 72px; }
  .hero-main { width: 100%; }
  .hero-main h1 { text-align: center; }
  .search-submit { padding-inline: 18px; }
}

@media (max-width: 480px) {
  .topbar-inner { flex-wrap: wrap; gap: 8px; padding: 8px 0; }
  .topbar-spacer { display: none; }
  .icon-btn { order: 2; margin-left: auto; }
  .header-stats { order: 3; flex: 1 0 100%; justify-content: center; }
}
