:root {
  --accent-1: #6e0f14;
  --accent-2: #d9691f;
  --accent-grad: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --surface: #1c1616;
  --surface-2: #262020;
  --border: #3a2f2c;
  --text: #f5ece7;
  --text-muted: #b6a49c;
  --danger: #b3261e;
  --success: #3f8f5f;
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: #0f0b0a url("/static/img/bg-warm.jpg") top center / cover no-repeat fixed;
}

#app { min-height: 100vh; padding: 16px 16px 32px; display: flex; flex-direction: column; gap: 14px; }

h1, h2, h3 { margin: 0; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 8px; }
.topbar h1 { font-size: 1.3em; }
/* Экран объявления: «Назад» сверху, название — отдельной центрированной строкой. */
.topbar-detail { display: block; }
.topbar-detail h1 { margin-top: 6px; text-align: center; }
.icon-btn { background: none; border: none; color: var(--text); font-size: 1.3em; cursor: pointer; padding: 4px 8px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 1em; font-weight: 700; }
.back-arrow { font-size: 1.6em; font-weight: 900; line-height: 1; }
.icon-btn-dark { background: #000; border-radius: 10px; padding: 6px 10px; }

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 1.05em;
  font-weight: 700;
  cursor: pointer;
  color: white;
  text-align: center;
}
.btn-dark { background: #191313; border: 1px solid var(--border); }
.btn-accent { background: var(--accent-grad); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sm { padding: 10px 14px; font-size: 0.9em; border-radius: 10px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.panel {
  background: rgba(28, 22, 22, 0.92);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

.listing-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.listing-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.listing-card-header strong { font-size: 1.05em; }

.price-badge {
  background: var(--accent-grad);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85em;
  font-weight: 700;
  white-space: nowrap;
}

.listing-comment { color: var(--text-muted); font-size: 0.92em; line-height: 1.4; white-space: pre-line; }

.direct-employer-title { margin: 2px 0 0; text-align: center; font-size: 1.05em; font-weight: 700; color: var(--text); }

.listing-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.9em; color: var(--text-muted); }
.rating-badge { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }

.card-list { display: flex; flex-direction: column; gap: 12px; }

.empty-state { text-align: center; color: var(--text-muted); padding: 40px 12px; }

.sheet-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end; z-index: 50;
}
.sheet-overlay.hidden { display: none; }
.sheet {
  background: #f3ede9;
  color: #17110f;
  width: 100%;
  border-radius: 20px 20px 0 0;
  padding: 20px;
  max-height: 80vh;
  overflow-y: auto;
}
.sheet h2 { text-align: center; margin-bottom: 16px; }
.sheet-handle { width: 40px; height: 4px; background: #ccc; border-radius: 999px; margin: 0 auto 12px; }
.radio-row { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid #e2dad5; font-size: 1.02em; }
.radio-row input { width: 20px; height: 20px; accent-color: var(--accent-1); }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }
.sheet .btn-outline { background: #e4dcd6; color: #3a3230; border: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85em; color: var(--text-muted); }
.field input[type=text], .field input[type=number], .field select, .field textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  font-size: 1em;
  width: 100%;
}
.field textarea { min-height: 90px; resize: vertical; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 4px; border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-buttons { display: flex; gap: 6px; }
.toggle-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.85em;
}
.toggle-btn.active-yes { background: var(--success); color: white; border-color: var(--success); }
.toggle-btn.active-no { background: var(--danger); color: white; border-color: var(--danger); }

.section-title { font-size: 0.95em; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin: 4px 0; }

.location-group { display: flex; gap: 8px; margin-bottom: 8px; }
.location-group .field { flex: 1; }
.link-btn { background: none; border: none; color: var(--accent-2); cursor: pointer; padding: 6px 0; font-size: 0.9em; text-align: left; }

.tabbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.tab-chip {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 0.9em;
  cursor: pointer;
}
.tab-chip.active { background: var(--accent-grad); color: white; border: none; }

.status-badge { border-radius: 999px; padding: 3px 10px; font-size: 0.8em; border: 1px solid var(--border); }
.status-pending { color: #d9a441; }
.status-published { color: var(--success); }
.status-rejected, .status-archived { color: var(--text-muted); }

.gallery-wrap { position: relative; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 20px; }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 4 / 3; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-slide video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.gallery-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.gallery-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5); }
.gallery-dot.active { background: #fff; }

.stars { color: #e0a640; }

.notice-text { color: var(--text-muted); font-size: 0.9em; }

.header-meta { display: flex; flex-direction: column; gap: 2px; margin-top: -6px; }
.header-meta .notice-text { margin: 0; }
.header-meta .direct-employer-title { margin: 0; }

.locations-list { display: flex; flex-direction: column; gap: 4px; }
.location-line { margin: 0; font-size: 1.05em; font-weight: 600; color: var(--text); }
.error-text { color: var(--danger); font-size: 0.9em; }

/* Ошибка формы — заметная плашка, скрыта пока пустая. */
.form-error { margin: 12px 0; font-size: 0.95em; }
.form-error:not(:empty) {
  color: #fff;
  background: var(--danger);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-weight: 600;
}

footer.hint { text-align: center; color: var(--text-muted); font-size: 0.8em; padding-top: 8px; }
