:root {
  --bg-main: #0d0d0f;
  --bg-card: #17181b;
  --bg-secondary: #222327;
  --bg-elevated: #292a2e;
  --accent: #a6ff00;
  --accent-hover: #b7ff33;
  --accent-dark: #78b800;
  --text-primary: #f2f2f2;
  --text-secondary: #a6a7ab;
  --text-muted: #6e7075;
  --border: #2a2b2f;
  --border-accent: rgba(166, 255, 0, 0.35);
  --error: #ff5252;
  --warning: #ffb84d;
  --success: #a6ff00;
  --radius-card: 18px;
  --radius-btn: 14px;
  --radius-badge: 10px;
  --page-pad: 16px;
  --card-gap: 12px;
  --section-gap: 24px;
  --nav-h: 68px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  background: var(--bg-main);
  color: var(--text-primary);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

#app {
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(var(--page-pad) + var(--safe-top)) var(--page-pad) calc(var(--nav-h) + var(--safe-bottom) + 12px);
}

#app.no-nav {
  padding-bottom: calc(var(--page-pad) + var(--safe-bottom));
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #000;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  font-size: 13px;
}

.brand-logo span:last-child {
  color: var(--accent);
}

.brand-name {
  font-size: 18px;
  font-weight: 700;
}

.brand-x {
  color: var(--accent);
}

h1,
.page-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.back-link {
  align-self: flex-start;
  border: 0;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  padding: 4px 0;
}

.feed-tabs,
.option-list {
  display: flex;
  gap: 8px;
}

.feed-tabs {
  overflow-x: auto;
  padding-bottom: 2px;
}

.feed-tab {
  border: 0;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.feed-tab.active {
  background: var(--accent);
  color: var(--bg-main);
}

.vacancy-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vacancy-card--unavailable {
  opacity: 0.72;
}

.vacancy-card--loading {
  min-height: 220px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.match-badge {
  background: var(--accent);
  color: var(--bg-main);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 6px 9px;
  border-radius: var(--radius-badge);
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

.match-badge--hidden {
  background: var(--bg-secondary);
  color: transparent;
  min-width: 86px;
}

.freshness-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.freshness-badge.accent {
  color: var(--accent);
}

.freshness-badge.white {
  color: var(--text-primary);
}

.freshness-badge.muted {
  color: var(--text-secondary);
}

.vacancy-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.vacancy-salary {
  font-size: 20px;
  font-weight: 650;
}

.job-meta,
.vacancy-company {
  font-size: 14px;
  color: var(--text-secondary);
}

.skill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.skill-chip {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--radius-badge);
  padding: 5px 9px;
  font-size: 12px;
}

.match-accordion {
  border: 0;
  background: none;
  text-align: left;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
}

.match-accordion .icon {
  color: var(--accent);
}

.match-reasons {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 2px;
}

.match-reasons.open {
  display: flex;
}

.reason-row,
.warn-row {
  display: flex;
  gap: 8px;
  font-size: 14px;
  line-height: 1.35;
}

.reason-row {
  color: var(--text-primary);
}

.reason-row .icon {
  color: var(--accent);
  flex-shrink: 0;
}

.warn-row {
  color: var(--warning);
}

.plus-upsell {
  margin-top: 8px;
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-card);
}

.plus-upsell-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.plus-upsell .empty-hint {
  margin-bottom: 12px;
}

.btn-primary,
.btn-secondary,
.btn-outline,
.btn {
  border: 0;
  border-radius: var(--radius-btn);
  min-height: 52px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  width: 100%;
}

.btn-primary,
.btn.btn-primary {
  background: var(--accent);
  color: var(--bg-main);
}

.btn-secondary,
.btn.btn-secondary {
  min-height: 48px;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-outline,
.btn.btn-outline {
  min-height: 48px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.cta-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.cta-row .btn-primary {
  flex: 1;
}

.fav-btn {
  width: 52px;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.fav-btn--active {
  color: var(--accent);
  border-color: var(--border-accent);
}

.feedback-block {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.feedback-title {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.feedback-actions {
  display: flex;
  gap: 8px;
}

.feedback-actions .btn-secondary {
  min-height: 42px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 8px 10px var(--safe-bottom);
  background: rgba(13, 13, 15, 0.94);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 20;
  backdrop-filter: blur(12px);
}

.nav-item {
  border: 0;
  background: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
}

.nav-item.active {
  color: var(--accent);
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.loader-box,
.empty-state,
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 48px 8px 24px;
}

.loader-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 5px solid var(--bg-secondary);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.loader-text,
.empty-title {
  font-size: 20px;
  font-weight: 700;
}

.loader-sub,
.empty-hint {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 320px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.search-card,
.profile-card,
.plus-card,
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
}

.search-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

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

.search-row .label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.search-row .value {
  font-size: 16px;
  font-weight: 600;
  text-align: right;
}

.ai-box {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-box textarea,
.text-input,
.text-area {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: var(--radius-btn);
  padding: 12px 14px;
  min-height: 48px;
  color: var(--text-primary);
}

.text-area,
.ai-box textarea {
  min-height: 96px;
  resize: vertical;
}

.parsed-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.parsed-row.uncertain .value {
  color: var(--warning);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nx-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #000;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
  font-size: 18px;
}

.nx-avatar span:last-child {
  color: var(--accent);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(166, 255, 0, 0.16);
  color: var(--accent);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  letter-spacing: 0.04em;
}

.menu-row {
  width: 100%;
  border: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
}

.menu-row--muted {
  color: var(--text-secondary);
}

.switch {
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: var(--bg-elevated);
  position: relative;
  flex-shrink: 0;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-primary);
}

.switch.on {
  background: var(--accent);
}

.switch.on::after {
  left: 23px;
  background: var(--bg-main);
}

.switch.disabled {
  opacity: 0.45;
}

.plus-card {
  border-color: var(--border-accent);
  box-shadow: 0 0 24px rgba(166, 255, 0, 0.08);
}

.plus-price {
  font-size: 32px;
  font-weight: 700;
}

.plus-recurring {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 4px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.check-row input {
  margin-top: 3px;
  accent-color: var(--accent);
}

.doc-link {
  color: var(--accent);
  text-decoration: underline;
}

.btn-primary:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pay-overlay {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: center;
}

.plus-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.bottom-sheet {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bottom-sheet-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  padding: 16px 16px calc(16px + var(--safe-bottom));
}

.reason-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.reason-chip {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}

.reason-chip.selected {
  border-color: var(--accent);
  color: var(--accent);
}

.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: -2px;
}

.icon-lg {
  width: 22px;
  height: 22px;
}

.step-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
}

.step-dot.active,
.step-dot.done {
  background: var(--accent);
  color: var(--bg-main);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
}

.step-indicator {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.option-list {
  flex-direction: column;
}

.option-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.option-item.selected {
  border-color: var(--accent);
}

.option-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--bg-main);
  background: transparent;
  font-size: 12px;
}

.option-item.selected .option-check {
  background: var(--accent);
  border-color: var(--accent);
}

.selection-hint,
.current-filter-hint {
  color: var(--text-secondary);
  font-size: 14px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 600;
}

.faq-answer {
  display: none;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.faq-item--open .faq-answer {
  display: block;
}

.badge-unavailable {
  align-self: flex-start;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 8px;
  font-size: 12px;
  padding: 4px 8px;
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary), var(--bg-elevated), var(--bg-secondary));
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
  border-radius: 8px;
  height: 14px;
}

.feed-tab,
.btn-primary,
.btn-secondary,
.fav-btn,
.match-accordion,
.reason-chip,
.nav-item {
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
