:root {
  --primary: #2C2C2C;
  --primary-dark: #1A1A1A;
  --accent: #4A4A4A;
  --accent-light: #6B6B6B;
  --bg: #F5F5F5;
  --bg-alt: #EEEEEE;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-muted: #6B6B6B;
  --border: #E0E0E0;
  --glass: rgba(255,255,255,0.72);
  --glass-border: rgba(255,255,255,0.5);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 28px rgba(0,0,0,0.1);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--text); text-decoration: none; }
a:hover { opacity: 0.75; }

/* ===== PUBLIC TOP NAV (pill / glass) ===== */
.pub-nav {
  position: sticky;
  top: 12px;
  z-index: 100;
  max-width: 1100px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}
.pub-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.5rem 0.75rem 0.5rem 1rem;
  box-shadow: var(--shadow);
}
.pub-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
}
.pub-logo .ico {
  width: 28px; height: 28px;
  background: var(--primary);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
.pub-links {
  display: flex;
  gap: 0.15rem;
  list-style: none;
  flex-wrap: wrap;
}
.pub-links a {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s;
}
.pub-links a:hover, .pub-links a.active {
  background: rgba(0,0,0,0.06);
  color: var(--text);
  opacity: 1;
}
.pub-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.pub-actions .icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.05);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.875rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  line-height: 1.2;
}
.btn-dark {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
}
.btn-dark:hover { background: var(--primary-dark); }
.btn-light {
  background: #fff;
  color: var(--text) !important;
  border-color: var(--border);
}
.btn-light:hover { background: var(--bg-alt); }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text) !important;
}
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* Layout */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}
.page-wide { max-width: 1200px; }

h1.hero-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  line-height: 1.25;
}
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Glass cards */
.glass {
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

/* Recommendation of the day */
.reco-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 800px) { .reco-grid { grid-template-columns: 1fr; } }
.reco-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.15rem;
  box-shadow: var(--shadow);
}
.reco-top {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}
.avatar-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #E8E8E8;
  border: 2px solid #ddd;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 40px; height: 40px; font-size: 0.6rem; }
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #F0F0F0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.reco-desc {
  background: #FAFAFA;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 80px;
  padding: 0.65rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Two columns about */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2.5rem;
}
@media (max-width: 700px) { .about-grid { grid-template-columns: 1fr; } }
.about-box {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.about-box h2 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.85rem;
}

/* Freelancer / vacancy list layout with filter */
.split {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .filter-panel { order: -1; }
}

.filter-panel {
  background: #E8E8E8;
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 80px;
}
.filter-panel h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}
.filter-panel h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 1rem 0 0.5rem;
  color: var(--text);
}
.filter-panel label {
  display: block;
  font-size: 0.85rem;
  padding: 0.2rem 0;
  cursor: pointer;
  color: var(--text-muted);
}
.filter-panel label:hover { color: var(--text); }
.filter-panel input[type="text"],
.filter-panel select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #ccc;
  border-radius: 999px;
  background: #fff;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}
.chip-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: none;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}
.chip-btn.active, .chip-btn:hover {
  background: var(--primary);
  color: #fff;
}
.filter-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.filter-actions .btn { flex: 1; border-radius: 10px; }

/* Freelancer card (public list) */
.fl-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.15rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.fl-card:hover { box-shadow: var(--shadow-hover); }
.fl-card-top {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.fl-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: inherit;
}
.fl-activity {
  font-size: 0.95rem;
  color: inherit;
  opacity: 0.82;
  font-weight: 500;
}
.fl-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: inherit;
  opacity: 0.72;
}
.fl-card {
  color: var(--text);
}
.fl-portfolio {
  display: flex;
  gap: 8px;
  margin-top: 0.85rem;
  overflow-x: auto;
}
.fl-portfolio .thumb {
  width: 72px; height: 72px;
  border-radius: 10px;
  background: #F0F0F0;
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}
.fl-portfolio .thumb-ph {
  width: 72px; height: 72px;
  border-radius: 10px;
  background: #F5F5F5;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem;
  color: #aaa;
  flex-shrink: 0;
  text-align: center;
  padding: 4px;
}

/* Vacancy card */
.vac-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.1rem 1.25rem;
  margin-bottom: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  box-shadow: var(--shadow);
}
.vac-card:hover { box-shadow: var(--shadow-hover); }
.vac-title { font-weight: 600; font-size: 1rem; margin-bottom: 0.4rem; }
.vac-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.65rem; }
.vac-tag {
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  background: #F0F4FF;
  font-size: 0.72rem;
  color: #4A5A8A;
}
.vac-right {
  text-align: right;
  flex-shrink: 0;
  min-width: 120px;
}
.vac-salary {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}
.vac-employer {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Category pills */
.cats {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem 1.5rem;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
}
@media (max-width: 600px) { .cats { grid-template-columns: 1fr 1fr; } }
.cats a { color: var(--text-muted); }
.cats a:hover { color: var(--text); }

.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.search-bar input {
  flex: 1;
  padding: 0.7rem 1.1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.95rem;
  background: #fff;
}
.search-bar input:focus { outline: none; border-color: #999; }

/* Chat layout */
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 90px);
  max-width: 1200px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
@media (max-width: 800px) { .chat-layout { grid-template-columns: 1fr; height: auto; min-height: 70vh; } }
.chat-sidebar {
  background: #F0F0F0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.chat-search {
  padding: 0.75rem;
}
.chat-search input {
  width: 100%;
  padding: 0.55rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: #fff;
  font-size: 0.85rem;
}
.chat-tabs {
  display: flex;
  gap: 0.25rem;
  padding: 0 0.75rem 0.5rem;
  flex-wrap: wrap;
}
.chat-tabs button {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 500;
}
.chat-tabs button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.chat-list { flex: 1; overflow-y: auto; padding: 0.5rem; }
.chat-item {
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  margin-bottom: 0.35rem;
  background: #D0D0D0;
  cursor: pointer;
  align-items: center;
}
.chat-item:hover, .chat-item.active { background: #C0C0C0; }
.chat-item .info { flex: 1; min-width: 0; }
.chat-item .name { font-weight: 600; font-size: 0.85rem; }
.chat-item .preview {
  font-size: 0.75rem;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-item .date { font-size: 0.7rem; color: #666; white-space: nowrap; }
.chat-main {
  background: #C8C8C8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 0.95rem;
}

/* Auth */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1.5rem;
}
.auth-card {
  background: #fff;
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
  width: 100%;
  max-width: 460px;
  border: 1px solid var(--border);
}
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  border-color: #888;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}
.alert {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.alert-error { background: #FEE; color: #A33; }
.alert-success { background: #EFE; color: #363; }
.alert-info { background: #EEF; color: #336; }

.role-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
@media (max-width: 500px) { .role-cards { grid-template-columns: 1fr; } }
.role-card {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
}
.role-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
}
.role-card .icon { font-size: 1.75rem; margin-bottom: 0.35rem; }
.role-card h3 { font-size: 0.9rem; margin-bottom: 0.2rem; }
.role-card p { font-size: 0.75rem; color: var(--text-muted); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  padding: 0.4rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  user-select: none;
}
.chip.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip input { display: none; }

.steps { display: flex; gap: 0.4rem; justify-content: center; margin-bottom: 1.25rem; }
.step-dot { width: 8px; height: 8px; border-radius: 50%; background: #ddd; }
.step-dot.active { background: var(--primary); }
.step-dot.done { background: #5A8F6B; }

/* App topbar for logged-in */
.app-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-nav .links { display: flex; gap: 0.25rem; list-style: none; }
.app-nav .links a {
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}
.app-nav .links a:hover, .app-nav .links a.active {
  background: #F0F0F0;
  color: var(--text);
  opacity: 1;
}

/* Gallery masonry */
.gallery-masonry {
  columns: 4 200px;
  column-gap: 1rem;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.gallery-item img { width: 100%; display: block; }
.gallery-item .meta {
  padding: 0.55rem 0.75rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-2 { gap: 0.75rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }

@media (max-width: 700px) {
  .pub-links { display: none; }
  .vac-card { flex-direction: column; }
  .vac-right { text-align: left; }
}

/* ========== CABINET / APP NAV ========== */
.app-nav {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  gap: 1rem;
  flex-wrap: wrap;
}
.app-nav-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
}
.app-logo-ico {
  width: 28px;
  height: 28px;
  background: #2C2C2C;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-nav .links {
  display: flex;
  gap: 0.15rem;
  list-style: none;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
}
.app-nav .links a {
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  display: inline-block;
}
.app-nav .links a:hover,
.app-nav .links a.active {
  background: #F0F0F0;
  color: var(--text);
  opacity: 1;
}
.app-nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.balance-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.2rem;
  height: 2rem;
  background: #F0F0F0;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.balance-pill .balance-plus { display: none; font-size: 1.15rem; font-weight: 700; }
.balance-pill:hover .balance-amount { display: none; }
.balance-pill:hover .balance-plus { display: inline; }
.user-name {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Page wrap for cabinet */
.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 2px;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.15rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}
.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}
tr:hover td { background: rgba(0,0,0,0.02); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-active { background: #D4EDDA; color: #155724; }
.badge-progress { background: #FFF3CD; color: #856404; }
.badge-completed { background: #E2E3E5; color: #383D41; }

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.service-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.service-cover {
  height: 120px;
  background: #F0F0F0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.service-body { padding: 1rem 1.15rem; }
.service-title { font-weight: 600; margin-bottom: 0.35rem; }
.service-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.65rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.service-price { font-weight: 700; color: var(--text); }

/* Design page layout */
.design-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
}
@media (max-width: 900px) {
  .design-layout { grid-template-columns: 1fr; }
  .app-nav .links { display: none; }
}
.color-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.color-item label {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
  font-weight: 500;
}
.color-item input[type="color"] {
  width: 100%;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 3px;
  background: #fff;
}
.preview-panel {
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 1.5rem;
  min-height: 300px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 16px;
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.25rem;
}
@media (max-width: 700px) { .editor-layout { grid-template-columns: 1fr; } }
.canvas-area {
  background: #ddd;
  border-radius: 12px;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#imageCanvas { max-width: 100%; max-height: 420px; }
.stickers-panel {
  background: #F0F0F0;
  border-radius: 12px;
  padding: 1rem;
  max-height: 420px;
  overflow-y: auto;
}
.stickers-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sticker-item {
  aspect-ratio: 1;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: grab;
  border: 1.5px solid var(--border);
}
.btn-primary { background: var(--primary); color: #fff !important; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; border: 1.5px solid var(--border); color: var(--text) !important; }
.btn-outline:hover { background: #F0F0F0; }
.btn-accent { background: var(--primary); color: #fff !important; }


.app-nav { display: none !important; }
.page-wrap { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem 3rem; }



/* Logo from user asset */
.pub-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #1A1A1A;
  text-decoration: none;
}
.pub-logo .logo-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;
}
.pub-logo .logo-text {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Decorative stickers on page background */
.stickers-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.stickers-layer .sticker {
  position: absolute;
  font-size: 2rem;
  opacity: 0.35;
  user-select: none;
  filter: grayscale(0.2);
}
.page, .page-wrap, .landing-wrap {
  position: relative;
  z-index: 1;
}
.pub-nav {
  position: relative;
  z-index: 10;
}

/* Pinterest gallery */
.pin-grid {
  column-count: 4;
  column-gap: 1rem;
}
@media (max-width: 1100px) { .pin-grid { column-count: 3; } }
@media (max-width: 768px) { .pin-grid { column-count: 2; } }
@media (max-width: 480px) { .pin-grid { column-count: 1; } }
.pin-item {
  break-inside: avoid;
  margin-bottom: 1rem;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #E8E8E8;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.pin-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.pin-item img {
  width: 100%;
  display: block;
  vertical-align: top;
}
.pin-item .pin-meta {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.pin-item .pin-meta .avatar-circle {
  width: 28px;
  height: 28px;
  font-size: 0.55rem;
}
.pin-item .pin-author {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1A1A1A;
}
.pin-item .pin-spec {
  font-size: 0.75rem;
  color: #888;
}
.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit; /* следует форме контейнера: круг / скруглённый квадрат */
  display: block;
}
.chat-item.active {
  background: #E8E8E8;
}
.fl-card {
  transition: box-shadow 0.15s;
}
.fl-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* Liquid glass / lighting glass */
.liquid-glass {
  background: rgba(255,255,255,0.55) !important;
  backdrop-filter: blur(20px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.4) !important;
  border: 1px solid rgba(255,255,255,0.65) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.8) !important;
}
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(0,0,0,0.06);
  color: #1A1A1A;
  transition: background 0.15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.9); opacity: 1; }
.balance-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.2rem;
  height: 2rem;
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.06);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  cursor: pointer;
}
.balance-pill .balance-amount { display: inline; }
.balance-pill .balance-plus {
  display: none;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  color: var(--primary, #1A1A1A);
}
.balance-pill:hover {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
}
.balance-pill:hover .balance-amount { display: none; }
.balance-pill:hover .balance-plus { display: inline; }
.balance-pill:active { transform: scale(0.96); }

/* Portfolio link accordion */
.port-link {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: #fff;
}
.port-link-head {
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}
.port-link-head:hover { background: #F8F8F8; }
.port-link-body {
  display: none;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
}
.port-link.open .port-link-body { display: block; }
.port-link-body a { color: #2563eb; word-break: break-all; font-size: 0.9rem; }
.port-link-body p { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.35rem; }

/* Subcats chips active */
.cats a.active { background: #2C2C2C; color: #fff; border-color: #2C2C2C; }
.cats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; }
.cats a {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  font-size: 0.8rem;
  font-weight: 500;
}
/* Текст карточки = cardTextColor из inline style, без принудительного белого */
.fl-card[style*="color"] .fl-name,
.fl-card[style*="color"] .fl-activity,
.fl-card[style*="color"] .fl-meta,
.fl-card[style*="color"] .text-muted,
.reco-card[style*="color"] .reco-desc,
.reco-card[style*="color"] .tag {
  color: inherit !important;
}
.fl-card[style*="background"] .avatar-circle,
.reco-card[style*="background"] .avatar-circle {
  border: 2px solid rgba(255,255,255,0.5);
}

.avatar-circle.av-rounded, .av.rounded { border-radius: 12px !important; }
.avatar-circle.av-star {
  border-radius: 0 !important;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* Avatar shapes — apply to container AND force img fill */
.avatar-circle {
  overflow: hidden !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
.avatar-circle img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}
.avatar-circle.av-rounded {
  border-radius: 18px !important;
}
.avatar-circle.av-rounded img {
  border-radius: 18px !important;
}
.avatar-circle.av-star {
  border-radius: 0 !important;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.avatar-circle.av-star img {
  border-radius: 0 !important;
}
.avatar-circle:not(.av-rounded):not(.av-star) img {
  border-radius: 50% !important;
}
.avatar-circle:not(.av-rounded):not(.av-star) {
  border-radius: 50% !important;
}


/* Delete image button on profile tiles */
.img-tile { position: relative; }
.btn-del-img {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.btn-del-img:hover { background: #b91c1c; }

/* Lightbox */
.pg-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0,0,0,0.88);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1rem;
}
.pg-lightbox.open { display: flex; }
.pg-lightbox-stage {
  position: relative;
  max-width: 95vw;
  max-height: 80vh;
  overflow: hidden;
  cursor: grab;
}
.pg-lightbox-stage img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.05s linear;
  user-select: none;
  -webkit-user-drag: none;
}
.pg-lightbox-tools {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.pg-lightbox-tools button {
  border: none;
  background: #fff;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}


/* User site stickers — scroll with page */
#siteStickerWrap {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  pointer-events: none;
  z-index: 1;
}
.site-sticker-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.site-sticker-back { z-index: 0; }
.site-sticker-front { z-index: 2; }
.site-sticker.is-back { filter: saturate(0.85); }
body.sticker-edit-mode .site-sticker.is-back {
  outline: 1px dashed rgba(0,0,0,0.25);
  outline-offset: 4px;
}
body.sticker-edit-mode .site-sticker.is-back::after {
  content: "назад";
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  font-size: 10px;
  background: #333;
  color: #fff;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
}
.site-sticker {
  position: absolute;
  transform: translate(-50%, -50%);
  user-select: none;
  touch-action: none;
}
.site-sticker.selected {
  outline: 2px solid #2C2C2C;
  outline-offset: 4px;
  border-radius: 8px;
}
.site-sticker img {
  display: block;
  max-width: 40vw;
  height: auto;
}
.se-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #f5f5f5;
  cursor: pointer;
  font-size: 13px;
}
.se-save {
  padding: 6px 14px;
  border: none;
  border-radius: 999px;
  background: #2C2C2C;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}


/* User site stickers (per-page, personal — only for logged-in owner) */
.site-sticker-layer {
  position: absolute;
  left: 0; top: 0; width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}
.site-sticker-back { z-index: 0; }
.site-sticker-front { z-index: 5000; }
.site-sticker.is-back { filter: saturate(0.85); opacity: 0.92; }
body.sticker-edit-mode .site-sticker.is-back {
  outline: 1px dashed rgba(0,0,0,0.25);
  outline-offset: 4px;
}
body.sticker-edit-mode .site-sticker.is-back::after {
  content: "назад";
  position: absolute;
  left: 50%;
  top: -18px;
  transform: translateX(-50%);
  font-size: 10px;
  background: #333;
  color: #fff;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
}
.site-sticker {
  position: absolute;
  transform: translate(-50%, -50%);
  user-select: none;
  touch-action: none;
  contain: layout style;
}
.site-sticker img {
  display: block;
  max-width: 40vw;
  height: auto;
}

/* Sticker edit mode: real site, buttons dead, place stickers */
body.sticker-edit-mode {
  padding-bottom: 140px !important;
}
.sticker-edit-hit {
  position: fixed;
  inset: 0;
  bottom: 0;
  z-index: 2147482900;
  cursor: crosshair;
  background: transparent;
  /* leave space for toolbar clicks */
  pointer-events: auto;
}
.sticker-edit-bar { pointer-events: auto; }
.sticker-edit-block {
  position: fixed;
  inset: 0;
  z-index: 35;
  cursor: crosshair;
  background: transparent;
}
.site-sticker-layer.edit { z-index: 2147482950; }
.site-sticker-layer.edit.site-sticker-front { z-index: 2147482960; }
.site-sticker.editable {
  cursor: move;
  pointer-events: auto !important;
}
.site-sticker.editable.selected {
  outline: 2px dashed #2C2C2C;
  outline-offset: 4px;
}
.site-sticker .sticker-rm {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: #b91c1c;
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  cursor: pointer;
  padding: 0;
  display: none;
}
.site-sticker.editable:hover .sticker-rm,
.site-sticker.editable.selected .sticker-rm { display: block; }

/* Sticker edit bar — chat-like minimal */
.sticker-edit-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, calc(100% - 24px));
  bottom: 18px;
  z-index: 2147483000;
  background: #FFFFFF;
  border: 1px solid #E8E8E8;
  border-radius: 28px;
  padding: 14px 16px 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 13px;
  color: #1A1A1A;
  max-height: 44vh;
  overflow-y: auto;
  pointer-events: auto;
}
.sticker-edit-bar .se-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.sticker-edit-bar .se-row:last-child { margin-bottom: 0; }
.sticker-edit-bar .se-row strong {
  font-weight: 600;
  font-size: 14px;
  color: #1A1A1A;
}
.sticker-edit-bar .se-page {
  background: #F0F0F0;
  color: #555;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
}
.sticker-edit-bar .se-status {
  color: #9A9A9A;
  font-size: 12px;
  flex: 1;
  min-width: 120px;
}
.sticker-edit-bar .se-pages {
  gap: 6px;
  padding-bottom: 2px;
}
.sticker-edit-bar .se-nav {
  text-decoration: none;
  color: #555;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  background: #F5F5F5;
  transition: background .15s, color .15s;
}
.sticker-edit-bar .se-nav:hover { background: #EBEBEB; color: #1A1A1A; }
.sticker-edit-bar .se-nav.active {
  background: #1A1A1A;
  color: #fff;
}
.sticker-edit-bar .se-emoji {
  border: none;
  background: #F5F5F5;
  border-radius: 14px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, transform .1s;
}
.sticker-edit-bar .se-emoji:hover { background: #EBEBEB; }
.sticker-edit-bar .se-emoji.active {
  background: #1A1A1A;
  box-shadow: inset 0 0 0 2px #1A1A1A;
  filter: none;
}
.sticker-edit-bar .se-emoji-wrap {
  position: relative;
  display: inline-block;
}
.sticker-edit-bar .se-upload {
  border: none;
  background: #F5F5F5;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #333;
}
.sticker-edit-bar .se-upload:hover { background: #EBEBEB; }
.sticker-edit-bar .se-check {
  font-size: 12px;
  color: #777;
  gap: 6px;
}
.sticker-edit-bar .se-btn,
.sticker-edit-bar button.se-btn {
  border: none !important;
  background: #F5F5F5 !important;
  color: #333 !important;
  border-radius: 999px !important;
  padding: 8px 14px !important;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px !important;
  font-weight: 500;
}
.sticker-edit-bar .se-btn:hover { background: #EBEBEB !important; }
.sticker-edit-bar .se-save,
.sticker-edit-bar button.se-save {
  background: #1A1A1A !important;
  color: #fff !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 8px 18px !important;
  font-weight: 600 !important;
  font-size: 12px !important;
}
.sticker-edit-bar .se-save:hover { background: #000 !important; }
.sticker-edit-bar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #666;
  background: #FAFAFA;
  border-radius: 999px;
  padding: 4px 10px;
}
.sticker-edit-bar input[type="range"] {
  width: 88px;
  accent-color: #1A1A1A;
}
.sticker-edit-bar input[type="text"] {
  border: 1px solid #E8E8E8;
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  background: #FAFAFA;
}
.sticker-edit-bar input[type="text"]:focus {
  border-color: #CCC;
  background: #fff;
}
