/* ============================================================
   Portal Electro — local design system (no external dependencies)
   Palette: warm cream surface + graphite accent (monochrome-friendly)
   ============================================================ */

:root {
  --bg: #f1eee7;
  --bg-deep: #e5e0d6;
  --surface: #faf8f4;
  --surface-2: #ece7dd;
  --ink: #181714;
  --muted: #6e695f;
  --line: rgba(24, 23, 20, 0.14);
  --line-strong: rgba(24, 23, 20, 0.26);
  --accent: #4a4a4a;
  --accent-strong: #2f2f2d;
  --danger: #8a3a33;
  --warning: #8a6d3b;
  --success: #3f6b52;
  --info: #46525c;

  --content-max: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: clamp(14px, 1.4vw, 20px);
  --radius-sm: 10px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow: 0 24px 50px -34px rgba(24, 23, 20, 0.45);
  --grid: 1.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(255, 255, 255, 0.85), transparent 62%),
    radial-gradient(820px 520px at 0% 4%, rgba(24, 23, 20, 0.05), transparent 60%),
    var(--bg);
  color: var(--ink);
  font-family: "Helvetica Neue", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent-strong);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.6em;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -0.05em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.04em; }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }

.h1, .h2, .h3, .h4, .h5, .h6 {
  margin: 0 0 0.6em;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--ink);
}
.h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); letter-spacing: -0.05em; }
.h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -0.04em; }
.h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
.h4 { font-size: 1.3rem; }
.h5 { font-size: 1.12rem; }
.h6 { font-size: 1rem; }

p { margin: 0 0 1rem; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.5rem 0;
}

/* ---------- layout ---------- */
main {
  display: block;
  padding-block: clamp(1.5rem, 3vw, 2.5rem);
}

.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.row {
  --grid: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  margin-inline: calc(var(--grid) / -2);
}

[class*="col-"] {
  padding-inline: calc(var(--grid) / 2);
  margin-bottom: var(--grid);
  width: 100%;
}

.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }

@media (min-width: 576px) {
  .col-sm-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
}

@media (min-width: 768px) {
  .col-md-2 { flex: 0 0 16.6667%; max-width: 16.6667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-9 { flex: 0 0 75%; max-width: 75%; }
}

@media (min-width: 992px) {
  .col-lg-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
  .col-lg-5 { flex: 0 0 41.6667%; max-width: 41.6667%; }
  .col-lg-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
  .col-lg-9 { flex: 0 0 75%; max-width: 75%; }
  .col-lg-10 { flex: 0 0 83.3333%; max-width: 83.3333%; }
}

.g-0 { --grid: 0; }
.g-2 { --grid: 1rem; }
.g-3 { --grid: 1.5rem; }
.g-4 { --grid: 2rem; }

/* ---------- navbar ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(241, 238, 231, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.navbar > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  flex-wrap: wrap;
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
  text-decoration: none;
}

.navbar-brand:hover { text-decoration: none; color: var(--ink); }

.navbar-brand i { color: var(--accent); font-size: 1.1rem; }

.navbar-toggler {
  display: none;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.navbar-toggler-icon {
  display: inline-block;
  width: 20px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 6px 0 currentColor, 0 -6px 0 currentColor;
  margin: 3px 0;
}

.navbar-collapse {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
}

.navbar-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item { display: flex; align-items: center; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 0;
  color: var(--muted) !important;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}

.nav-link:hover {
  color: var(--ink) !important;
  background: rgba(24, 23, 20, 0.05);
  text-decoration: none;
}

.navbar-toggler + .navbar-collapse { }

.collapse { display: none; }
.collapse.show { display: block; }
tr.collapse.show { display: table-row; }
.fade { transition: opacity 0.2s var(--ease); }

@media (max-width: 991px) {
  .navbar-toggler { display: inline-block; }
  .navbar-collapse {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    padding-block: 0.5rem 0.75rem;
  }
  .navbar-collapse.show { display: flex; }
  .navbar-nav { flex-direction: column; align-items: stretch; }
  .nav-link { justify-content: flex-start; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease), transform 0.18s var(--ease);
}

.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled { opacity: 0.55; cursor: default; transform: none; }

.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

.btn-secondary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-secondary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.08); color: #fff; }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); color: #fff; }

.btn-light { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-light:hover { background: var(--surface-2); color: var(--ink); }

.btn-link {
  background: transparent;
  border-color: transparent;
  color: var(--accent-strong);
  padding-inline: 0.35rem;
}
.btn-link:hover { background: transparent; color: var(--ink); text-decoration: underline; }

.btn-outline-secondary { background: transparent; border-color: var(--line-strong); color: var(--muted); }
.btn-outline-secondary:hover { border-color: var(--ink); color: var(--ink); }

.btn-outline-primary { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline-primary:hover { background: var(--ink); color: #fff; }

.btn-outline-light { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline-light:hover { background: rgba(24, 23, 20, 0.06); color: var(--ink); }

.btn-outline-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 1.4rem; font-size: 1.02rem; }
.w-100 { width: 100%; }

.btn-group { display: inline-flex; gap: 0.5rem; flex-wrap: wrap; }

.btn-close {
  width: 1.1rem;
  height: 1.1rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.6;
  margin-left: auto;
  font-size: 1.1rem;
  line-height: 1;
}
.btn-close::before { content: "\00d7"; }
.btn-close:hover { opacity: 1; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.card:hover { transform: translateY(-3px); box-shadow: 0 30px 60px -40px rgba(24, 23, 20, 0.5); }

.card-body { padding: clamp(1.1rem, 2vw, 1.75rem); }

.card-header {
  padding: 1rem clamp(1.1rem, 2vw, 1.75rem);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 650;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title { margin: 0 0 0.4rem; font-size: 1.15rem; font-weight: 650; }
.card-text { margin: 0 0 0.75rem; }
.card-img-top { width: 100%; height: auto; object-fit: cover; }
.h-100 { height: 100%; }

/* компактный переключатель населённого пункта (свернутый по умолчанию) */
.settlement-switch {
  display: block;
  max-width: 100%;
  overflow: visible;
  margin-bottom: 1rem;
}
.settlement-switch > summary {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  max-width: 100%;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.settlement-switch > summary::-webkit-details-marker { display: none; }
.settlement-switch > summary::marker { content: ""; }
.settlement-switch > summary:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.settlement-switch__caption {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.settlement-switch__value {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  min-width: 0;
  font-size: 0.95rem;
}
.settlement-switch__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60ch;
}
.settlement-switch__region {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40ch;
}
.settlement-switch__edit { color: var(--muted); font-size: 0.9rem; }
.settlement-switch[open] > summary { border-color: var(--accent); }
.settlement-switch__form {
  margin-top: 0.6rem;
  max-width: 520px;
}

/* published master cards rail */
.cards-rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  cursor: grab;
}
.cards-rail::-webkit-scrollbar { height: 8px; }
.cards-rail::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}
.cards-rail.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}
.master-card {
  flex: 0 0 auto;
  width: clamp(220px, 62vw, 280px);
  scroll-snap-align: start;
}
.master-card-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-2);
}
.master-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.master-card-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-size: 2.4rem;
}
.master-card .card-body { padding: 0.9rem 1rem; }

/* кликабельная карточка мастера на главной */
.master-card-link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}
.master-card-link:hover { text-decoration: none; color: inherit; }

/* страница мастера */
.master-detail-hero {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  flex-wrap: wrap;
  padding-bottom: clamp(1.25rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.master-detail-avatar {
  flex: 0 0 auto;
  width: clamp(96px, 18vw, 160px);
  height: clamp(96px, 18vw, 160px);
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
}
.master-detail-info { min-width: 0; }
.master-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.max-icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
}

/* портфолио мастера: горизонтальные ленты внутри вертикальных секций */
.portfolio-section {
  padding-block: clamp(1rem, 2.5vw, 1.75rem);
  border-top: 1px solid var(--line);
}
.photo-rail { gap: 0.75rem; cursor: grab; }
.photo-rail .photo-card {
  flex: 0 0 auto;
  width: min(90vw, 540px);
  scroll-snap-align: start;
  margin: 0;
}
.photo-rail img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: 0 14px 34px -24px rgba(24, 23, 20, 0.5);
}
.photo-rail figcaption { margin-top: 0.4rem; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.bg-primary { background: var(--ink) !important; color: #fff; }
.bg-secondary { background: var(--accent) !important; color: #fff; }
.bg-success { background: var(--success) !important; color: #fff; }
.bg-danger { background: var(--danger) !important; color: #fff; }
.bg-warning { background: var(--warning) !important; color: #fff; }
.bg-light { background: var(--surface-2) !important; color: var(--ink); }
.bg-dark { background: var(--ink) !important; color: #fff; }
.bg-transparent { background: transparent !important; }

/* ---------- alerts ---------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  margin-bottom: 1rem;
}

.alert-success { border-left-color: var(--success); }
.alert-danger { border-left-color: var(--danger); }
.alert-warning { border-left-color: var(--warning); }
.alert-info { border-left-color: var(--info); }
.alert-dismissible { position: relative; }
.alert-link { font-weight: 600; text-decoration: underline; }
.flash-region { margin-top: 1rem; }

/* ---------- tables ---------- */
.table-responsive { width: 100%; overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table thead th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.table tbody tr:hover { background: rgba(24, 23, 20, 0.035); }
.table-hover tbody tr { transition: background-color 0.15s var(--ease); }
.table-borderless th, .table-borderless td { border-bottom: 0; }
.table-sm th, .table-sm td { padding: 0.45rem 0.6rem; }
.table-striped tbody tr:nth-child(odd) { background: rgba(24, 23, 20, 0.025); }

/* ---------- breadcrumb ---------- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumb-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; color: var(--line-strong); }
.breadcrumb-item.active { color: var(--ink); }

/* ---------- forms ---------- */
.form-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.form-control,
.form-select {
  display: block;
  width: 100%;
  padding: 0.62rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.form-select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 13px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 74, 74, 0.16);
}

.form-control-sm { padding: 0.4rem 0.6rem; font-size: 0.85rem; }

textarea.form-control { min-height: 7rem; resize: vertical; }

.form-text {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.compress-hint { color: var(--muted); }

.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check-input { width: 1.05rem; height: 1.05rem; accent-color: var(--ink); }
.form-check-label { font-size: 0.92rem; }

/* ---------- autocomplete (settlement) ---------- */
.ac { position: relative; }
.ac-list {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.ac-list[hidden] { display: none; }
.ac-item {
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.92rem;
}
.ac-item:hover,
.ac-item.is-active { background: var(--surface-2); }
.ac-empty { padding: 0.55rem 0.65rem; color: var(--muted); font-size: 0.85rem; }

/* ---------- text utilities ---------- */
.text-muted { color: var(--muted) !important; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-start { text-align: left; }
.text-primary { color: var(--accent-strong) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-dark { color: var(--ink) !important; }
/* site is light now: legacy "white" text maps to ink/muted */
.text-white { color: var(--ink) !important; }
.text-white-50 { color: var(--muted) !important; }
.text-nowrap { white-space: nowrap; }
.text-decoration-none { text-decoration: none !important; }
.fw-bold { font-weight: 700 !important; }
.fst-italic { font-style: italic !important; }
.small { font-size: 0.85rem; }
.lead { font-size: 1.08rem; color: var(--muted); }
.opacity-75 { opacity: 0.75; }
.display-4 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 650; letter-spacing: -0.05em; }
.display-6 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 650; }

/* ---------- flex / display utilities ---------- */
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-column { flex-direction: column !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-md-3 { }

@media (min-width: 768px) {
  .gap-md-3 { gap: 1rem !important; }
  .d-md-inline { display: inline !important; }
}

@media (max-width: 767px) {
  .d-sm-inline { display: none !important; }
}

.ms-auto { margin-left: auto !important; }
.me-auto { margin-right: auto !important; }
.mt-auto { margin-top: auto !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }

/* spacing */
.m-0{margin:0!important}.m-2{margin:.5rem!important}.m-3{margin:1rem!important}.m-4{margin:1.5rem!important}
.mb-0{margin-bottom:0!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:1rem!important}.mb-4{margin-bottom:1.5rem!important}.mb-5{margin-bottom:3rem!important}
.mt-0{margin-top:0!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-3{margin-top:1rem!important}.mt-4{margin-top:1.5rem!important}.mt-5{margin-top:3rem!important}
.my-4{margin-block:1.5rem!important}
.p-0{padding:0!important}.p-2{padding:.5rem!important}.p-3{padding:1rem!important}.p-4{padding:1.5rem!important}.p-5{padding:2.5rem!important}
.py-0{padding-block:0!important}.py-2{padding-block:.5rem!important}.py-3{padding-block:1rem!important}.py-4{padding-block:1.5rem!important}.py-5{padding-block:2.5rem!important}
.pt-3{padding-top:1rem!important}
.px-2{padding-inline:.5rem!important}.px-3{padding-inline:1rem!important}

/* ---------- borders / misc ---------- */
.rounded { border-radius: var(--radius-sm) !important; }
.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid var(--line) !important; }
.border-bottom { border-bottom: 1px solid var(--line) !important; }
.object-fit-cover { object-fit: cover; object-position: center; }
.list-unstyled { list-style: none; margin: 0; padding: 0; }
.sticky-top { position: sticky; top: 0; }
.list-group { display: flex; flex-direction: column; }
.list-group-item { padding: 0.8rem 1rem; border: 1px solid var(--line); border-bottom: 0; }
.list-group-item:first-child { border-top-left-radius: var(--radius-sm); border-top-right-radius: var(--radius-sm); }
.list-group-item:last-child { border-bottom: 1px solid var(--line); border-bottom-left-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }

/* ---------- custom components ---------- */
.hero-section {
  padding: clamp(2rem, 5vw, 4rem) 0 clamp(1.5rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--accent-strong);
  font-size: 1.6rem;
}

.empty-state {
  padding: clamp(2rem, 5vw, 3.5rem) 1.25rem;
  text-align: center;
}
.empty-state i {
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--line-strong);
  margin-bottom: 0.75rem;
  display: block;
}
.empty-state p { color: var(--muted); }

.legal-doc {
  max-width: 760px;
  margin-inline: auto;
}
.legal-doc h1 { margin-bottom: 1rem; }
.legal-doc h2 { margin-top: 2rem; font-size: 1.4rem; }
.legal-doc p, .legal-doc li { color: var(--ink); }
.legal-doc .text-muted { color: var(--muted) !important; }

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}
.page-head h1 { margin: 0; }

.muted-divider {
  height: 1px;
  background: var(--line);
  margin-block: 1.5rem;
}

/* personal cabinet */
.cabinet-grid {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}
.cabinet-avatar { text-align: center; }
.avatar-preview,
.avatar-placeholder {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 2.4rem;
  margin-inline: auto;
}
@media (max-width: 640px) {
  .cabinet-grid { grid-template-columns: 1fr; }
}

/* footer */
.site-footer {
  margin-top: clamp(2.5rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.75rem;
}
.site-footer small,
.site-footer .footer-muted { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.02em; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.site-footer a { color: var(--muted); font-size: 0.82rem; }
.site-footer a:hover { color: var(--ink); }

/* reveal on scroll (replaces AOS) */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
