
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #1c2230;
  --ink-soft: #5b6472;
  --line: #e4e7ec;
  --accent: #2f6fed;
  --accent-ink: #ffffff;
  --accent-soft: #eaf1ff;
  --danger: #e14b4b;
  --success: #1a8a4a;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20,25,40,.06), 0 8px 24px -12px rgba(20,25,40,.12);
}

html[data-theme="dark"] {
  --bg: #12151c;
  --panel: #1a1f29;
  --ink: #eef1f6;
  --ink-soft: #9aa4b2;
  --line: #2a3140;
  --accent: #5b8cff;
  --accent-ink: #ffffff;
  --accent-soft: #202a45;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}

a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: 1360px; margin: 0 auto; padding: 0 24px; }

/* -------- Navbar -------- */
.navbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 18px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #7aa8ff); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 15px; }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft); text-decoration: none; }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }

.nav-menu { display: flex; align-items: center; gap: 22px; margin-left: 8px; }
.nav-menu a { font-size: 14.5px; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.nav-menu a:hover, .nav-menu a.active { color: var(--accent); }

.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); display: flex; align-items: center; justify-content: center; color: var(--ink-soft); flex-shrink: 0; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }

.lang-switch { position: relative; }
.lang-switch-btn { display: flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; text-transform: uppercase; }
.lang-switch-btn:hover { border-color: var(--accent); color: var(--accent); }
.lang-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 130px; display: none; z-index: 60; overflow: hidden; }
.lang-menu.show { display: block; }
.lang-menu a, .lang-menu button { display: block; text-decoration: none; width: 100%; text-align: left; padding: 9px 14px; background: none; border: none; font-size: 13.5px; color: var(--ink); }
.lang-menu a.active { font-weight: 700; color: var(--accent); }
.lang-menu a:hover, .lang-menu button:hover { background: var(--accent-soft); color: var(--accent); }

.mobile-menu-btn { display: none; }
@media (max-width: 860px) {
  .nav-menu { display: none; }
  .mobile-menu-btn { display: flex; }
}

/* -------- User dropdown (desktop) -------- */
.user-dropdown { position: relative; }
.user-dropdown-trigger { border: none; background: none; cursor: pointer; padding: 4px 6px; border-radius: 20px; }
.user-dropdown-trigger:hover { background: var(--accent-soft); }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.user-dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 180px; padding: 6px; display: none; z-index: 70;
}
.user-dropdown-menu.show { display: block; }
.user-dropdown-menu a, .user-dropdown-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 9px 10px;
  border-radius: 8px; border: none; background: none; font-size: 13.5px; font-weight: 600; color: var(--ink);
  text-decoration: none; cursor: pointer;
}
.user-dropdown-menu a:hover, .user-dropdown-menu button:hover { background: var(--accent-soft); color: var(--accent); }

/* -------- Mobile drawer menu -------- */
.mobile-drawer-overlay {
  position: fixed; inset: 0; background: rgba(20,25,40,.45); z-index: 190; opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.mobile-drawer-overlay.show { opacity: 1; pointer-events: auto; }
.mobile-drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 82%; max-width: 320px; background: var(--panel);
  z-index: 200; transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column;
  box-shadow: -8px 0 24px rgba(0,0,0,.15);
}
.mobile-drawer.show { transform: translateX(0); }
.mobile-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.mobile-drawer-title { font-weight: 800; font-family: 'Sora', sans-serif; }
.mobile-drawer-close { border: none; background: none; color: var(--ink-soft); padding: 4px; }
.mobile-drawer-links { display: flex; flex-direction: column; padding: 10px; gap: 2px; }
.mobile-drawer-links a { padding: 12px 10px; border-radius: 9px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14.5px; }
.mobile-drawer-links a:hover, .mobile-drawer-links a.active { background: var(--accent-soft); color: var(--accent); }
.mobile-drawer-foot { margin-top: auto; padding: 14px 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.mobile-drawer-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px 14px; }
.mobile-drawer-user .user-avatar { width: 36px; height: 36px; }
.mobile-drawer-user span { font-weight: 700; font-size: 14px; }
.mobile-drawer-link { padding: 11px 10px; border-radius: 9px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 14px; text-align: left; border: none; background: none; cursor: pointer; width: 100%; }
.mobile-drawer-link:hover { background: var(--accent-soft); color: var(--accent); }
.mobile-drawer-logout { color: var(--danger); }

/* -------- Footer -------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0; color: var(--ink-soft); font-size: 13.5px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--accent); }
.footer-contact-email { color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 13.5px; }
.footer-contact-email:hover { color: var(--accent); }
.header-contact-email { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; padding: 7px 12px; border-radius: 999px; color: var(--ink-soft); text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap; transition: color .2s, background .2s; }
.header-contact-email svg { flex-shrink: 0; opacity: .8; }
.header-contact-email:hover { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 1180px) { .header-contact-email span { display: none; } .header-contact-email { padding: 8px; } }
@media (max-width: 860px) { .header-contact-email { display: none !important; } .header-contact-email + .nav-actions { margin-left: auto !important; } }

/* -------- Ad slots -------- */
.ad-slot { display: flex; align-items: center; justify-content: center; min-height: 90px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--ink-soft); font-size: 12.5px; overflow: hidden; }
.ad-slot:empty::before { content: 'Рекламный блок'; }
.ad-slot.ad-empty { display: none; }

/* -------- Homepage -------- */
.hero { padding: 64px 0 40px; }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero-title { font-family: 'Sora', sans-serif; font-size: 42px; line-height: 1.15; margin: 0 0 18px; font-weight: 800; }
.hero-subtitle { font-size: 16px; color: var(--ink-soft); margin: 0 0 28px; max-width: 480px; }
.hero-image-wrap { position: relative; }
.hero-image-wrap img { width: 100%; border-radius: 18px; box-shadow: var(--shadow); display: block; }
.hero-image-fallback { width: 100%; aspect-ratio: 4/3; border-radius: 18px; background: linear-gradient(135deg, var(--accent-soft), #fff); display: flex; align-items: center; justify-content: center; font-family: 'Sora', sans-serif; font-weight: 800; font-size: 60px; color: var(--accent); box-shadow: var(--shadow); }

.section { padding: 46px 0; }
.section-title { font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 800; margin: 0 0 8px; text-align: center; }
.section-subtitle { text-align: center; color: var(--ink-soft); font-size: 15px; margin: 0 0 32px; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.feature-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.feature-card h3 { margin: 0 0 6px; font-size: 16px; }
.feature-card p { margin: 0; color: var(--ink-soft); font-size: 14px; }

.template-showcase { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.template-showcase-card { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.template-showcase-card .template-swatch { height: 110px; margin: 0; border-radius: 0; }
.template-showcase-card span { display: block; text-align: center; padding: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); background: var(--panel); }

.about-block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px; text-align: center; max-width: 720px; margin: 0 auto; }
.about-block h2 { margin: 0 0 12px; font-family: 'Sora', sans-serif; }
.about-block p { color: var(--ink-soft); font-size: 15px; margin: 0; }

.cta-band { background: linear-gradient(120deg, var(--accent), #6f9dff); border-radius: 20px; padding: 44px; text-align: center; color: #fff; }
.cta-band h2 { margin: 0 0 10px; font-family: 'Sora', sans-serif; font-size: 26px; }
.cta-band p { margin: 0 0 22px; opacity: .92; }
.cta-band .btn-primary { background: #fff; color: var(--accent); }
.cta-band .btn-primary:hover { background: #eef2ff; }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-title { font-size: 32px; }
  .feature-grid { grid-template-columns: 1fr; }
  .template-showcase { grid-template-columns: repeat(3, 1fr); }
}

/* -------- Recommendation callout (builder) -------- */
.tip-box { background: var(--accent-soft); border: 1px solid #d3e3ff; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--ink); margin: 0 18px 16px; display: flex; gap: 10px; }
html[data-theme="dark"] .tip-box { border-color: #2c3a63; }
.tip-box svg { flex-shrink: 0; color: var(--accent); margin-top: 1px; }

/* -------- Social links repeater -------- */
.social-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.social-row select { flex: 0 0 130px; }
.social-row input { flex: 1; }

/* -------- Download modal / format choice -------- */
.format-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.format-choice button { border: 2px solid var(--line); background: var(--panel); border-radius: 12px; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ink); }
.format-choice button:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.format-choice svg { color: var(--accent); }

/* -------- Buttons -------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 9px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; text-decoration: none; transition: transform .05s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #245cd0; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); }
.btn-danger { background: #fff; color: var(--danger); border-color: #f3c9c9; }
.btn-danger:hover { background: #fdecec; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }

/* -------- Layout -------- */
.builder-layout {
  display: grid;
  grid-template-columns: minmax(360px, 480px) 1fr;
  gap: 24px;
  padding: 24px 0 60px;
  align-items: start;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-panel { padding: 6px; max-height: calc(100vh - 96px); overflow-y: auto; position: sticky; top: 80px; }
.preview-col { position: sticky; top: 80px; }

/* -------- Mobile tabs -------- */
.mobile-tabs { display: none; gap: 8px; padding: 10px 0; }
.mobile-tabs button { flex: 1; padding: 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.mobile-tabs button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* -------- Steps / sections -------- */
.step {
  border-bottom: 1px solid var(--line);
}
.step:last-child { border-bottom: none; }
.step-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; user-select: none; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-title { font-weight: 700; font-size: 15px; flex: 1; }
.step-chevron { color: var(--ink-soft); transition: transform .2s ease; }
.step.open .step-chevron { transform: rotate(180deg); }
.step-body { padding: 0 18px 20px; display: none; }
.step.open .step-body { display: block; }

/* -------- Form fields -------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fbfbfc;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.field textarea { resize: vertical; min-height: 70px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); margin: -4px 0 12px; }

.repeat-item { border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: #fbfbfc; position: relative; }
.repeat-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.repeat-item-head span { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .4px; }
.remove-btn { border: none; background: none; color: var(--ink-soft); font-size: 13px; padding: 2px 6px; border-radius: 6px; }
.remove-btn:hover { color: var(--danger); background: #fdecec; }

.add-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border: none; padding: 8px 14px; border-radius: 8px; }
.add-btn:hover { background: #dce9ff; }

.tag-input-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tag-chip { display: flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent); padding: 6px 10px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.tag-chip button { border: none; background: none; color: inherit; font-size: 14px; line-height: 1; padding: 0; }
.tag-input-wrap input { border: none; background: transparent; flex: 1; min-width: 120px; padding: 6px 2px; font-size: 14px; }
.tag-input-wrap input:focus { outline: none; }

/* -------- Photo uploader -------- */
.photo-uploader { display: flex; align-items: center; gap: 14px; }
.photo-preview { width: 72px; height: 72px; border-radius: 50%; background: var(--accent-soft); overflow: hidden; display: flex; align-items: center; justify-content: center; color: var(--accent); font-weight: 700; font-size: 22px; flex-shrink: 0; border: 1px solid var(--line); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* -------- Template picker -------- */
.template-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px 18px; }
.template-card { border: 2px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; background: #fff; cursor: pointer; }
.template-card.active { border-color: var(--accent); background: var(--accent-soft); }
.template-card span { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.template-card.active span { color: var(--accent); }

/* Живое мини-превью: настоящая уменьшенная вёрстка резюме, а не картинка —
   всегда соответствует шаблону 1-в-1, включая пользовательские шаблоны. */
.template-preview-mini {
  position: relative;
  width: 100%;
  aspect-ratio: 794 / 1123;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  pointer-events: none; /* клики всегда идут в карточку-кнопку, не в ссылки резюме */
}
.template-preview-mini .mini-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 794px;
  transform-origin: top left;
  box-shadow: none !important;
}

.template-showcase-card .template-preview-mini { border-radius: 10px 10px 0 0; border: none; }

/* -------- Preview toolbar -------- */
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: 10px; }
.resume-lang-picker { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; color: var(--ink-soft); background: var(--panel); }
.resume-lang-picker select { border: none; background: transparent; font-size: 13px; font-weight: 600; color: var(--ink); padding: 0; outline: none; }
.zoom-controls { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 13px; }
.preview-frame-outer { padding: 28px; overflow: auto; max-height: calc(100vh - 170px); display: flex; justify-content: center; background: #eef0f3; border-radius: 0 0 var(--radius) var(--radius); }
.preview-shadow { box-shadow: 0 4px 24px rgba(20,25,40,.14); }

/* -------- Auth pages -------- */
.auth-wrap { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; font-family: 'Sora', sans-serif; }
.auth-card p.sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 24px; }
.auth-msg { font-size: 13.5px; padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; display: none; }
.auth-msg.error { display: block; background: #fdecec; color: var(--danger); }
.auth-msg.ok { display: block; background: #eafaf0; color: #1a8a4a; }
.auth-switch { text-align: center; font-size: 13.5px; color: var(--ink-soft); margin-top: 18px; }
.auth-switch a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* -------- Dashboard -------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; padding: 24px 0 60px; }
.dash-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.dash-card-thumb { height: 130px; background: linear-gradient(135deg, var(--accent-soft), #fff); display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 34px; font-weight: 800; font-family:'Sora',sans-serif; }
.dash-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.dash-card-title { font-weight: 700; font-size: 15px; }
.dash-card-meta { font-size: 12.5px; color: var(--ink-soft); }
.dash-card-actions { display: flex; gap: 8px; padding: 0 16px 16px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }

/* -------- Toast -------- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: #1c2230; color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 200; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* -------- Modal -------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,25,40,.45); display: none; align-items: center; justify-content: center; z-index: 150; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal-box { background: #fff; border-radius: var(--radius); padding: 26px; max-width: 380px; width: 100%; box-shadow: var(--shadow); }
.modal-box h3 { margin: 0 0 8px; font-size: 17px; }
.modal-box p { margin: 0 0 18px; font-size: 14px; color: var(--ink-soft); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* -------- Profile page -------- */
.profile-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; padding: 28px 0 60px; align-items: start; }
.profile-side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; text-align: center; position: sticky; top: 80px; }
.profile-avatar { width: 76px; height: 76px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 28px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-actions { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.profile-side h3 { margin: 0 0 2px; font-size: 15px; }
.profile-side p { margin: 0; font-size: 12.5px; color: var(--ink-soft); word-break: break-all; }
.profile-tabs { margin-top: 20px; display: flex; flex-direction: column; gap: 4px; }
.profile-tabs button { text-align: left; padding: 9px 12px; border-radius: 8px; border: none; background: none; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.profile-tabs button.active, .profile-tabs button:hover { background: var(--accent-soft); color: var(--accent); }
.profile-main { display: flex; flex-direction: column; gap: 20px; }
.profile-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.profile-card h3 { margin: 0 0 16px; font-size: 16px; }

/* -------- Admin panel -------- */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.admin-brand { font-family: 'Sora', sans-serif; font-weight: 800; font-size: 16px; padding: 6px 10px 20px; display:block; }
.admin-nav button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 9px; border: none; background: none; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 2px; }
.admin-nav button.active, .admin-nav button:hover { background: var(--accent-soft); color: var(--accent); }
.admin-main { padding: 28px 34px; max-width: 980px; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-section h2 { font-family: 'Sora', sans-serif; font-size: 22px; margin: 0 0 20px; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.admin-card h4 { margin: 0 0 14px; font-size: 14.5px; }
.admin-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.admin-toggle-row:last-child { border-bottom: none; }
.admin-toggle-row span { font-size: 13.5px; }

.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 20px; transition: .15s; cursor: pointer; }
.switch .track::before { content:''; position:absolute; width:18px; height:18px; left:3px; top:3px; background:#fff; border-radius:50%; transition:.15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::before { transform: translateX(18px); }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.admin-table th { text-align: left; padding: 10px 12px; color: var(--ink-soft); font-weight: 600; border-bottom: 1px solid var(--line); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
table.admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.admin-table select { padding: 5px 8px; font-size: 13px; }

.template-admin-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.template-admin-row:last-child { border-bottom: none; }
.template-admin-row .template-swatch { width: 60px; height: 40px; margin: 0; flex-shrink: 0; }
.template-admin-row .t-name { flex: 1; font-weight: 600; font-size: 13.5px; }
.template-admin-row .t-badge { font-size: 12px; background: var(--accent-soft); color: var(--accent); padding: 2px 8px; border-radius: 10px; font-weight: 700; }

/* -------- Tool pages (converter / compressor / pdf-tools) -------- */
.tool-hero { text-align: center; padding: 40px 0 10px; }
.tool-hero h1 { font-family: 'Sora', sans-serif; font-size: 30px; margin: 0 0 10px; }
.tool-hero p { color: var(--ink-soft); font-size: 15px; max-width: 560px; margin: 0 auto; }

.tool-tabs { display: flex; justify-content: center; gap: 8px; margin: 24px 0; flex-wrap: wrap; }
.tool-tabs button { padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 13.5px; color: var(--ink-soft); }
.tool-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.dropzone {
  border: 2px dashed var(--line); border-radius: 16px; background: var(--panel);
  padding: 44px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { color: var(--accent); margin-bottom: 12px; }
.dropzone .dz-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.dropzone .dz-sub { font-size: 13px; color: var(--ink-soft); }

.file-chip-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.file-chip {
  display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; cursor: grab; touch-action: none; user-select: none;
}
.file-chip.dragging { opacity: .4; }
.file-chip.drop-target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.file-chip .drag-handle { color: var(--ink-soft); flex-shrink: 0; }
.file-chip .fc-index { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-chip .fc-name { flex: 1; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .fc-size { font-size: 12px; color: var(--ink-soft); flex-shrink: 0; }
.file-chip .fc-remove { border: none; background: none; color: var(--ink-soft); font-size: 15px; padding: 2px 6px; flex-shrink: 0; }
.file-chip .fc-remove:hover { color: var(--danger); }

.tool-result-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; text-align: center; margin-top: 20px; }
.tool-result-card .size-compare { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 14px 0; font-size: 14px; }
.tool-result-card .size-compare .arrow { color: var(--ink-soft); }
.tool-result-card .size-old { color: var(--ink-soft); text-decoration: line-through; }
.tool-result-card .size-new { font-weight: 800; color: var(--success); font-size: 18px; }
.tool-result-card .savings-badge { display: inline-block; background: #eafaf0; color: var(--success); font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: 12px; margin-left: 6px; }

.progress-bar-wrap { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 16px 0; }
.progress-bar-fill { height: 100%; background: var(--accent); width: 0%; transition: width .2s ease; }

.range-input-row { display: flex; align-items: center; gap: 12px; }
.range-input-row input[type="range"] { flex: 1; }
.range-input-row .range-value { font-weight: 700; font-size: 13.5px; width: 44px; text-align: right; }

.tool-note { font-size: 12.5px; color: var(--ink-soft); background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; margin-top: 14px; }
.tool-note.warn { background: #fff4e0; color: #8a5a00; }
html[data-theme="dark"] .tool-note.warn { background: #3a2f10; color: #ffcf7a; }

/* -------- PDF page/file thumbnail grid (merge & split) -------- */
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 16px; }
.thumb-card {
  position: relative; border: 2px solid var(--line); border-radius: 10px; background: var(--panel);
  overflow: hidden; cursor: pointer; touch-action: none; user-select: none; transition: border-color .15s;
}
.thumb-card canvas { display: block; width: 100%; height: auto; background: #fff; }
.thumb-card .thumb-placeholder { aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center; background: #f1f3f6; color: var(--ink-soft); font-size: 12px; }
.thumb-card .thumb-label { padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--ink-soft); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid var(--line); }
.thumb-card .thumb-index { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(20,25,40,.65); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.thumb-card .thumb-remove { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(20,25,40,.65); color: #fff; border: none; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.thumb-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.thumb-card .thumb-check {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255,255,255,.85); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: transparent;
}
.thumb-card.selected .thumb-check { background: var(--accent); border-color: var(--accent); color: #fff; }
.thumb-card.dragging { opacity: .35; }
.thumb-add-card {
  aspect-ratio: 3/4; border: 2px dashed var(--line); border-radius: 10px; display: flex; align-items: center;
  justify-content: center; color: var(--ink-soft); background: var(--panel); cursor: pointer;
}
.thumb-add-card:hover { border-color: var(--accent); color: var(--accent); }

.split-mode-tabs { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.split-mode-tab { padding: 8px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); font-weight: 700; font-size: 13px; color: var(--ink-soft); }
.split-mode-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.split-mode-hint { font-size: 12.5px; color: var(--ink-soft); margin: 12px 0 0; }

.ocr-mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.ocr-mode-card { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; background: var(--panel); }
.ocr-mode-card input { margin-top: 3px; accent-color: var(--accent); flex-shrink: 0; }
.ocr-mode-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ocr-mode-title { font-weight: 700; font-size: 13.5px; margin-bottom: 3px; }
.ocr-mode-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.4; }
@media (max-width: 760px) { .ocr-mode-grid { grid-template-columns: 1fr; } }

@media (max-width: 640px) {
  .tool-hero h1 { font-size: 24px; }
  .dropzone { padding: 30px 16px; }
}
@media (max-width: 980px) {
  .builder-layout { grid-template-columns: 1fr; }
  .mobile-tabs { display: flex; }
  .form-panel, .preview-col { position: static; max-height: none; }
  .form-panel.hide-mobile, .preview-col.hide-mobile { display: none; }
  .template-picker { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .container { padding: 0 14px; }
  .field-row { grid-template-columns: 1fr; }
  .navbar-inner { height: 58px; }
  .brand span.brand-text { display: none; }
  .auth-card { padding: 24px; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-side { position: static; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; display: flex; overflow-x: auto; gap: 4px; }
  .admin-nav { display: flex; gap: 4px; }
  .admin-main { padding: 20px 16px; }
  .admin-grid { grid-template-columns: 1fr; }
  .format-choice { grid-template-columns: 1fr; }
  .template-showcase { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Подвал (серверный, с ссылками на все страницы) ---------- */
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 0.8fr; gap: 28px; align-items: start; }
.footer-brand { font-weight: 800; color: var(--ink); font-size: 16px; margin-bottom: 8px; }
.footer-text { margin: 0 0 8px; line-height: 1.55; }
.footer-contact a { color: var(--accent); text-decoration: none; font-weight: 600; }
.footer-links-col, .footer-langs { display: flex; flex-direction: column; gap: 9px; }
.footer-links-col a, .footer-langs a { color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.footer-links-col a:hover, .footer-langs a:hover, .footer-langs a.active { color: var(--accent); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > .footer-col:first-child { grid-column: 1 / -1; } }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: 10px; max-width: 820px; margin: 0 auto; }
.faq-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.faq-item summary { cursor: pointer; font-weight: 700; color: var(--ink); list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; color: var(--accent); font-weight: 800; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin: 10px 0 0; color: var(--ink-soft); line-height: 1.6; }

/* ---------- Разрыв страниц в предпросмотре резюме ---------- */
.page-break-marker { position: absolute; left: -12px; right: -12px; height: 0; border-top: 2px dashed rgba(220, 60, 60, 0.55); pointer-events: none; z-index: 5; }
.page-break-marker span { position: absolute; right: 0; top: -11px; background: #dc3c3c; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; font-family: system-ui, sans-serif; }
.breadcrumbs { font-size: 13px; color: var(--ink-soft); margin: 14px 0 0; }
.breadcrumbs a { color: var(--ink-soft); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.about-grid { display:grid; grid-template-columns: 1fr 300px; gap:24px; align-items:start; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.field-hint { width: 100%; font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
h2.step-title { margin: 0; color: var(--ink); }
.admin-hint { font-size: 13px; color: var(--ink-soft); line-height: 1.55; margin: 0 0 14px; }
.bulk-radio { display: inline-flex !important; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--ink); margin: 0 !important; cursor: pointer; }
.bulk-radio input { width: auto !important; margin: 0; }

/* ---------- Оплата PRO по QR (страница оплаты и профиль) ---------- */
.pay-steps { margin: 0 0 18px; padding-left: 20px; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.pay-app { display: block; }
.pay-plans { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }
.pay-plan { flex: 1 1 140px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface, #fff); color: var(--ink); cursor: pointer; text-align: left; font: inherit; }
.pay-plan:hover { border-color: var(--accent); }
.pay-plan.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.pay-plan-term { font-weight: 700; }
.pay-plan-price { font-size: 13px; color: var(--ink-soft); }
.pay-instructions { white-space: pre-line; font-size: 14px; }
.pay-form { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface, #fff); }
.pay-form h4 { margin: 0 0 12px; }
.pay-result { margin-top: 10px; font-size: 14px; }
.pay-result.ok { color: var(--success, #1a8a4a); }
.pay-result.err { color: var(--danger, #c0392b); }
.pay-history { margin-top: 20px; }
.pay-history h4 { margin: 0 0 8px; }
.pay-history-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pay-history-row small { display: block; color: var(--ink-soft); font-size: 12px; }
.pay-status { font-weight: 600; font-size: 13px; white-space: nowrap; }
.pay-status.pending { color: #b7791f; }
.pay-status.ok { color: var(--success, #1a8a4a); }
.pay-status.off { color: var(--danger, #c0392b); }
.pay-note { grid-column: 1 / -1; font-size: 13px; color: var(--ink-soft); }
@media (max-width: 560px) { .pay-history-row { grid-template-columns: 1fr; } }