:root {
  --bg: #eef2f7;
  --bg-accent: linear-gradient(160deg, #e8f0fb 0%, #f4f6f9 45%, #eef1f6 100%);
  --surface: #ffffff;
  --text: #1a2332;
  --muted: #5c6575;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #dbeafe;
  --topbar: #0f172a;
  --admin-chrome: #0f172a;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
  --layout-max-width: 1220px;
  --mobile-nav-height: 72px;
}

* { box-sizing: border-box; }

html {
  background: var(--admin-chrome);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  background-color: #e8eef6;
  background-image:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(59, 130, 246, 0.12), transparent 55%),
    var(--bg-accent);
  color: var(--text);
  line-height: 1.55;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: min(var(--layout-max-width), 93%);
  margin: 0 auto;
}

.topbar {
  background: var(--topbar);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.topbar-menu-btn__badge {
  position: absolute;
  top: 2px;
  right: 2px;
}

.topbar-menu-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.topbar-menu-btn.is-active {
  background: rgba(37, 99, 235, 0.45);
}

.topbar-menu-btn__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.brand-logo--footer {
  width: 36px;
  height: 36px;
  box-shadow: none;
}

.brand-mark {
  width: 10px;
  height: 28px;
  border-radius: 4px;
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.nav-links a,
.nav-links .link-btn {
  color: #cbd5e1;
  text-decoration: none;
  margin-left: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  font: inherit;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links .link-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-links a.nav-link-active {
  color: #fff;
  background: rgba(37, 99, 235, 0.45);
}

.nav-badge {
  display: inline-block;
  min-width: 1.25em;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  vertical-align: middle;
}

.link-btn {
  background: transparent;
  border: 0;
  cursor: pointer;
}

.main-content {
  padding-bottom: 32px;
  flex: 1;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin: 22px 0;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.card-form {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.phone-required-lead {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--text);
  font-weight: 600;
}

.card-form--wide {
  max-width: none;
  margin-top: 0;
}

.ticket-new-page .card-form {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.ticket-new-tips {
  margin: 0;
}

.ticket-new-tips__title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 800;
}

.form-ticket .input-file--wide {
  width: 100%;
  max-width: none;
  padding: 12px 14px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  background: #f8fafc;
  cursor: pointer;
}

.form-ticket .input-file--wide:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.form-ticket .textarea-fixed {
  min-height: 160px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 6px;
}

.page-title {
  margin: 0 0 10px;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.lead {
  margin: 0 0 22px;
  font-size: 0.95rem;
}

.hero h1 { margin-top: 0; font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -0.03em; }
.hero p { font-size: 1.05rem; color: var(--muted); max-width: 52ch; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s, transform 0.1s;
}

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

.btn:active {
  transform: scale(0.98);
}

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

.btn-danger {
  background: #b91c1c;
  color: #fff;
}

.btn-danger:hover {
  background: #991b1b;
  color: #fff;
}

.btn-ghost {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid #e2e8f0;
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: var(--text);
}

.btn.ghost {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid #e2e8f0;
}

.btn.ghost:hover {
  background: #e2e8f0;
  color: var(--text);
}

.form { display: grid; gap: 18px; }

.form-ticket .field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-weight: 600;
  font-size: 0.9rem;
}

/* Выбор темы заявки */
.topic-picker {
  position: relative;
}

.topic-picker.is-enhanced .topic-picker__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topic-picker__trigger {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fafbfc;
  color: #64748b;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.topic-picker__trigger:hover,
.topic-picker__trigger:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #fff;
}

.topic-picker__trigger.has-value {
  color: var(--text);
  background: #fff;
}

.topic-picker__trigger-text {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.topic-picker__trigger-main {
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.topic-picker__trigger-meta {
  font-size: 0.82rem;
  line-height: 1.35;
}

.topic-picker__chevron {
  flex-shrink: 0;
  margin-top: 2px;
  color: #94a3b8;
  font-size: 0.9rem;
}

.topic-picker-dialog {
  border: 0;
  padding: 0;
  margin: auto;
  width: min(560px, calc(100vw - 20px));
  max-height: min(88dvh, calc(100vh - 20px));
  background: transparent;
}

.topic-picker-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
}

.topic-picker-dialog__sheet {
  display: flex;
  flex-direction: column;
  max-height: min(88dvh, calc(100vh - 20px));
  background: #fff;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.topic-picker-dialog__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-shrink: 0;
}

.topic-picker-dialog__title {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topic-picker-dialog__close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.topic-picker-dialog__close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.topic-picker-dialog__list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
  display: grid;
  gap: 8px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.topic-picker-option {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.topic-picker-option:hover,
.topic-picker-option:focus-visible {
  outline: none;
  border-color: #93c5fd;
  background: #f8fbff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.topic-picker-option.is-selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #2563eb inset;
}

.topic-picker-option__title {
  font-weight: 650;
  font-size: 0.98rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  white-space: normal;
}

.topic-picker-option__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.8rem;
  line-height: 1.35;
  color: #64748b;
}

@media (max-width: 640px) {
  .topic-picker-dialog {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    height: auto;
    max-height: calc(100dvh - 132px);
    margin: 68px auto 72px;
  }

  .topic-picker-dialog__sheet {
    height: auto;
    max-height: calc(100dvh - 132px);
    border-radius: 16px;
    border: 1px solid #e2e8f0;
  }

  .topic-picker-dialog__head {
    padding-top: 12px;
  }

  .topic-picker-option {
    padding: 12px 14px;
  }

  .topic-picker-option__title {
    font-size: 0.98rem;
  }

  .topic-picker__trigger {
    min-height: 52px;
    padding: 14px 14px;
  }
}

label.field { margin: 0; }

input, select, textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #fff;
}

.textarea-fixed {
  resize: none;
  min-height: 150px;
  line-height: 1.5;
}

.input-file {
  padding: 10px;
  border-style: dashed;
  border-color: #94a3b8;
  background: #f8fafc;
  cursor: pointer;
}

.input-file::file-selector-button {
  margin-right: 14px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.input-file::file-selector-button:hover {
  background: var(--primary-hover);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

#login-form .form-actions {
  justify-content: center;
}

.form--follow-up {
  margin-top: 16px;
}

.form-actions--stack {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-top: 0;
}

.form-actions--stack .btn {
  width: 100%;
  justify-content: center;
}

.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }

.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.95rem;
}

th, td {
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  padding: 12px 10px;
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

tbody tr:hover {
  background: #f8fafc;
}

tbody a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

tbody a:hover {
  text-decoration: underline;
}

.flash {
  padding: 12px 16px;
  border-radius: 10px;
  margin-top: 16px;
  font-weight: 500;
}

.flash.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.flash.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

.inline, .inline-form { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.chat { display: grid; gap: 10px; margin-bottom: 12px; }

.msg {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
}

.msg__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  margin-bottom: 4px;
}

.msg-ticks {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.06em;
  color: #94a3b8;
  line-height: 1;
  user-select: none;
}

.msg-ticks--read {
  color: var(--primary, #2563eb);
}

.muted { color: var(--muted); font-size: 0.9rem; }

.list { margin: 0; padding-left: 18px; }

.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.subheading {
  margin: 20px 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

.attachments-block { margin-top: 18px; }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.thumb {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s;
  background: #f1f5f9;
}

.thumb:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.thumb img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

h2, h3 { letter-spacing: -0.02em; }

h2 { font-size: 1.35rem; }

section.card > h2:first-child,
section.card > h3:first-child {
  margin-top: 0;
}

.form label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Шапка страницы (внутренние разделы) */
.page-intro {
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 48%, #eef2ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.15);
  margin-bottom: 0;
}

.page-intro--narrow {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.page-intro__lead {
  margin: 0;
  max-width: 52ch;
}

/* Главная: герой */
.landing-hero {
  padding: 32px 34px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 40%, #e8f0fe 100%);
  border: 1px solid rgba(37, 99, 235, 0.18);
  overflow: hidden;
}

.landing-hero--home {
  padding: 40px 42px 24px;
  background: linear-gradient(145deg, #ffffff 0%, #eff6ff 35%, #dbeafe 100%);
  border: none;
  box-shadow: var(--shadow);
}

.landing-hero.landing-hero--home.card {
  border: none;
}

.landing-hero--home h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
}

.landing-hero--home .landing-stats {
  margin: 28px 0 0;
  padding: 20px 0 0;
}

.landing-hero--home .landing-stats strong {
  font-size: 1.35rem;
}

.landing-hero--home .landing-stats span {
  font-size: 0.92rem;
}

.eyebrow--home {
  color: var(--primary);
  font-weight: 800;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 1rem;
}

.landing-hero__layout {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px 40px;
  align-items: center;
}

.landing-hero__main {
  min-width: 0;
}

.landing-hero__emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.landing-hero__house-icon {
  display: block;
  width: min(240px, 26vw);
  height: auto;
  object-fit: contain;
}

.landing-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.landing-hero__lead {
  margin: 0 0 22px;
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 48ch;
  line-height: 1.6;
}

.landing-hero__lead--strong {
  font-weight: 700;
  color: var(--text);
}

.landing-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  list-style: none;
  margin: 28px 0 0;
  padding: 20px 0 0;
  width: fit-content;
  max-width: 100%;
  border-top: 1px solid rgba(37, 99, 235, 0.12);
}

.landing-stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.landing-stats strong {
  font-size: 1.1rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.landing-stats span {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Секции главной */
.section-head {
  text-align: center;
  margin-bottom: 24px;
}

.section-head--compact {
  margin-bottom: 18px;
  text-align: left;
}

.section-head__title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.section-head__lead {
  margin: 0;
  font-size: 0.95rem;
}

.features-section {
  margin: 28px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.feature-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  font-size: 1.4rem;
  margin-bottom: 14px;
}

.feature-card__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
}

.feature-card__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.steps-section {
  margin-top: 8px;
}

.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.steps-list__item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.steps-list__item p {
  margin: 4px 0 0;
  font-size: 0.9rem;
}

.steps-list__num {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}

/* Главная: единая типографика (блок hero без изменений) */
.home-content {
  font-size: 15px;
}

.home-content .section-head__title,
.home-content .feature-card__title,
.home-content .service-card__title,
.home-content .steps-list__item strong,
.home-content .info-list__item dt,
.home-content .quick-action__label,
.home-content .faq-item summary {
  font-size: 17px;
}

.home-content .features-section .section-head__title,
.home-content .services-section .section-head__title {
  font-size: 23px;
}

.home-content .steps-section .section-head__title,
.home-content .home-info__title,
.home-content .faq-section .section-head__title {
  font-size: 19px;
}

.home-content .home-info__title {
  margin-bottom: 8px;
}

.home-content .section-head__lead,
.home-content .feature-card__text,
.home-content .steps-list__item p,
.home-content .info-list__item dd,
.home-content .home-info__note,
.home-content .service-card__text,
.home-content .service-card__links,
.home-content .quick-action__hint,
.home-content .faq-item p {
  font-size: 15px;
}

/* Подвал */
.site-footer {
  margin-top: auto;
  background: var(--admin-chrome);
  color: #cbd5e1;
  padding: 18px 0 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.site-footer__brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.site-footer__brand strong {
  display: block;
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.site-footer__tagline {
  margin: 0;
  font-size: 0.88rem;
  color: #94a3b8;
}

.site-footer__contact {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: #94a3b8;
}

.site-footer__contact a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.site-footer__contact a:hover {
  color: #e2e8f0;
  text-decoration: underline;
}

.site-footer__legal {
  margin: 10px 0 0;
  font-size: 0.82rem;
}

.site-footer__legal a {
  color: #94a3b8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer__legal a:hover {
  color: #e2e8f0;
}

.site-footer__copy {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
}

/* Баннер согласия с политикой ПДн */
.privacy-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1200;
  padding: 14px 0 calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 23, 42, 0.96);
  color: #e2e8f0;
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.28);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.privacy-consent__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.privacy-consent__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
}

.privacy-consent__text a {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.privacy-consent__btn {
  flex-shrink: 0;
  min-width: 110px;
}

@media (max-width: 720px) {
  .privacy-consent__inner {
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  .privacy-consent__text {
    white-space: normal;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .privacy-consent__btn {
    width: auto;
    min-width: 0;
    padding-left: 14px;
    padding-right: 14px;
  }

  body.has-mobile-nav .privacy-consent {
    bottom: 64px;
  }
}

@media (max-width: 720px) {
  .landing-hero__layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .landing-hero__emblem {
    order: -1;
  }

  .landing-hero__house-icon {
    width: 160px;
  }

  .landing-hero__lead {
    max-width: none;
  }
}

/* Профиль */
.profile-page {
  max-width: 720px;
  margin: 0 auto;
}

.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 28px 30px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 48%, #eef2ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.profile-hero-text {
  flex: 1;
  min-width: 200px;
}

.profile-name {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.profile-role-badge {
  display: inline-block;
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.profile-avatar {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6 0%, #1d4ed8 50%, #1e3a8a 100%);
  box-shadow: 0 10px 28px rgba(29, 78, 216, 0.35);
  flex-shrink: 0;
}

.profile-section-title {
  margin: 0 0 18px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profile-tiles {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.profile-tile {
  padding: 16px 18px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: grid;
  gap: 6px;
}

.profile-tile-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.profile-tile-value {
  font-size: 1.02rem;
  font-weight: 600;
  word-break: break-word;
}

.profile-tile-lock {
  font-size: 0.78rem;
}

.form input[readonly] {
  background: #f1f5f9;
  color: #334155;
  cursor: default;
}

.profile-member-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.profile-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.profile-invite-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.profile-invite-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 8px 0;
}

.profile-invite-url {
  flex: 1;
  min-width: 0;
  width: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  margin: 0;
}

.profile-invite-copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.profile-invite-copy:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #94a3b8;
}

.profile-invite-copy.is-copied {
  color: #166534;
  border-color: #86efac;
  background: #f0fdf4;
}

.profile-contacts-form {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

.profile-contacts-form__lead {
  margin: 0 0 12px;
  font-size: 0.92rem;
}

.profile-contacts-form__grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 14px;
}

.profile-hint {
  background: linear-gradient(180deg, #fafbfc 0%, #f4f6f9 100%);
}

.profile-hint-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 58ch;
}

.profile-logout {
  display: flex;
  justify-content: center;
  margin: 8px 0 24px;
}

.profile-logout__btn {
  min-width: 160px;
  padding: 12px 28px;
  font-weight: 700;
}

.ticket-created {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.ticket-parties {
  margin: 12px 0 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.ticket-party-line {
  margin: 0 0 8px;
}

.ticket-party-line:last-child {
  margin-bottom: 0;
}

.admin-page {
  max-width: 960px;
  margin: 0 auto;
}

.admin-header .page-title {
  margin-bottom: 8px;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.admin-stat {
  text-align: center;
  padding: 20px 16px;
}

.admin-stat-value {
  display: block;
  font-size: 2.035rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.admin-stat-label {
  display: block;
  margin-top: 6px;
  font-size: 0.935rem;
  color: var(--muted);
  font-weight: 600;
}

.main-content.wrap:has(.admin-shell) {
  max-width: none;
  width: 100%;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  /* padding-bottom не трогаем — нужен отступ под мобильное меню */
}

body.layout-admin {
  background: #eef2f7;
}

body.layout-admin .main-content .flash {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}

.admin-shell {
  display: grid;
  grid-template-columns: minmax(220px, 270px) 1fr;
  gap: 0;
  max-width: none;
  margin: 0;
  width: 100%;
  min-height: calc(100vh - 62px);
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  background: transparent;
  border: 0;
}

@media (max-width: 820px) {
  .admin-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .admin-main {
    padding: 16px 14px 28px;
  }

  .admin-hero {
    margin-bottom: 16px;
  }

  .admin-hero-title {
    font-size: 1.45rem;
  }

  .admin-hero-lead {
    font-size: 0.95rem;
    max-width: none;
  }

  .admin-hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .admin-stat-card {
    padding: 14px;
    gap: 10px;
  }

  .admin-stat-card .admin-stat-value {
    font-size: 1.45rem;
  }

  .admin-panel.card,
  .admin-panel .card {
    padding: 16px;
  }

  .admin-chart-panel {
    padding: 16px;
  }

  .admin-filters {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .admin-filter-actions {
    width: 100%;
  }

  .admin-filter-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .admin-inline-role {
    width: 100%;
  }

  .admin-inline-role .admin-role-select {
    flex: 1;
    min-width: 0;
    width: 100%;
  }

  .admin-inline-role .btn {
    flex: 1;
    justify-content: center;
  }

  .admin-user-actions {
    width: 100%;
  }

  .admin-user-actions .inline-form {
    width: 100%;
  }

  .admin-user-actions .inline-form .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-role-confirm__box {
    padding: 20px 18px;
  }

  .admin-role-confirm__actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .admin-role-confirm__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .admin-main > .narrow-admin-form {
    max-width: none;
  }

  .admin-hero-lead .btn {
    display: flex;
    width: 100%;
    margin-top: 10px;
    justify-content: center;
  }

  .admin-chat-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-chat-form input[type="text"] {
    width: 100%;
    flex: 0 0 auto;
    min-height: 44px;
    height: auto;
  }

  .admin-chat-form .btn {
    width: 100%;
    flex: 0 0 auto;
    justify-content: center;
  }
}

.admin-sidebar {
  background: var(--admin-chrome);
  color: #e2e8f0;
  padding: 20px 18px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-sidebar-head {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-sidebar-title {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.admin-sidebar-sub {
  display: block;
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 4px;
}

.admin-side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-side-link {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 600;
  transition: background 0.12s, color 0.12s;
}

.admin-side-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.admin-side-link.is-active {
  color: #fff;
  background: rgba(37, 99, 235, 0.45);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35);
}

.admin-sidebar-foot {
  margin-top: auto;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #64748b;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-main {
  padding: 26px 28px 40px;
  background: linear-gradient(180deg, #fafbfc 0%, #eef2f7 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
}

.admin-main > * {
  width: 100%;
  max-width: none;
}

.admin-hero {
  margin-bottom: 22px;
}

.admin-hero-title {
  margin: 0 0 8px;
  font-size: 1.815rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.admin-hero-lead {
  margin: 0;
  font-size: 1.045rem;
  color: var(--muted);
  max-width: 60ch;
}

.admin-hero-lead--inline {
  max-width: none;
}

@media (min-width: 821px) {
  .admin-hero-lead--single-line {
    white-space: nowrap;
  }
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.admin-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.admin-stat-icon {
  font-size: 1.925rem;
  line-height: 1;
  opacity: 0.9;
}

.admin-stat-card .admin-stat-value {
  display: block;
  font-size: 1.815rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.admin-stat-card .admin-stat-label {
  display: block;
  margin-top: 2px;
  font-size: 0.902rem;
  color: var(--muted);
  font-weight: 600;
}

.admin-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.admin-panel-title {
  margin: 0 0 14px;
  font-size: 1.155rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-panel-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.admin-panel-head-row .admin-panel-title {
  margin: 0;
}

.admin-panel .card,
.admin-panel.card {
  margin: 0;
}

.admin-main > .admin-panel.card + .admin-panel.card {
  margin-top: 20px;
}

.admin-panel.card.admin-chart-panel {
  margin-bottom: 0;
}

.admin-role-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 1.012rem;
  line-height: 1.65;
}

.admin-role-list li {
  margin-bottom: 8px;
}

.admin-table-wrap {
  overflow-x: auto;
  margin: -4px;
  padding: 4px;
  width: 100%;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.99rem;
  table-layout: auto;
}

.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.admin-table th {
  font-size: 0.792rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  background: #f8fafc;
}

.admin-table tbody tr:hover {
  background: #f8fafc;
}

.admin-table .admin-table__actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.admin-table .admin-table__go {
  min-width: 88px;
  justify-content: center;
}

.admin-table-sort-th {
  white-space: nowrap;
}

.admin-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
}

.admin-table-sort:hover {
  color: var(--primary);
}

.admin-table-sort__icon {
  font-size: 0.95em;
  line-height: 1;
  color: var(--primary);
  font-weight: 800;
}

.admin-table-sort:not(.is-active) .admin-table-sort__icon {
  color: #94a3b8;
  font-weight: 600;
}

.admin-table-sort--mobile {
  display: none;
  margin-left: auto;
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--primary);
}

.admin-filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.admin-pill {
  display: inline-block;
  min-width: 2em;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  text-align: center;
}

.admin-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.825rem;
  font-weight: 700;
}

.admin-badge--res { background: #dbeafe; color: #1e40af; }
.admin-badge--asg { background: #fef3c7; color: #92400e; }
.admin-badge--adm { background: #ede9fe; color: #5b21b6; }
.admin-badge--ok { background: #dcfce7; color: #166534; }
.admin-badge--muted { background: #f1f5f9; color: #64748b; }

.admin-stars {
  letter-spacing: 1px;
  color: #f59e0b;
  margin-right: 6px;
}

.admin-hero-actions {
  margin: 12px 0 0;
}

.admin-inline-role {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-chat-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.admin-chat-form input[type="text"] {
  flex: 1 1 200px;
  min-width: 0;
  width: auto;
  height: auto;
  min-height: 44px;
  align-self: center;
}

.admin-chat-form .btn {
  flex: 0 0 auto;
  align-self: center;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.admin-user-actions .inline-form {
  display: inline-flex;
  margin: 0;
}

.admin-check-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.admin-check-label--inline {
  font-weight: 500;
  white-space: nowrap;
}

/* [hidden] перекрывался display:grid/flex у .form label — поля «протекали» */
.form label[hidden],
.form [hidden],
.admin-flag[hidden],
.admin-house-picker[hidden] {
  display: none !important;
}

.admin-flag {
  margin: 4px 0;
}

.admin-flag__label {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
  font-weight: 500;
}

.admin-flag__label:hover {
  border-color: rgba(37, 99, 235, 0.35);
  background: #f0f7ff;
}

.admin-flag__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  pointer-events: none;
}

.admin-flag__box {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border: 2px solid #94a3b8;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
  position: relative;
}

.admin-flag__input:checked + .admin-flag__box {
  border-color: #2563eb;
  background: #2563eb;
}

.admin-flag__input:checked + .admin-flag__box::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.admin-flag__input:focus-visible + .admin-flag__box {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.admin-flag__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-flag__title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #0f172a;
}

.admin-flag__hint {
  font-weight: 500;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.35;
}

.pdn-consent {
  margin: 12px 0 4px;
}

.pdn-consent .admin-flag__hint a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-staff-profile-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-staff-profile-form input[type="text"] {
  min-width: 140px;
  max-width: 200px;
}

.admin-topics-form select,
.admin-topics-house-filter .topic-picker,
.admin-assignee-picker {
  width: 100%;
  max-width: 420px;
}

.admin-assignee-picker {
  max-width: 100%;
}

.admin-assignee-picker .topic-picker__trigger {
  min-height: 52px;
}

.admin-topics-form .form-actions {
  margin-top: 16px;
}

.admin-topics-save-banner {
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.admin-topics-save-banner.is-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.admin-topics-save-banner.is-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.admin-topics-house-filter {
  margin: 12px 0 20px;
}

.admin-topics-block {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.admin-topics-memo {
  margin: 0 0 18px;
  padding: 16px 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.admin-topics-memo__title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.admin-topics-memo__list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.45;
}

.admin-topics-memo__list strong {
  color: #0f172a;
  font-weight: 700;
}

@media (max-width: 820px) {
  .admin-topics-memo {
    margin-bottom: 14px;
    padding: 14px 14px;
  }
}

.admin-topics-create-form {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.admin-topics-inline-form {
  display: inline-flex;
  margin: 0 4px 4px 0;
}

.admin-topics-danger {
  color: #b91c1c !important;
}

.admin-topics-table .admin-table__actions {
  white-space: normal;
}

@media (max-width: 720px) {
  .admin-topics-table.admin-table--stack tbody tr {
    padding: 16px;
    margin-bottom: 14px;
  }

  .admin-topics-table.admin-table--stack td {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
    gap: 6px;
  }

  .admin-topics-table.admin-table--stack td::before {
    flex: none;
    max-width: none;
  }

  .admin-topics-table .admin-topics-assignee-cell {
    padding-top: 10px;
  }

  .admin-topics-table .admin-assignee-picker {
    max-width: none;
  }

  .admin-topics-house-filter .topic-picker {
    max-width: none;
  }

  .admin-topics-create-form {
    max-width: none;
  }
}

.admin-role-select {
  width: auto;
  min-width: 130px;
  padding: 8px 10px;
  font-size: 0.968rem;
}

.admin-main > .narrow-admin-form {
  max-width: 520px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.admin-main > .narrow-admin-form--wide {
  max-width: 1040px;
}

.admin-main > .narrow-admin-form .form label {
  font-weight: 700;
  font-size: 1.22rem;
}

.admin-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px 16px;
  align-items: end;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5e7eb;
}

.admin-filters--house {
  grid-template-columns: 1fr;
  align-items: start;
}

.admin-house-picker {
  width: 100%;
  max-width: 640px;
}

.admin-house-picker .admin-filter-label,
.admin-house-picker .field-label {
  display: block;
  margin-bottom: 6px;
}

.admin-house-picker .topic-picker__trigger {
  min-height: 52px;
}

.admin-filter-field {
  display: grid;
  gap: 6px;
  margin: 0;
}

.admin-filter-label {
  font-size: 0.792rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.admin-filter-field input,
.admin-filter-field select {
  padding: 9px 11px;
  font-size: 1.012rem;
}

.admin-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-reports-toolbar-form {
  margin: 0;
}

.admin-reports-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-reports-panel .admin-panel-title,
.admin-reports-panel .admin-filter-summary,
.admin-reports-panel .admin-reports-toolbar-form {
  margin: 0;
}

.admin-reports-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-reports-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.admin-reports-toolbar__month {
  display: grid;
  gap: 6px;
  margin: 0;
  min-width: min(100%, 220px);
}

.admin-reports-toolbar__month input[type="month"] {
  padding: 9px 11px;
  font-size: 1.012rem;
  min-height: 42px;
  box-sizing: border-box;
}

.admin-reports-toolbar__export {
  flex-shrink: 0;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.admin-reports-filter {
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: 0;
}

.admin-reports-detail-table {
  font-size: 0.95rem;
}

.admin-reports-table tfoot td {
  background: #f8fafc;
  border-top: 2px solid #e2e8f0;
  font-weight: 700;
}

.admin-report-overdue {
  color: #b91c1c;
  font-weight: 800;
}

.admin-filter-summary {
  margin: 0 0 14px;
  font-size: 0.99rem;
}

.admin-filter-summary strong {
  color: var(--primary);
}

.admin-main .btn {
  font-size: 1.045rem;
}

.admin-main .btn-sm {
  font-size: 14.3px;
}

.admin-main .status-badge,
.admin-main .status-overdue {
  font-size: 0.858rem;
}

.admin-main .muted {
  font-size: 0.99rem;
}

.admin-main .form label {
  font-size: 1.012rem;
}

.admin-main input,
.admin-main select,
.admin-main textarea {
  font-size: 1.1rem;
}

.admin-role-confirm {
  border: 0;
  padding: 0;
  max-width: min(480px, calc(100vw - 32px));
  background: transparent;
}

.admin-role-confirm::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.admin-role-confirm__box {
  padding: 24px 26px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
}

.admin-role-confirm__title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.admin-role-confirm__text {
  margin: 0 0 10px;
  font-size: 1.02rem;
  line-height: 1.55;
}

.admin-role-confirm__admin {
  color: #b91c1c;
  font-weight: 800;
}

.admin-role-confirm__hint {
  margin: 0 0 18px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.admin-role-confirm__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.login-fio-dialog__form {
  margin-top: 12px;
}

.login-fio-dialog__form label {
  display: block;
  margin-bottom: 8px;
}

.login-fio-dialog__form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  font-size: 16px; /* без автозума iOS */
}

.login-fio-dialog__hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.login-fio-dialog__error {
  margin: 0 0 12px;
}

.login-fio-dialog .admin-role-confirm__actions {
  margin-top: 4px;
}

.login-fio-dialog {
  margin: auto;
  max-width: min(480px, calc(100vw - 24px));
  max-height: min(92dvh, calc(100vh - 24px));
}

.login-fio-dialog .admin-role-confirm__box {
  max-height: min(88dvh, calc(100vh - 32px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 520px) {
  .profile-member-item {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-member-item .inline-form .btn {
    width: 100%;
  }

  .profile-invite-url {
    font-size: 0.78rem;
  }

  .profile-invite-copy {
    width: 44px;
    min-height: 44px;
  }

  .login-fio-dialog .admin-role-confirm__box {
    padding: 18px 16px;
  }

  .login-fio-dialog .admin-role-confirm__title {
    font-size: 1.15rem;
  }

  .login-fio-dialog .admin-role-confirm__text {
    font-size: 0.95rem;
  }
}

/* ПК: +10% к базовому размеру (как масштаб 110% в Chrome) */
@media (min-width: 769px) {
  html {
    font-size: 110%;
  }

  /* Админ-раздел плотнее, но шапка сайта — как везде */
  html:has(body.layout-admin) {
    font-size: 100%;
  }

  body.layout-admin .topbar .brand {
    font-size: 1.21rem;
  }

  body.layout-admin .topbar .nav-links a,
  body.layout-admin .topbar .nav-links .link-btn {
    font-size: 1.1rem;
  }
}

.workspace-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 24px;
  max-width: var(--layout-max-width);
  margin: 0 auto;
}

.workspace-page > .card,
.workspace-page > .workspace-kpi-grid {
  margin: 0;
}

.workspace-hero {
  padding: 26px 28px;
  background: linear-gradient(135deg, #fff 0%, #eff6ff 55%, #eef2ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.workspace-title {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.workspace-lead {
  margin: 0;
  max-width: 58ch;
}

.workspace-hero-actions {
  margin: 16px 0 0;
}

.news-page-actions {
  margin: 0 0 16px;
}

.news-publish-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.news-publish-bar__hint {
  margin: 0;
  font-size: 0.92rem;
}

.news-create-hero__action {
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.workspace-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.workspace-kpi-grid > .card {
  margin: 0;
}

.workspace-kpi {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 14px;
}

.workspace-kpi--accent {
  background: linear-gradient(160deg, #fffbeb 0%, #fff 100%);
  border: 1px solid #fde68a;
}

.workspace-kpi-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.workspace-kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
}

.workspace-kpi--accent .workspace-kpi-value {
  color: #b45309;
}

.workspace-kpi-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

.workspace-two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.workspace-panel {
  margin: 0;
}

.workspace-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.workspace-panel-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.link-inline {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.link-inline:hover {
  text-decoration: underline;
}

.workspace-list {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.65;
  font-size: 0.95rem;
}

.workspace-list li {
  margin-bottom: 8px;
}

.workspace-remind-text {
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.workspace-remind-form {
  margin: 0;
}

.workspace-table-wrap {
  overflow-x: auto;
}

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

.workspace-table th,
.workspace-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.workspace-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.workspace-chat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.workspace-chat-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.workspace-chat-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
  margin-bottom: 6px;
}

.workspace-chat-author {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 4px;
}

.workspace-chat-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.45;
}

.text-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.text-link:hover {
  text-decoration: underline;
  color: var(--primary-hover);
}

.news-page-hero {
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 45%, #eff6ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.news-page-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

.news-page-lead {
  margin: 0;
  max-width: 52ch;
  font-size: 1.02rem;
}

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.news-feed-card {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0;
  background: var(--surface);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.2);
  transition: box-shadow 0.2s, transform 0.2s;
  min-height: 220px;
  height: 220px;
  align-items: stretch;
}

.news-feed-card:hover {
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
  transform: translateY(-2px);
}

.news-feed-card__media-link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.news-feed-card__media {
  height: 100%;
  min-height: 0;
  background: linear-gradient(160deg, #e0e7ff 0%, #dbeafe 40%, #f1f5f9 100%);
}

.news-feed-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.news-feed-card__placeholder {
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: linear-gradient(145deg, #1e3a8a 0%, #1d4ed8 50%, #3b82f6 100%);
  color: #e0e7ff;
}

.news-feed-card__placeholder-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.news-feed-card__placeholder-text {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.news-feed-card__body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
  min-height: 0;
  overflow: hidden;
}

.news-feed-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 0.86rem;
  color: var(--muted);
  flex-shrink: 0;
}

.news-feed-card__date {
  font-weight: 600;
  color: var(--muted);
}

.news-feed-card__author {
  color: var(--muted);
}

.news-feed-card__badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  font-size: 0.78rem;
}

.news-feed-card__title {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-feed-card__title a {
  color: var(--text);
  text-decoration: none;
}

.news-feed-card__title a:hover {
  color: var(--primary);
}

.news-feed-card__snippet {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

.news-feed-card__cta {
  margin-top: auto;
  align-self: flex-start;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
}

.news-feed-card__cta:hover {
  text-decoration: underline;
}

.news-empty {
  text-align: center;
  padding: 36px 24px;
}

@media (max-width: 800px) {
  .news-feed-card {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .news-feed-card__media-link,
  .news-feed-card__media,
  .news-feed-card__placeholder {
    height: 180px;
    min-height: 180px;
    max-height: 180px;
  }

  .news-feed-card__media img {
    height: 180px;
    max-height: 180px;
  }

  .news-feed-card__body {
    padding: 16px 18px 18px;
  }
}

.news-home-block {
  margin-top: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.news-home-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.news-home-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.news-home-sub {
  margin: 0;
  font-size: 0.92rem;
}

.news-home-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.news-home-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s;
}

.news-home-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.news-home-card__media-link {
  display: block;
  text-decoration: none;
}

.news-home-card__media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, #e0e7ff 0%, #dbeafe 100%);
  overflow: hidden;
}

.news-home-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-home-card__placeholder {
  width: 100%;
  height: 100%;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 100%);
  color: #e0e7ff;
  font-weight: 700;
  font-size: 0.9rem;
}

.news-home-card__body {
  padding: 14px 16px 16px;
}

.news-home-card__date {
  font-size: 0.8rem;
  display: block;
  margin-bottom: 6px;
}

.news-home-card__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.news-home-card__title a {
  color: var(--text);
  text-decoration: none;
}

.news-home-card__title a:hover {
  color: var(--primary);
}

.news-home-card__snippet {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 900px) {
  .news-home-grid {
    grid-template-columns: 1fr;
  }
}

.news-article h1 {
  margin-top: 8px;
}

.news-back {
  margin: 0 0 12px;
}

.news-detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
}

.news-detail-actions--admin {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.news-detail-actions__form {
  display: block;
  margin: 0;
  width: 100%;
}

.news-detail-actions__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  margin: 0;
  text-align: center;
}

@media (min-width: 721px) {
  .news-detail-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
  }

  .news-detail-actions__form {
    width: auto;
    flex: 1 1 180px;
  }

  .news-detail-actions__btn {
    width: auto;
    flex: 1 1 180px;
  }

  .news-detail-actions__form .news-detail-actions__btn {
    width: 100%;
  }
}

.news-meta {
  margin: 0 0 20px;
  font-size: 0.95rem;
}

.news-cover {
  margin: 0 0 22px;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: var(--shadow-sm);
  background: #e2e8f0;
}

.news-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: cover;
}

.news-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  margin-top: 24px;
  width: 100%;
}

.news-gallery--single {
  grid-template-columns: 1fr;
}

.news-gallery-item {
  margin: 0;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #f1f5f9;
  box-shadow: var(--shadow-sm);
}

.news-gallery-item .lightbox-item {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
  cursor: zoom-in;
}

.news-gallery-item img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f8fafc;
}

.news-gallery--single .news-gallery-item img {
  height: auto;
  max-height: min(70vh, 520px);
  object-fit: contain;
  background: #0f172a08;
}

@media (max-width: 640px) {
  .news-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .news-gallery--single {
    grid-template-columns: 1fr;
  }

  .news-gallery-item img {
    height: 132px;
  }

  .news-gallery--single .news-gallery-item img {
    height: auto;
    max-height: 55vh;
  }
}

.news-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 1rem;
  line-height: 1.65;
  margin-bottom: 4px;
}

.news-houses-field {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}

.news-houses-field > legend {
  padding: 0 4px;
  float: none;
  width: auto;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #64748b;
}

.news-houses-field__hint {
  margin: 4px 0 12px;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.4;
  color: #64748b;
}

.news-houses-field__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
}

/* Перебиваем .form label / narrow-admin-form (1.22rem + 700) */
.form .news-houses-field__item,
.admin-main .form .news-houses-field__item,
.admin-main > .narrow-admin-form .form .news-houses-field__item,
.news-new-form .news-houses-field__item {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 8px 6px;
  border-radius: 10px;
  font-weight: 400 !important;
  font-size: 0.9rem !important;
  line-height: 1.4;
  color: #334155;
  cursor: pointer;
  grid-template-columns: none !important;
}

.form .news-houses-field__item:hover,
.admin-main .form .news-houses-field__item:hover,
.news-new-form .news-houses-field__item:hover {
  background: #f8fafc;
}

.form .news-houses-field__item input,
.admin-main .form .news-houses-field__item input,
.news-new-form .news-houses-field__item input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

.form .news-houses-field__item span,
.admin-main .form .news-houses-field__item span,
.news-new-form .news-houses-field__item span {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.form .news-houses-field__item--all,
.admin-main .form .news-houses-field__item--all,
.admin-main > .narrow-admin-form .form .news-houses-field__item--all,
.news-new-form .news-houses-field__item--all {
  margin-bottom: 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  font-weight: 600 !important;
  font-size: 0.92rem !important;
  color: #1e293b;
}

.form .news-houses-field__item--all:hover,
.admin-main .form .news-houses-field__item--all:hover,
.news-new-form .news-houses-field__item--all:hover {
  background: transparent;
}

.news-new-photos-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 400;
}

@media (max-width: 640px) {
  .news-houses-field {
    padding: 12px;
  }

  .form .news-houses-field__item,
  .admin-main .form .news-houses-field__item,
  .news-new-form .news-houses-field__item {
    min-height: 44px;
    align-items: center;
    padding: 10px 6px;
  }

  .form .news-houses-field__item input,
  .admin-main .form .news-houses-field__item input,
  .news-new-form .news-houses-field__item input {
    margin-top: 0;
    width: 20px;
    height: 20px;
  }
}

.news-admin-actions {
  margin: 0 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.news-delete-form {
  margin: 0;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.notifications-page .notifications-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.notifications-title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.notifications-lead {
  margin: 0;
  max-width: 52ch;
  font-size: 0.92rem;
}

.notify-feed {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notify-feed__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px 16px;
  align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.notify-feed__item:hover {
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: var(--shadow-sm);
}

.notify-feed__item--status-new {
  border-left: 4px solid #3b82f6;
}

.notify-feed__item--status-in_progress {
  border-left: 4px solid #f59e0b;
}

.notify-feed__item--status-closed {
  border-left: 4px solid #22c55e;
}

.notify-feed__item--message {
  border-left: 4px solid #6366f1;
}

.notify-feed__item--news {
  border-left: 4px solid #0ea5e9;
}

.notify-feed__item--assign {
  border-left: 4px solid #8b5cf6;
}

.notify-feed__item--rating {
  border-left: 4px solid #eab308;
}

.notify-feed__item--deadline,
.notify-feed__item--deadline-overdue {
  border-left: 4px solid #ef4444;
}

.notify-feed__icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #fff;
  font-size: 1.25rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.notify-feed__body {
  min-width: 0;
}

.notify-feed__title {
  margin: 0 0 4px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.notify-feed__hint {
  margin: 0 0 6px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.notify-feed__time {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.notify-feed__action {
  flex-shrink: 0;
}

.notify-feed__more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.notify-feed__count {
  margin: 0;
  font-size: 0.88rem;
}

.notifications-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.notifications-item {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 16px 20px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.notifications-item:last-child {
  border-bottom: 0;
}

.notifications-item__time {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.45;
}

.notifications-item__text {
  margin: 0 0 8px;
  font-size: 0.98rem;
  line-height: 1.5;
  color: var(--text);
}

.notifications-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notifications-empty {
  margin: 12px 0 0;
}

@media (max-width: 640px) {
  .notify-feed__item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .notify-feed__action {
    grid-column: 1 / -1;
    justify-self: start;
    padding-left: 58px;
  }
}

@media (max-width: 560px) {
  .notifications-item {
    grid-template-columns: 1fr;
  }

  .notifications-item__time {
    font-size: 0.82rem;
  }
}

.status-overdue {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  vertical-align: middle;
}

.status-overdue--inline {
  margin-left: 6px;
}

.ticket-status-line .status-overdue {
  margin-top: 4px;
  margin-left: 0;
}

.ticket-due-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
}

.ticket-due-line .status-overdue {
  margin-left: 0;
}

/* Единый стиль страниц (как главная для гостей) */
.page-hero {
  padding: 28px 32px;
  background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 40%, #e8f0fe 100%);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.page-hero__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

.page-hero__title {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-hero__lead {
  margin: 0;
  font-size: 1rem;
  max-width: 52ch;
  line-height: 1.6;
}

.page-hero__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-hero__icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  font-size: 2rem;
  box-shadow: var(--shadow-sm);
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  gap: 22px;
  align-items: start;
  margin: 22px 0;
}

.page-layout--solo {
  grid-template-columns: 1fr;
}

.page-layout--auth .page-layout__main,
.page-layout--news .page-layout__main {
  min-width: 0;
}

/* Страница новостей — на всю ширину */
.news-page {
  max-width: var(--layout-max-width);
  margin: 0 auto;
}

.news-auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 200px);
  min-height: calc(100dvh - 200px);
  padding: 16px 0 32px;
}

.news-auth-gate__card {
  width: min(480px, 100%);
  margin: 0;
  padding: 40px 32px;
  text-align: center;
}

.news-auth-gate__icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 16px;
}

.news-auth-gate__title {
  margin: 0 0 12px;
  font-size: clamp(1.2rem, 3.5vw, 1.45rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.news-auth-gate__lead {
  margin: 0 0 24px;
  line-height: 1.6;
}

.news-auth-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.news-page-info {
  margin: 0 0 22px;
}

.news-page-info__card {
  margin: 0;
  width: 100%;
}

.news-page-info .info-bullets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 28px;
  font-size: 0.98rem;
  line-height: 1.7;
}

.news-page-info .info-bullets li {
  margin-bottom: 10px;
}

.news-page-info__title {
  margin: 0 0 16px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.news-page-info .info-list {
  gap: 16px;
}

.news-page-info .info-list__item dt {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.news-page-info .info-list__item dd {
  font-size: 0.98rem;
  line-height: 1.6;
}

.news-page-feed {
  margin: 0;
  padding: 22px 24px 24px;
}

.news-page .news-feed {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.news-page .news-feed-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  height: 200px;
  min-height: 200px;
}

.news-page .news-feed-card__media-link,
.news-page .news-feed-card__media,
.news-page .news-feed-card__placeholder {
  height: 100%;
  min-height: 0;
  max-height: none;
}

.news-page .news-feed-card__media img {
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: cover;
}

.news-page .news-feed-card__body {
  padding: 16px 20px;
}

.news-page .news-feed-card__title {
  font-size: 1.12rem;
}

.news-page .news-feed-card__snippet {
  font-size: 0.95rem;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

@media (max-width: 768px) {
  .news-page-info .info-bullets {
    grid-template-columns: 1fr;
  }

  .news-page .news-feed-card {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .news-page .news-feed-card__media-link,
  .news-page .news-feed-card__media,
  .news-page .news-feed-card__placeholder {
    height: 180px;
    min-height: 180px;
    max-height: 180px;
  }

  .news-page .news-feed-card__media img {
    height: 180px;
    max-height: 180px;
  }
}

.page-layout__main {
  min-width: 0;
}

.page-layout__main > .card,
.page-layout__main > section {
  margin-top: 0;
}

.page-layout__aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.page-layout__aside .info-aside {
  margin: 0;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0 0 22px;
}

.quick-action {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--text);
}

.quick-action__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.quick-action__label {
  font-weight: 700;
  font-size: 0.95rem;
}

.quick-action__hint {
  font-size: 0.78rem;
  line-height: 1.35;
}

.info-aside {
  padding: 20px 22px;
}

.info-aside__title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.info-aside__body {
  font-size: 0.9rem;
}

.info-aside__action {
  margin: 14px 0 0;
}

.info-aside__body p {
  margin: 0 0 10px;
}

.info-aside__body p:last-child {
  margin-bottom: 0;
}

.info-aside__phone {
  margin-top: 4px;
}

.info-aside__phone a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.info-aside__phone a:hover {
  text-decoration: underline;
}

.info-list {
  margin: 0;
  display: grid;
  gap: 14px;
}

.info-list__item dt {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 4px;
}

.info-list__item dd {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.info-bullets {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.65;
  font-size: 0.88rem;
}

.info-bullets li {
  margin-bottom: 8px;
}

.section-inline-lead {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.field-hint {
  font-size: 0.82rem;
}

.steps-section--compact {
  margin-top: 0;
}

.status-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  font-size: 0.92rem;
}

.status-legend__pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-right: 6px;
}

.status-legend__pill--new { background: #dbeafe; color: #1e40af; }
.status-legend__pill--progress { background: #fef3c7; color: #92400e; }
.status-legend__pill--closed { background: #dcfce7; color: #166534; }

.empty-state {
  padding: 24px 8px;
  text-align: center;
}

.empty-state__title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 1.05rem;
}

.ticket-back {
  margin: 10px 0 16px;
}

body.layout-resident .main-content,
body.layout-assignee .main-content,
body.layout-guest .main-content {
  padding-top: 24px;
}

.profile-hint-text {
  margin: 0 0 12px;
  line-height: 1.65;
}

.profile-hint-text:last-child {
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .page-hero__grid {
    grid-template-columns: 1fr;
  }

  .page-hero__icon-wrap {
    justify-content: flex-start;
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .quick-actions {
    grid-template-columns: 1fr;
  }
}

/* --- UI enhancements --- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.link-inline {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.link-inline:hover {
  text-decoration: underline;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge--new { background: #dbeafe; color: #1e40af; }
.status-badge--in_progress { background: #fef3c7; color: #92400e; }
.status-badge--closed { background: #dcfce7; color: #166534; }
.status-badge--cancelled { background: #f1f5f9; color: #475569; }

.status-legend__pill--cancelled { background: #f1f5f9; color: #475569; }

/* Ticket progress */
.ticket-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 20px;
  padding: 16px 8px;
}

.ticket-progress__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 72px;
}

.ticket-progress__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: #e2e8f0;
  color: #64748b;
  border: 2px solid #cbd5e1;
}

.ticket-progress__label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-align: center;
}

.ticket-progress__line {
  flex: 1;
  height: 3px;
  background: #e2e8f0;
  margin: 0 4px;
  margin-bottom: 22px;
  border-radius: 2px;
}

/* Новая — единица синяя */
.ticket-progress--new .ticket-progress__step.is-current .ticket-progress__dot {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}

.ticket-progress--new .ticket-progress__step.is-current .ticket-progress__label {
  color: #2563eb;
  font-weight: 800;
}

/* В работе — 1, полоска и 2 жёлтые */
.ticket-progress--in_progress .ticket-progress__step.is-done .ticket-progress__dot,
.ticket-progress--in_progress .ticket-progress__step.is-current .ticket-progress__dot {
  background: #fbbf24;
  color: #78350f;
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.ticket-progress--in_progress .ticket-progress__line.is-done {
  background: #fbbf24;
}

.ticket-progress--in_progress .ticket-progress__step.is-done .ticket-progress__label,
.ticket-progress--in_progress .ticket-progress__step.is-current .ticket-progress__label {
  color: #b45309;
  font-weight: 800;
}

/* Закрыта — всё зелёное, цифра 3 видна */
.ticket-progress--closed .ticket-progress__step.is-done .ticket-progress__dot,
.ticket-progress--closed .ticket-progress__step.is-current .ticket-progress__dot {
  background: #22c55e;
  color: #fff;
  border-color: #16a34a;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

.ticket-progress--closed .ticket-progress__line.is-done {
  background: #22c55e;
}

.ticket-progress--closed .ticket-progress__step.is-done .ticket-progress__label,
.ticket-progress--closed .ticket-progress__step.is-current .ticket-progress__label {
  color: #15803d;
  font-weight: 800;
}

.ticket-progress--cancelled {
  justify-content: flex-start;
}

.ticket-progress--cancelled .ticket-progress__step.is-cancelled .ticket-progress__dot {
  background: #94a3b8;
  color: #fff;
  border-color: #64748b;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.25);
}

.ticket-progress--cancelled .ticket-progress__step.is-cancelled .ticket-progress__label {
  color: #475569;
  font-weight: 800;
}

.ticket-cancel-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.ticket-cancel-form__btn {
  color: #b91c1c;
  border-color: #fecaca;
  min-height: 44px;
}

.ticket-cancel-form__btn:hover,
.ticket-cancel-form__btn:focus-visible {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fca5a5;
}

.profile-password-link {
  display: inline-flex;
}

.profile-password-hint {
  margin-top: 12px;
}

.news-new-body {
  min-height: 140px;
  max-height: 50vh;
  resize: vertical;
}

.news-new-form {
  display: grid;
  gap: 16px;
}

.news-new-field {
  width: 100%;
}

.news-new-house-picker {
  margin: 0;
}

.news-new-house-picker .topic-picker__trigger-main {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.news-new-form > .btn {
  justify-self: start;
  min-height: 44px;
}

@media (max-width: 640px) {
  .news-new-form > .btn {
    width: 100%;
    justify-self: stretch;
    justify-content: center;
  }

  .news-new-house-picker .topic-picker__trigger {
    min-height: 52px;
  }

  .news-new-body {
    min-height: 120px;
    max-height: 40vh;
  }
}

/* Important banner */
.important-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  margin-bottom: 16px;
  text-decoration: none;
  color: inherit;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid #f59e0b;
  transition: transform 0.15s, box-shadow 0.15s;
}

.important-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.important-banner__label {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.important-banner__text {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.important-banner__arrow {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: #92400e;
}

/* Ticket cards */
.ticket-cards {
  display: grid;
  gap: 10px;
}

.ticket-cards--full {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.ticket-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.ticket-card:hover {
  border-color: var(--accent);
  background: #f8fafc;
}

.ticket-card--full {
  flex-direction: column;
  align-items: flex-start;
}

.ticket-card__num {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
}

.ticket-card__title {
  flex: 1;
  font-size: 0.92rem;
}

.ticket-card__meta {
  font-size: 0.82rem;
}

/* Tickets toolbar */
.tickets-toolbar {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.tickets-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-left: auto;
}

.tickets-filter {
  margin: 0;
}

.tickets-filter__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.tickets-filter select,
.status-select__native {
  min-width: 160px;
  min-height: 42px;
}

.status-select {
  position: relative;
  min-width: 180px;
}

.status-select.is-enhanced .status-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.status-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.status-select__trigger:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}

.status-select__trigger:focus-visible,
.status-select.is-open .status-select__trigger {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: #fff;
}

.status-select__trigger-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.status-select__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex-shrink: 0;
  background: #94a3b8;
}

.status-select__dot--new { background: #3b82f6; }
.status-select__dot--in_progress { background: #f59e0b; }
.status-select__dot--closed { background: #22c55e; }
.status-select__dot--cancelled { background: #94a3b8; }
.status-select__dot--all,
.status-select__dot--active { background: var(--primary); }
.status-select__dot--empty { background: #94a3b8; }
.status-select__dot--stars-1 { background: #ef4444; }
.status-select__dot--stars-2 { background: #f97316; }
.status-select__dot--stars-3 { background: #eab308; }
.status-select__dot--stars-4 { background: #84cc16; }
.status-select__dot--stars-5 { background: #22c55e; }

.ticket-rate-form {
  display: grid;
  gap: 10px;
  max-width: 280px;
}

.ticket-rate-form .tickets-filter__label {
  margin: 0;
}

.ticket-rate-form .status-select {
  width: 100%;
  min-width: 0;
}

.status-select__chevron {
  width: 10px;
  height: 10px;
  border-right: 2px solid #64748b;
  border-bottom: 2px solid #64748b;
  transform: rotate(45deg);
  margin-top: -4px;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.status-select.is-open .status-select__chevron {
  transform: rotate(225deg);
  margin-top: 4px;
}

.status-select__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.status-select__menu[hidden] {
  display: none;
}

.status-select__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.status-select__option:hover,
.status-select__option:focus-visible {
  outline: none;
  background: #f8fbff;
  border-color: #bfdbfe;
}

.status-select__option.is-selected {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1e3a8a;
  font-weight: 700;
}

.tickets-toolbar__new {
  min-height: 42px;
  align-self: flex-end;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-toggle__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  text-decoration: none;
  color: #64748b;
  background: #fff;
  font-size: 1rem;
}

.view-toggle__btn.is-active {
  background: var(--accent);
  color: #fff;
}

.view-toggle__btn:hover:not(.is-active) {
  background: #f1f5f9;
}

/* Empty state */
.empty-state__icon {
  display: block;
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.empty-state__text {
  margin: 0 0 16px;
}

/* Profile stats */
.profile-stats {
  margin-bottom: 16px;
}

.profile-stats-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.profile-stat {
  text-align: center;
  padding: 12px 8px;
  background: #f8fafc;
  border-radius: var(--radius);
}

.profile-stat__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.profile-stat__label {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 4px;
}

/* Services */
.services-section {
  margin: 24px 0;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.service-card {
  position: relative;
  padding: 20px;
  background: var(--card);
  border: 2px solid #cbd5e1;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.service-card:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow);
}

.service-card--soon {
  opacity: 0.85;
}

.service-card__icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 8px;
}

.service-card__title {
  margin: 0 0 8px;
  font-size: 1rem;
}

.service-card__text {
  margin: 0 0 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.service-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 700;
}

.service-card__links {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.service-card__links li + li {
  margin-top: 6px;
}

/* Главная: полезная информация */
.home-info {
  margin-top: 0;
}

.home-info__title {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-info__note {
  margin: -8px 0 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.home-info .info-list__item dd a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.home-info .info-list__item dd a:hover {
  text-decoration: underline;
}

.home-info-hours-break {
  margin-left: 0.35em;
}

.home-info-hours-break .muted {
  margin-right: 0.75em;
}

.home-info-hours-break__time {
  color: var(--muted);
}

.contacts-page .home-info {
  margin-top: 0;
}

.contacts-gis-card {
  background: linear-gradient(145deg, #ffffff 0%, #f0f7ff 55%, #eef4ff 100%);
  border: 1px solid rgba(37, 99, 235, 0.14);
}

.contacts-gis-card__lead {
  margin: 0 0 4px;
  font-size: 0.95rem;
  line-height: 1.65;
  max-width: 52em;
}

.contacts-gis-card__lead strong {
  font-weight: 700;
  color: var(--text);
}

.contacts-gis-card__action {
  margin: 12px 0 0;
}

.uk-reception-schedule {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.uk-reception-schedule--top {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.uk-reception-schedule__title {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.uk-reception-table-wrap {
  overflow-x: auto;
}

.uk-reception-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.uk-reception-table th,
.uk-reception-table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

.uk-reception-table th {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #f8fafc;
}

.uk-reception-table tbody tr:last-child td {
  border-bottom: none;
}

.uk-reception-table td {
  color: var(--text);
}

.uk-reception-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.home-content .uk-reception-table td,
.home-content .uk-reception-schedule__title {
  font-size: 15px;
}

.home-content .uk-reception-table th {
  font-size: 13px;
}

/* Главная: компактные новости */
.news-home-compact {
  border: 1px solid #e2e8f0;
  background: #fff;
}

.news-home-compact__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 4px;
  padding-bottom: 14px;
  border-bottom: 2px solid #e2e8f0;
}

.news-home-compact__eyebrow {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.news-home-compact__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.news-home-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-home-list__item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 14px;
  align-items: center;
  padding: 14px 8px;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.news-home-list__item:hover {
  background: #f8fafc;
}

.news-home-list__item:hover .news-home-list__title {
  color: var(--primary);
}

.news-home-list li:last-child .news-home-list__item {
  border-bottom: none;
}

.news-home-list__date {
  grid-row: 1 / span 2;
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
  min-width: 110px;
}

.news-home-list__title {
  font-weight: 700;
  font-size: 0.95rem;
  transition: color 0.15s;
}

.news-home-list__snippet {
  grid-column: 2;
  font-size: 0.82rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-home-list__arrow {
  grid-row: 1 / span 2;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 700;
}

@media (max-width: 600px) {
  .news-home-list__item {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
  }

  .news-home-list__date {
    grid-row: auto;
    grid-column: 1 / -1;
    min-width: 0;
  }

  .news-home-list__arrow {
    grid-row: 2;
    grid-column: 2;
    align-self: start;
  }
}

/* FAQ */
.faq-section {
  margin: 24px 0 0;
}

.faq-list {
  display: grid;
  gap: 8px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item summary {
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  background: #f8fafc;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  font-weight: 400;
  color: #64748b;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item p {
  margin: 0;
  padding: 12px 16px 16px;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #475569;
}

/* Search */
.search-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.search-form input[type="search"] {
  flex: 1;
}

.search-results {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.search-results li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.search-results li:last-child {
  border-bottom: none;
}

/* Toasts — по центру экрана, компактные */
.toast-root {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(360px, calc(100vw - 24px));
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 36px 12px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 36px rgba(15, 23, 42, 0.16);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: auto;
}

.toast__text {
  margin: 0;
  flex: 1;
  line-height: 1.35;
}

.toast__close {
  position: absolute;
  top: 6px;
  right: 6px;
  transform: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}

.toast__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.toast--success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.toast--error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.toast--info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

.form-alert {
  position: relative;
  margin: 4px 0 0;
  padding: 12px 40px 12px 14px;
  border-radius: 10px;
  text-align: center;
}

.form-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.form-alert__text {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
}

.form-alert__close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}

.form-alert__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

/* Кастомные ошибки валидации полей */
.field-error {
  margin: 8px 0 0;
  padding: 0;
  color: #b91c1c;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.field.is-invalid .field-label,
.admin-filter-field.is-invalid .admin-filter-label,
.topic-picker.is-invalid .field-label {
  color: #b91c1c;
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid,
.topic-picker__trigger.is-invalid {
  border-color: #f87171 !important;
  background: #fff7f7 !important;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.22);
}

.topic-picker__trigger.is-invalid {
  color: #991b1b;
}

.form-dispatcher-help {
  margin: 10px 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.form-dispatcher-help a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.form-dispatcher-help a:hover {
  text-decoration: underline;
}

/* Mobile bottom nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  min-height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  height: auto;
  padding: 0 8px env(safe-area-inset-bottom, 0);
  justify-content: space-around;
  align-items: center;
  gap: 4px;
}

.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: var(--mobile-nav-height);
  padding: 0 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #94a3b8;
  text-decoration: none;
  position: relative;
  min-width: 0;
  flex: 1;
  max-width: 96px;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  line-height: 1.2;
}

.mobile-nav__item.is-active {
  color: #fff;
}

.mobile-nav__item.is-active span:first-child {
  transform: scale(1.05);
}

.mobile-nav__more-btn {
  appearance: none;
}

.mobile-nav__item span:first-child {
  font-size: 1.25rem;
}

.mobile-nav__item--fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  justify-content: center;
  margin-top: -20px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
  font-size: 1.5rem;
}

.mobile-nav__item--fab span {
  font-size: 1.5rem;
  line-height: 1;
}

.mobile-nav__badge {
  position: absolute;
  top: 8px;
  right: 4px;
}

.nav-count-badge {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  flex-shrink: 0;
}

.mobile-nav__item .nav-count-badge.mobile-nav__badge {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-more-sheet__link .nav-count-badge {
  margin-left: auto;
}

@media (max-width: 768px) {
  .mobile-nav {
    display: flex;
  }

  body.has-mobile-nav {
    --mobile-nav-clearance: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 48px);
  }

  html {
    scroll-padding-bottom: var(--mobile-nav-clearance, 120px);
  }

  body.has-mobile-nav .main-content,
  body.has-mobile-nav .main-content.wrap,
  body.has-mobile-nav .main-content.wrap:has(.admin-shell) {
    padding-bottom: var(--mobile-nav-clearance) !important;
  }

  body.has-mobile-nav .admin-main {
    padding-bottom: calc(24px + var(--mobile-nav-clearance)) !important;
  }

  body.has-mobile-nav .topbar .nav-links a:not(.brand),
  body.has-mobile-nav .topbar .nav-links form {
    display: none;
  }

  .admin-sidebar {
    display: none;
  }

  .profile-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ticket-progress {
    padding: 12px 0;
  }

  .ticket-progress__label {
    font-size: 0.68rem;
  }

  .ticket-cancel-form__btn {
    width: 100%;
    justify-content: center;
  }

  .profile-password-link {
    width: 100%;
    justify-content: center;
  }

  .news-new-body {
    min-height: 120px;
    max-height: 40vh;
  }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: min(92vw, 960px);
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
}

.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }

.lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Admin chart */
.admin-chart-panel {
  padding: 26px 28px 30px;
  border: 1px solid #dbeafe;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.admin-chart-panel__head {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e2e8f0;
}

.admin-chart-panel__head .admin-panel-title {
  margin: 0 0 6px;
}

.admin-chart-panel__hint {
  margin: 0;
  font-size: 0.99rem;
}

.admin-two-col--below-chart {
  margin-top: 4px;
}

.month-stats-chart {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 6px 0 2px;
}

.month-stats-chart__row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 18px;
}

.month-stats-chart__month {
  font-size: 0.99rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.02em;
}

.month-stats-chart__track {
  height: 28px;
  background: #e8eef4;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.month-stats-chart__svg {
  display: block;
  width: 100%;
  height: 100%;
}

.month-stats-chart__rect {
  fill: #2563eb;
}

.month-stats-chart__fill {
  height: 100%;
  min-width: 0;
  background: linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
  border-radius: 999px;
  transition: width 0.45s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.admin-main > .admin-panel.card {
  flex: 0 0 auto;
  height: auto;
}

.admin-panel--fit {
  align-self: stretch;
  width: 100%;
}

.month-stats-chart__count {
  font-size: 1.155rem;
  font-weight: 800;
  color: var(--primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Ticket chat — заметный вход для жителя */
.ticket-chat-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
  text-decoration: none;
  color: inherit;
  border: 2px solid #93c5fd;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  transition: border-color 0.15s, transform 0.15s;
  scroll-margin-top: 80px;
}

.ticket-chat-banner:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.ticket-chat-banner__icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.ticket-chat-banner__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.92rem;
}

.ticket-chat-banner__text strong {
  font-size: 1rem;
  color: var(--primary);
}

.ticket-chat-banner__arrow {
  font-size: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
}

.ticket-chat-section {
  scroll-margin-top: 80px;
  border: 2px solid #bfdbfe;
}

.ticket-card--split {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  overflow: hidden;
}

.ticket-card--split .ticket-card__main {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
}

.ticket-card--split .ticket-card__main:hover {
  background: #f8fafc;
}

.ticket-card__chat {
  flex-shrink: 0;
  margin: 8px 12px 8px 0;
  white-space: nowrap;
}

.ticket-list-chat {
  white-space: nowrap;
  min-width: 88px;
  text-align: center;
}

table .ticket-list-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* Таблицы → карточки на телефоне */
@media (max-width: 720px) {
  .admin-table--stack thead,
  .stack-table thead {
    display: none;
  }

  .admin-table--stack tbody tr,
  .admin-table--stack tfoot tr,
  .stack-table tbody tr,
  .stack-table tfoot tr {
    display: block;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .admin-table--stack tbody tr:hover,
  .stack-table tbody tr:hover {
    background: #fff;
  }

  .admin-table--stack tfoot tr,
  .stack-table tfoot tr {
    background: #f8fafc;
    border-width: 2px;
  }

  .admin-table--stack td,
  .admin-table--stack tfoot td,
  .stack-table td,
  .stack-table tfoot td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    text-align: right;
  }

  .admin-table--stack td:last-child,
  .admin-table--stack tfoot td:last-child,
  .stack-table td:last-child,
  .stack-table tfoot td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .admin-table--stack td:first-child,
  .admin-table--stack tfoot td:first-child,
  .stack-table td:first-child,
  .stack-table tfoot td:first-child {
    padding-top: 0;
  }

  .admin-table--stack td::before,
  .admin-table--stack tfoot td::before,
  .stack-table td::before,
  .stack-table tfoot td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-align: left;
    flex: 0 0 42%;
    max-width: 48%;
  }

  .admin-table--stack td.admin-table__empty,
  .stack-table td.stack-table__empty {
    display: block;
    text-align: center;
    padding: 12px 0;
  }

  .admin-table--stack td.admin-table__empty::before,
  .stack-table td.stack-table__empty::before {
    display: none;
  }

  .stack-table--tickets tbody tr {
    cursor: default;
  }

  .stack-table td.stack-table__actions[data-label=""]::before {
    display: none;
  }

  .stack-table td.stack-table__actions .stack-table__go {
    width: 100%;
    justify-content: center;
  }

  .admin-table--stack td.admin-table__actions,
  .stack-table td.stack-table__actions {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .admin-table--stack td.admin-table__actions::before,
  .stack-table td.stack-table__actions::before {
    margin-bottom: 2px;
  }

  .admin-table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .admin-table-actions .btn {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .admin-table--stack td.admin-table__actions[data-label=""]::before {
    display: none;
  }

  .admin-table--stack td.admin-table__actions {
    padding-top: 10px;
    border-bottom: 0;
    width: auto;
    white-space: normal;
  }

  .admin-table--stack td.admin-table__actions .btn,
  .admin-table--stack td.admin-table__actions .admin-table__go {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
  }

  .admin-table-sort--mobile {
    display: inline-flex;
  }

  .admin-table-sort-th {
    display: none;
  }

  .admin-table-status {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex: 1;
    min-width: 0;
    text-align: right;
  }

  .admin-table-status .status-overdue {
    margin-left: 0;
    white-space: nowrap;
  }

  .month-stats-chart__row {
    grid-template-columns: 58px minmax(0, 1fr) 40px;
    gap: 10px;
  }

  .month-stats-chart__month {
    font-size: 0.82rem;
  }

  .month-stats-chart__count {
    font-size: 1rem;
  }
}

/* Admin «Ещё» — дополнительные разделы на телефоне */
.mobile-more-sheet {
  border: 0;
  padding: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  background: transparent;
}

.mobile-more-sheet::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.mobile-more-sheet__box {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.15);
}

.mobile-more-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mobile-more-sheet__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.mobile-more-sheet__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-more-sheet__links {
  display: grid;
  gap: 8px;
}

.mobile-more-sheet__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.mobile-more-sheet__link.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.25);
}

.mobile-more-sheet__link span[aria-hidden="true"] {
  font-size: 1.15rem;
  width: 1.4rem;
  text-align: center;
}

@media (max-width: 480px) {
  .admin-stat-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Житель: телефонный интерфейс ========== */
.stack-table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 4px;
}

@media (max-width: 768px) {
  body.layout-guest .wrap,
  body.layout-resident .wrap {
    width: 100%;
    max-width: none;
    padding-left: 14px;
    padding-right: 14px;
  }

  body.layout-guest .card,
  body.layout-resident .card {
    margin: 10px 0;
    padding: 16px 14px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
  }

  body.layout-guest .page-hero,
  body.layout-resident .page-hero {
    padding: 18px 16px;
    margin-top: 0;
  }

  body.layout-guest .page-hero__icon-wrap,
  body.layout-resident .page-hero__icon-wrap {
    display: none;
  }

  body.layout-guest .page-hero__title,
  body.layout-resident .page-hero__title {
    font-size: 1.35rem;
  }

  body.layout-guest .page-hero__lead,
  body.layout-resident .page-hero__lead {
    font-size: 0.92rem;
    max-width: none;
  }

  body.layout-guest .page-layout,
  body.layout-resident .page-layout {
    margin: 10px 0;
    gap: 10px;
  }

  body.layout-guest .page-layout__aside,
  body.layout-resident .page-layout__aside {
    display: none;
  }

  body.layout-guest .landing-hero--home,
  body.layout-resident .landing-hero--home {
    padding: 20px 16px;
  }

  body.layout-guest .landing-hero--home .actions,
  body.layout-resident .landing-hero--home .actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.layout-guest .landing-hero--home .actions .btn,
  body.layout-resident .landing-hero--home .actions .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-guest .landing-hero--home .landing-stats,
  body.layout-resident .landing-hero--home .landing-stats {
    display: none;
  }

  body.layout-resident .quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.layout-guest .features-grid,
  body.layout-guest .services-grid,
  body.layout-resident .features-grid,
  body.layout-resident .services-grid {
    grid-template-columns: 1fr;
  }

  body.layout-guest .form-actions,
  body.layout-resident .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  body.layout-guest .form-actions .btn,
  body.layout-resident .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-guest .news-page .news-feed-card,
  body.layout-resident .news-page .news-feed-card {
    grid-template-columns: 1fr;
  }

  body.layout-guest .news-page-feed,
  body.layout-resident .news-page-feed {
    padding: 14px;
  }

  body.layout-guest .news-back .btn,
  body.layout-resident .ticket-back .btn,
  body.layout-assignee .ticket-back .btn,
  body.layout-admin .ticket-back .btn,
  .ticket-back .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-guest .site-footer__inner {
    gap: 16px;
  }

  body.layout-guest .site-footer__brand {
    flex-direction: column;
    align-items: flex-start;
  }

  body.layout-resident .tickets-toolbar {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
  }

  body.layout-resident .tickets-toolbar__actions {
    display: grid;
    gap: 10px;
    width: 100%;
  }

  body.layout-resident .tickets-filter {
    display: grid;
    gap: 6px;
    width: 100%;
  }

  body.layout-resident .tickets-filter__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
  }

  body.layout-resident .tickets-filter select,
  body.layout-resident .status-select {
    width: 100%;
  }

  body.layout-resident .tickets-toolbar__new {
    width: 100%;
    justify-content: center;
  }

  body.layout-resident .stack-table--tickets td.stack-table__actions {
    padding-top: 4px;
    border-bottom: 0;
  }

  body.layout-resident .status-legend li {
    font-size: 0.88rem;
    line-height: 1.5;
  }

  body.layout-resident .ticket-back .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-resident .ticket-progress {
    padding: 10px 0;
    margin-bottom: 14px;
  }

  body.layout-resident .ticket-progress__label {
    font-size: 0.62rem;
  }

  body.layout-resident .ticket-progress__dot {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  body.layout-resident .ticket-compose-form {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-top: 12px;
  }

  body.layout-resident .ticket-compose-form input[type="text"],
  body.layout-resident .ticket-compose-form select {
    width: 100%;
  }

  body.layout-resident .ticket-compose-form .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-resident .ticket-cancel-form {
    margin-top: 14px;
    padding-top: 12px;
  }

  body.layout-resident .ticket-cancel-form__btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-resident .ticket-progress--cancelled {
    justify-content: center;
  }

  body.layout-resident .profile-password-link {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  body.layout-resident .profile-password-page .card-form,
  body.layout-assignee .profile-password-page .card-form {
    padding: 16px;
  }

  body.layout-assignee .form-actions,
  body.layout-assignee .form-actions--stack {
    flex-direction: column;
    align-items: stretch;
  }

  body.layout-assignee .form-actions .btn,
  body.layout-assignee .form-actions--stack .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  body.layout-resident .ticket-rate-form {
    max-width: none;
  }

  body.layout-resident .ticket-rate-form .status-select,
  body.layout-resident .ticket-rate-form .btn {
    width: 100%;
  }

  body.layout-resident .msg {
    word-break: break-word;
  }

  body.layout-resident .profile-page .page-hero {
    margin-bottom: 0;
  }

  body.layout-resident .profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.layout-resident .profile-stat {
    padding: 14px 12px;
  }

  body.layout-resident .profile-tiles {
    grid-template-columns: 1fr;
  }

  body.layout-resident .profile-logout__btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-resident .notify-feed__item {
    padding: 14px;
  }

  body.layout-resident .notify-feed__action .btn {
    width: 100%;
    justify-content: center;
  }

  body.layout-resident .ticket-new-tips {
    margin-top: 0;
  }

  body.layout-guest .empty-state .btn,
  body.layout-resident .empty-state .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  body.layout-resident .quick-actions {
    grid-template-columns: 1fr;
  }

  body.layout-resident .profile-stats-grid {
    grid-template-columns: 1fr;
  }

  body.layout-assignee .wrap {
    width: 100%;
    max-width: none;
    padding-left: 14px;
    padding-right: 14px;
  }

  body.layout-assignee .card {
    margin: 10px 0;
    padding: 16px 14px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
  }

  body.layout-assignee .workspace-page > .card,
  body.layout-assignee .workspace-page > .workspace-kpi-grid {
    margin: 0;
  }

  body.layout-assignee .workspace-page {
    gap: 24px;
  }

  body.layout-assignee .workspace-hero {
    padding: 18px 16px;
  }

  body.layout-assignee .workspace-title {
    font-size: 1.35rem;
  }

  body.layout-assignee .workspace-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  body.layout-assignee .workspace-kpi {
    padding: 14px 12px;
  }

  body.layout-assignee .workspace-kpi-value {
    font-size: 1.45rem;
  }

  body.layout-assignee .workspace-panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  body.layout-assignee .workspace-list li {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  body.layout-assignee .profile-page .page-hero {
    padding: 18px 16px;
  }

  body.layout-assignee .profile-tiles {
    grid-template-columns: 1fr;
  }

  body.layout-assignee .profile-logout__btn {
    width: 100%;
  }
}

/* Push-уведомления: модальное окно и переключатель в профиле */
.browser-notify-modal {
  border: 0;
  padding: 0;
  max-width: min(420px, calc(100vw - 28px));
  width: 100%;
  background: transparent;
}

.browser-notify-modal::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.browser-notify-modal__box {
  background: linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 18px;
  padding: 28px 24px 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  text-align: center;
}

.browser-notify-modal__icon {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 12px;
}

.browser-notify-modal__title {
  margin: 0 0 10px;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.browser-notify-modal__text {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.browser-notify-modal__notes {
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.browser-notify-modal__tip {
  margin: 0;
  padding: 10px 12px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #1e3a5f;
  text-align: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}

.browser-notify-modal__hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.browser-notify-modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.browser-notify-modal__btn {
  width: 100%;
  justify-content: center;
  min-height: 46px;
  font-weight: 700;
  border-radius: 12px;
}

.browser-notify-modal__btn--yes {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.browser-notify-modal__btn--yes:hover {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

.browser-notify-modal__btn--no {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.browser-notify-modal__btn--no:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.profile-notify__lead {
  margin: 0 0 14px;
  font-size: 0.95rem;
}

.profile-notify__hint {
  margin: 12px 0 0;
  font-size: 0.88rem;
}

.profile-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}

.profile-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.profile-toggle__track {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
}

.profile-toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.profile-toggle input:checked + .profile-toggle__track {
  background: #2563eb;
}

.profile-toggle input:checked + .profile-toggle__track::after {
  transform: translateX(22px);
}

.profile-toggle__label {
  font-weight: 700;
  color: var(--text);
}

.profile-toggle input:focus-visible + .profile-toggle__track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
