/* Генератор схем вышивки крестом — тёплый дизайн мастерской */
:root {
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --surface-alt: #F4EFE6;
  --border: #E5DDD0;
  --border-strong: #D2C6B4;
  --text: #26211D;
  --text-muted: #6C635B;
  --accent: #B4473A;
  --accent-hover: #96372C;
  --accent-soft: #F9EAE7;
  --sage: #3B6E5C;
  --sage-soft: #E9F3EF;
  --gold: #C28A2B;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 2px 12px rgba(45, 34, 24, 0.06);
  --shadow-lg: 0 10px 30px rgba(45, 34, 24, 0.10);
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo-img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #E5DDD0;
  box-shadow: 0 2px 10px rgba(130, 60, 40, 0.22);
  flex-shrink: 0;
  transition: transform 0.2s ease;
  background: #FAF7F2;
}
.brand:hover .brand-logo-img { transform: scale(1.08); }
.chip-featured {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.brand-title { font-weight: 700; font-size: 17px; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--text-muted); }

.nav-tabs {
  display: flex;
  gap: 6px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: 11px;
  border: 1px solid var(--border);
}
.nav-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.nav-link-santa {
  display: inline-flex;
  align-items: center;
  font-size: 13.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 8px;
  white-space: nowrap;
  color: #fff;
  background: #C8322F;
  transition: background 0.18s;
}
.nav-link-santa:hover { background: #A42523; color: #fff; text-decoration: none; }

/* Container */
.page-wrap {
  max-width: 1380px;
  margin: 0 auto;
  padding: 20px 20px 56px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Intro Strip */
.hero-strip {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.hero-strip h1 {
  margin: 0 0 4px;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hero-strip p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14.5px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.badge strong { color: var(--text); }

/* Workspace 2-column grid */
.studio-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.studio-grid > * { min-width: 0; }
@media (max-width: 980px) {
  .studio-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 16px; }
.card-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Upload dropzone */
.dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone-icon {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 6px;
}
.dropzone-text { font-weight: 600; font-size: 14px; }
.dropzone-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.demo-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
  align-items: center;
}
.demo-label { font-size: 12px; color: var(--text-muted); }
.chip-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.chip-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Controls */
.ctrl-group { margin-bottom: 13px; }
.ctrl-group:last-child { margin-bottom: 0; }
.ctrl-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text);
}
.ctrl-val {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 700;
}
select, input[type="number"], input[type="text"] {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus, input[type="number"]:focus, input[type="text"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180, 71, 58, 0.14);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  margin: 2px 0;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  margin-top: 6px;
}
.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.fabric-swatches {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.fabric-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.fabric-swatch:hover { transform: scale(1.1); }
.fabric-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--accent);
}

details.adv-box {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
details.adv-box summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
details.adv-box summary::after { content: '▾'; font-size: 14px; }
details.adv-box[open] summary::after { content: '▴'; }
details.adv-box .adv-body { margin-top: 10px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 14px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-sage {
  background: var(--sage);
  color: #fff;
}
.btn-sage:hover:not(:disabled) { background: #2F594A; }
.btn-outline {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* Summary metrics bar */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 680px) {
  .stats-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 13px;
}
.stat-k { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }
.stat-v { font-size: 17px; font-weight: 800; color: var(--text); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-s { font-size: 11.5px; color: var(--text-muted); }

/* Preview Stage */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mode-pills {
  display: flex;
  gap: 4px;
  background: var(--surface-alt);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.mode-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 7px;
  cursor: pointer;
}
.mode-pill.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 5px;
}
.zoom-label {
  font-family: var(--mono);
  font-size: 12px;
  min-width: 44px;
  text-align: center;
  color: var(--text-muted);
}

.canvas-viewport {
  position: relative;
  background: #EAE4DA;
  background-image: radial-gradient(rgba(0,0,0,0.06) 1px, transparent 1px);
  background-size: 16px 16px;
  border: 1px solid var(--border);
  border-radius: 11px;
  min-height: 380px;
  max-height: 620px;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  display: grid;
  place-items: safe center;
  padding: 16px;
}
.canvas-viewport canvas {
  display: block;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
  image-rendering: pixelated;
  cursor: crosshair;
  background: #fff;
}
.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  max-width: 420px;
}
.empty-state h3 { margin: 8px 0 6px; color: var(--text); font-size: 17px; }
.empty-state p { margin: 0 0 14px; font-size: 13.5px; }

.hover-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--surface-alt);
  font-size: 12.5px;
  color: var(--text-muted);
  min-height: 36px;
  flex-wrap: wrap;
}
.hover-swatch {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.2);
  vertical-align: -3px;
  margin-right: 6px;
}

.compare-bar {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--surface-alt);
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
}
.compare-bar.show { display: flex; }

/* Export bar */
.export-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  align-items: center;
}
.export-bar select { width: auto; padding: 7px 10px; font-size: 13px; }

/* Legend / Thread Table */
.legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.legend-hint { font-size: 12.5px; color: var(--text-muted); }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}
table.thread-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.thread-table th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.thread-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.thread-table tr:last-child td { border-bottom: none; }
table.thread-table tbody tr { cursor: pointer; transition: background 0.12s; }
table.thread-table tbody tr:hover { background: #FBF6EE; }
table.thread-table tbody tr.hl-row { background: var(--accent-soft); }
table.thread-table tbody tr.bg-removed { opacity: 0.45; text-decoration: line-through; }

.sym-box {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,0.18);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}
.code-pill {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
}
.alt-code {
  font-size: 11.5px;
  color: var(--text-muted);
  font-family: var(--mono);
}
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11.5px;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Palette Translator Tab */
.tool-card-grid {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
@media (max-width: 860px) {
  .tool-card-grid { grid-template-columns: 1fr; }
}
.match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.match-card {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px;
  background: var(--surface);
}
.match-brand { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.match-swatch-pair {
  display: flex;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.12);
  margin: 8px 0;
}
.match-swatch-pair > div { flex: 1; }
.match-code { font-family: var(--mono); font-size: 16px; font-weight: 800; }
.match-name { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.match-score {
  display: inline-block;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}
.score-hi { background: var(--sage-soft); color: var(--sage); }
.score-mid { background: #FEF3DC; color: #9A6414; }
.score-lo { background: var(--accent-soft); color: var(--accent); }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 20, 16, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 520px;
  width: 100%;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}
.modal-body {
  padding: 14px 18px;
  overflow-y: auto;
}
.palette-pick-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 7px;
  margin-top: 10px;
}
.palette-pick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}
.palette-pick-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.palette-pick-dot {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,0.18);
  flex-shrink: 0;
}

/* SEO & FAQ section */
.info-section {
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.info-card h2 { margin: 0 0 10px; font-size: 16px; font-weight: 700; }
.info-card p, .info-card li { font-size: 13.5px; color: var(--text-muted); margin: 0 0 8px; }
.info-card ul { padding-left: 18px; margin: 0; }

.faq-section {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.faq-section h2 { margin: 0 0 14px; font-size: 18px; }
.faq-item { border-top: 1px solid var(--border); padding: 11px 0; }
.faq-item:first-of-type { border-top: none; padding-top: 0; }
.faq-item summary { font-weight: 700; font-size: 14px; cursor: pointer; }
.faq-item p { margin: 7px 0 0; font-size: 13.5px; color: var(--text-muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 20px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.footer-inner {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.visit-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.vc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(59, 110, 92, 0.18);
  flex-shrink: 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: #25211D;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.24s;
  z-index: 200;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Processing overlay */
.busy-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(38, 33, 29, 0.88);
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: none;
  z-index: 5;
}
.busy-pill.show { display: inline-flex; align-items: center; gap: 6px; }

/* Хлебные крошки, перелинковка SEO-страниц, страницы О проекте / Политика, плашка cookie */
.breadcrumbs {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }

.seo-hub {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.seo-hub h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}
.seo-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 9px;
}
.seo-link-card {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  transition: all 0.15s;
}
.seo-link-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}
.seo-link-card.current {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.seo-link-title { font-weight: 700; font-size: 13.5px; color: var(--text); }
.seo-link-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }

.prose-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px;
  max-width: 880px;
  margin: 0 auto;
}
@media (max-width: 640px) {
  .prose-card { padding: 18px 16px; }
}
.prose-card h1 { margin: 0 0 12px; font-size: 26px; line-height: 1.25; }
.prose-card h2 { margin: 22px 0 8px; font-size: 18px; }
.prose-card p, .prose-card li { font-size: 14.5px; color: var(--text); line-height: 1.65; }
.prose-card ul { padding-left: 20px; }

.cookie-bar {
  position: fixed;
  bottom: 16px;
  right: 16px;
  left: 16px;
  max-width: 560px;
  margin-left: auto;
  background: rgba(38, 33, 29, 0.95);
  color: #FAF7F2;
  padding: 12px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 12.5px;
  line-height: 1.4;
  z-index: 150;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
}
.cookie-bar a { color: #F5B4A8; text-decoration: underline; }

/* ==================== БИБЛИОТЕКА СЮЖЕТОВ ==================== */
.lib-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.lib-filter-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.lib-filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.lib-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 980px) {
  .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .lib-grid { grid-template-columns: 1fr; }
}

.lib-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
}
.lib-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.lib-thumb-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-alt);
  overflow: hidden;
}
.lib-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.lib-card:hover .lib-thumb-wrap img {
  transform: scale(1.04);
}
.lib-tags {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}
.lib-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(38, 33, 29, 0.78);
  color: #fff;
  backdrop-filter: blur(4px);
}
.lib-tag-lvl {
  background: rgba(250, 247, 242, 0.92);
  color: var(--text);
}
.lib-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.lib-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}
.lib-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}
.lib-meta {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 5px 9px;
  border-radius: 7px;
  margin-bottom: 12px;
  display: inline-block;
}

.pro-ai-banner {
  margin-top: 24px;
  background: linear-gradient(135deg, #FFF7F2 0%, #F4EFE6 100%);
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.pro-ai-copy { max-width: 680px; }
.pro-ai-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 6px;
}
.pro-ai-copy h2 { margin: 0 0 6px; font-size: 18px; }
.pro-ai-copy p { margin: 0; font-size: 13.5px; color: var(--text-muted); }
.pro-ai-action {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.pro-ai-action input {
  width: 260px;
  max-width: 100%;
}


