:root {
  color-scheme: dark;

  --page-bg-a: #05070a;
  --page-bg-b: #111922;
  --page-radial: rgb(34 48 58 / 33%);
  --phone-bg-a: rgb(18 24 32 / 96%);
  --phone-bg-b: rgb(7 10 14 / 99%);
  --phone-border: rgb(255 255 255 / 18%);
  --text: #f6f7fb;
  --text-strong: #fff;
  --muted: #99a2ad;
  --muted-2: #707985;
  --card: rgb(18 24 32 / 78%);
  --card-solid: #121820;
  --line: rgb(255 255 255 / 12%);
  --line-strong: rgb(255 255 255 / 18%);

  /* Form-field surface — a RECESSED well, darker than --card, with a clearly
     visible border so inputs don't melt into the dark card behind them. The
     plain --card/--line combo reads as nearly borderless on the mobile UI. */
  --field-bg: rgb(4 7 11 / 55%);
  --field-border: rgb(255 255 255 / 24%);
  --nav-bg: rgb(10 14 19 / 97%);
  --sheet-bg-a: rgb(24 31 39 / 98%);
  --sheet-bg-b: rgb(14 19 25 / 99%);
  --red: #ff5046;
  --red-2: #d83732;
  --red-soft: rgb(255 72 58 / 14%);
  --orange: #ff9f14;
  --orange-soft: rgb(255 159 20 / 13%);
  --yellow: #ffc400;
  --yellow-soft: rgb(255 196 0 / 12%);
  --green: #52d44a;
  --shadow: rgb(0 0 0 / 72%);
  --inner-glow: rgb(255 255 255 / 6%);

  /* Subtle inset overlay used by nested form blocks (e.g.
     .admin-form-fieldset). On dark themes a faint white wash reads as
     "raised"; on light themes the inverse — see body[data-theme="light"]
     below. */
  --surface-subtle: rgb(255 255 255 / 1.5%);
}

body[data-theme="light"] {
  color-scheme: light;

  --page-bg-a: #eef3f7;
  --page-bg-b: #f8fbfd;
  --page-radial: rgb(255 92 70 / 12%);
  --phone-bg-a: rgb(250 252 255 / 99%);
  --phone-bg-b: rgb(235 241 247 / 98%);
  --phone-border: rgb(32 42 54 / 13%);
  --text: #171d25;
  --text-strong: #0d1218;
  --muted: #637080;
  --muted-2: #8a95a3;
  --card: rgb(255 255 255 / 82%);
  --card-solid: #fff;
  --line: rgb(22 32 45 / 10%);
  --line-strong: rgb(22 32 45 / 15%);

  /* Light theme: a solid white field on the tinted card, with a firmer border. */
  --field-bg: #fff;
  --field-border: rgb(22 32 45 / 22%);
  --nav-bg: rgb(255 255 255 / 95%);
  --sheet-bg-a: rgb(255 255 255 / 98%);
  --sheet-bg-b: rgb(245 249 252 / 98%);
  --shadow: rgb(31 43 56 / 18%);
  --inner-glow: rgb(255 255 255 / 75%);

  /* Subtle overlay; on light themes it renders as a soft slate tint so
     nested form blocks read as recessed against the lighter card surface. */
  --surface-subtle: rgb(22 32 45 / 2.5%);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 30%, var(--page-radial), transparent 42%),
    linear-gradient(135deg, var(--page-bg-a), var(--page-bg-b) 55%, var(--page-bg-a));
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
  height: 42px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: var(--card);
  box-shadow: 0 14px 35px var(--shadow);
  cursor: pointer;
  font-weight: 800;
}

.theme-icon {
  font-size: 16px;
}

.theme-label {
  font-size: 13px;
}

.stage {
  min-height: 100vh;
  display: flex;
  gap: 70px;
  align-items: center;
  justify-content: center;
  padding: 76px 22px 22px;
}

.phone {
  position: relative;
  width: 390px;
  height: 840px;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid var(--phone-border);
  background: linear-gradient(180deg, var(--phone-bg-a), var(--phone-bg-b));
  box-shadow:
    0 44px 100px var(--shadow),
    inset 0 0 0 1px rgb(255 255 255 / 6%);
}

.statusbar {
  height: 31px;
  padding: 12px 21px 0;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-strong);
}

.statusbar span {
  font-size: 10px;
  color: var(--muted);
}

.topbar {
  height: 62px;
  padding: 15px 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  width: 39px;
  height: 39px;
  filter: drop-shadow(0 0 14px rgb(255 80 70 / 34%));
}

.logo svg {
  width: 100%;
  height: 100%;
}

.logo rect,
.logo path {
  fill: none;
  stroke: var(--red);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: -0.5px;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 11px;
}

.bell {
  position: relative;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 24px;
}

.bell i {
  position: absolute;
  right: 0;
  top: -3px;
  width: 15px;
  height: 15px;
  border-radius: 99px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-style: normal;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background:
    radial-gradient(circle at 50% 35%, #efc19f 0 17%, transparent 18%),
    radial-gradient(circle at 50% 72%, #244336 0 34%, transparent 35%), linear-gradient(#37414b, #171b20);
}

.hello {
  height: 57px;
  padding: 20px 20px 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hello h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 18px;
}

.danger-pill {
  height: 25px;
  padding: 0 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  border-radius: 16px;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid rgb(255 72 58 / 22%);
  font-size: 11px;
  font-weight: 800;
}

.danger-pill i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 13px rgb(255 81 71 / 60%);
}

.earn {
  position: relative;
  height: 117px;
  margin: 0 20px 12px;
  padding: 23px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 38%, rgb(255 77 54 / 27%), transparent 25%),
    linear-gradient(
      105deg,
      color-mix(in srgb, var(--card-solid), #1d242b 30%),
      color-mix(in srgb, var(--red), transparent 80%)
    );
  box-shadow: inset 0 1px 0 var(--inner-glow);
}

body[data-theme="light"] .earn {
  background:
    radial-gradient(circle at 88% 38%, rgb(255 80 70 / 18%), transparent 25%),
    linear-gradient(105deg, #fff, #fff0ed);
}

.earn p {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 14px;
}

.earn strong {
  position: relative;
  z-index: 1;
  display: block;
  color: var(--text-strong);
  font-size: 44px;
  line-height: 0.95;
  letter-spacing: -1.7px;
}

.earn em {
  display: block;
  margin-top: 10px;
  color: var(--orange);
  font-style: normal;
  font-size: 13px;
  font-weight: 850;
}

.chart {
  position: absolute;
  right: 6px;
  bottom: 7px;
  width: 185px;
  height: 110px;
}

.chart rect {
  fill: rgb(255 97 74 / 52%);
}

.chart polyline {
  fill: none;
  stroke: var(--red);
  stroke-width: 4;
  stroke-linecap: round;
}

.chart circle {
  fill: var(--red);
}

.chart text {
  font-size: 42px;
  font-weight: 900;
  fill: var(--red);
}

.card {
  margin: 0 20px 10px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--inner-glow);
}

.plan {
  height: 150px;
  padding: 14px 13px 12px;
}

.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 13px;
}

.title-row h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
}

.title-row span {
  height: 24px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  border-radius: 14px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 11px;
  font-weight: 850;
}

.row {
  display: grid;
  grid-template-columns: 24px 88px 1fr 48px;
  align-items: center;
  gap: 10px;
  margin: 9px 0;
  font-size: 11px;
  font-weight: 800;
}

.row p {
  margin: 0;
  color: var(--text);
}

.row b {
  font-size: 18px;
}

.row em {
  font-style: normal;
  text-align: right;
  color: var(--muted);
}

.row.red b,
.row.red em {
  color: var(--red);
}

.row.orange b,
.row.orange em {
  color: var(--orange);
}

.row.yellow b,
.row.yellow em {
  color: var(--yellow);
}

.bar {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgb(128 139 150 / 18%);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--red);
  box-shadow: 0 0 9px rgb(255 81 71 / 42%);
}

.orange .bar i {
  background: var(--orange);
}

.yellow .bar i {
  background: var(--yellow);
}

.warning {
  height: 55px;
  margin: 0 20px 10px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: 35px 1fr 16px;
  align-items: center;
  border-radius: 12px;
  border: 1px solid rgb(255 92 54 / 32%);
  background: linear-gradient(90deg, rgb(255 89 42 / 16%), rgb(255 89 42 / 5%));
}

.warning b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 2px solid var(--orange);
  color: var(--orange);
}

.warning strong {
  color: var(--red);
  font-size: 12px;
}

.warning p {
  margin: 3px 0 0;
  color: var(--text);
  font-size: 11px;
}

.warning span {
  color: var(--muted);
  font-size: 24px;
}

.buttons {
  height: 58px;
  margin: 0 20px 12px;
  padding: 7px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
}

.buttons button {
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.start {
  color: var(--orange);
  background: var(--orange-soft);
  border-color: rgb(255 159 20 / 22%);
}

.pause {
  color: var(--yellow);
  background: var(--yellow-soft);
  border-color: rgb(255 196 0 / 20%);
}

.finish {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgb(255 72 58 / 28%);
}

.bottom-cards {
  margin: 0 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.calendar,
.pay {
  height: 112px;
  margin: 0;
  padding: 11px;
}

.mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.mini-head h3,
.pay h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
}

.mini-head a {
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
}

.week,
.dates {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  text-align: center;
}

.week {
  color: var(--muted);
  font-size: 10px;
}

.dates {
  margin-top: 6px;
}

.dates b {
  width: 22px;
  height: 22px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text);
  background: rgb(128 139 150 / 18%);
  font-size: 10px;
}

.dates .bad {
  color: #fff;
  background: rgb(255 81 71 / 66%);
}

.dates .warn {
  color: #111;
  background: var(--orange);
}

.legend {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 8px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.g {
  background: var(--green);
}

.y {
  background: var(--orange);
}

.r {
  background: var(--red);
}

.pay {
  text-align: center;
}

.pay p {
  margin: 6px 0 3px;
  color: var(--muted);
  font-size: 10px;
}

.pay strong {
  display: block;
  margin-bottom: 9px;
  color: var(--text-strong);
  font-size: 25px;
}

.pay button {
  width: 100%;
  height: 31px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(var(--red), var(--red-2));
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

/* Bare `.nav` selector is too greedy — it matches Pagy 9's
   `<nav class="pagy nav">` and rips the pagination chip out of the
   normal flow with `position: absolute; bottom: 0; left: 0`. The views
   use `.bottom-nav`, so scope the mockup mobile-tabbar styles to that
   class and leave generic `<nav>` elements alone. */
.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 59px;
  padding: 4px 14px 7px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--nav-bg);
  border-top: 1px solid var(--line);
}

.bottom-nav a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
  font-size: 20px;
  text-decoration: none;
}

.bottom-nav a span {
  font-size: 10px;
  font-weight: 800;
}

.bottom-nav .active {
  color: var(--orange);
}

.bottom-nav .active::before {
  content: "";
  position: absolute;
  top: -6px;
  width: 34px;
  height: 2px;
  border-radius: 5px;
  background: var(--orange);
}

.dim {
  opacity: 0.45;
}

.with-menu::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgb(0 0 0 / 42%);
  backdrop-filter: blur(1px);
}

body[data-theme="light"] .with-menu::before {
  background: rgb(24 32 44 / 18%);
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 59px;
  z-index: 3;
  min-height: 575px;
  padding: 11px 14px 18px;
  border-radius: 20px 20px 0 0;
  border: 1px solid var(--line);
  background: linear-gradient(var(--sheet-bg-a), var(--sheet-bg-b));
  box-shadow: 0 -30px 70px var(--shadow);
}

.handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 99px;
  background: var(--line-strong);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sheet-head h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 19px;
}

.sheet-head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  cursor: pointer;
}

.sheet ul {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  border-radius: 11px;
  border: 1px solid var(--line);
}

.sheet li {
  height: 43px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 25px 1fr 15px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.sheet li:last-child {
  border-bottom: 0;
}

.sheet li b {
  color: var(--red);
  font-size: 17px;
}

.sheet li span {
  color: var(--muted);
  font-size: 21px;
}

@media (width <= 940px) {
  .stage {
    flex-direction: column;
    gap: 26px;
    padding: 76px 18px 18px;
  }
}

@media (width <= 430px) {
  .theme-toggle {
    top: 10px;
    right: 10px;
    height: 36px;
    padding: 0 10px;
  }

  .theme-label {
    display: none;
  }

  .stage {
    padding: 54px 0 0;
  }

  .phone {
    width: 100vw;
    height: calc(100vh - 54px);
    border: 0;
    border-radius: 0;
  }
}
/* app/assets/stylesheets/about.css */

/* Public «about / services» landing (/about). Standalone light layout; reuses
   design tokens. Mirrors the full-bleed treatment of the referral page. */

.about {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 20px 72px;
  color: var(--text);
}

/* Home landing hero — single-column, centered (no hero art like /services). */
.home-hero {
  text-align: center;
  padding-top: 56px;
}

.home-hero .about__lead {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.home-hero .about__cta-row {
  justify-content: center;
  flex-wrap: wrap;
}

.product__logo {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 0 18px;
}

.about__hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 12px;
}

.about__eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgb(82 212 74 / 14%);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.about__title {
  margin: 14px 0 10px;
  font-size: 32px;
  line-height: 1.12;
  font-weight: 900;
  color: var(--text-strong);
}

.about__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
}

.about__hero-art {
  display: block;
  width: 100%;
}

.about__hero-art img {
  display: block;
  width: 100%;
  height: auto;
}

.about__shot {
  display: block;
  width: 100%;
  height: auto;
  margin: 8px 0 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px var(--shadow);
}

.about__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.about__btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition:
    filter 0.15s,
    background 0.15s;
}

.about__btn--primary {
  background: linear-gradient(var(--green), #3cae34);
  color: #04140a;
}

.about__btn--primary:hover {
  filter: brightness(1.05);
}

/* Secondary CTA — green outline so it reads as a button (not a neutral chip). */
.about__btn--ghost {
  border: 2px solid var(--green);
  color: var(--green);
  background: transparent;
}

.about__btn--ghost:hover {
  background: color-mix(in srgb, var(--green), transparent 88%);
}

.about__btn--lg {
  padding: 18px 32px;
  font-size: 17px;
}

/* Centred CTA wrapper (e.g. the partnership «Обсудить формат» button). */
.about__center {
  margin-top: 22px;
  text-align: center;
}

/* Pair of CTAs (Telegram + MAX) — centred with a gap on desktop; the mobile
   `.about__btn { width: 100% }` rule makes them stack full-width. */
.about__center--pair {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.about__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0 8px;
}

/* Passive fact chips — neutral grey fill, no border, green tick. Deliberately
   NOT button-shaped so they don't read as clickable next to the CTAs. */
.about__stat {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--text), transparent 95%);
  text-align: left;
}

.about__stat::before {
  content: "✓";
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 900;
  font-size: 14px;
}

.about__stat strong {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 700;
}

.about__block {
  margin-top: 40px;
}

.about__h2 {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-strong);
  margin: 0 0 12px;
  line-height: 1.2;
}

.about__lead {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

.about__muted {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.about__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.about__card {
  position: relative;
  padding: 18px 18px 18px 22px;
  border-radius: 16px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  overflow: hidden;
}

/* Green accent bar instead of a per-card icon. */
.about__card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--green);
}

.about__card-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
}

.about__card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.about__stack {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12.5px;
  font-weight: 700;
}

/* Project cards: homepage screenshot (top) + logo/name/site header. */
.about__project-shot {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 470;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin: 0 0 12px;
  background: var(--card-solid);
}

.about__project-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.about__project-logo {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 8px;
}

.about__project-head .about__card-title {
  margin: 0;
}

.about__project-site {
  display: inline-block;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.about__project-site:hover {
  text-decoration: underline;
}

.about__why {
  margin: 8px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.about__why li {
  position: relative;
  padding-left: 28px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.about__why li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--green);
  font-weight: 900;
}

/* Guarantee slogan — the emotional close of the warranty block. */
.about__guarantee-slogan {
  margin: 16px 0 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--green);
}

.about__refer {
  margin-top: 44px;
  padding: 28px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--green), transparent 86%), transparent 60%),
    var(--card-solid);
  border: 1px solid color-mix(in srgb, var(--green), transparent 55%);
  text-align: center;
}

.about__refer .about__lead {
  max-width: 560px;
  margin: 0 auto 18px;
  color: var(--muted);
}

/* Tablet / phone: stack the hero, single-column cards, comfy spacing. */
@media (width <= 720px) {
  .about__hero {
    grid-template-columns: 1fr;
  }

  .about__hero-art {
    max-width: 320px;
    margin: 6px auto 0;
  }

  .about__title {
    font-size: 27px;
  }

  .about__stats {
    grid-template-columns: 1fr;
  }

  .about__grid {
    grid-template-columns: 1fr;
  }

  .about__btn {
    width: 100%;
  }
}
/*
 * app/assets/stylesheets/admin.css
 *
 * Desktop admin chrome for owners / admins / managers / platform admins.
 * Renders under app/views/layouts/admin.html.erb. The mobile layout
 * (application.html.erb + bottom_nav) is unaffected — these styles only
 * activate when `body.admin-body` is present.
 *
 * Design tokens are sourced from design_tokens.css. Do NOT redefine colors —
 * use --page-bg-a/b, --card, --card-solid, --line, --line-strong, --text,
 * --text-strong, --muted, --nav-bg, --red, --green, --orange, --shadow,
 * --inner-glow.
 */

/* =========================================================================
   Body / shell
   ========================================================================= */
body.admin-body {
  /* Single source of truth for the topbar height. Consumed by every sticky
     element below the topbar (e.g. table headers) so a future topbar resize
     only touches one number. Kept on `body.admin-body` rather than `:root`
     so the public-facing layouts (devise, mailer) are unaffected. */
  --admin-topbar-h: 56px;

  margin: 0;
  padding: 0;
  max-width: none;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  color: var(--text);
}

body.admin-body * {
  box-sizing: border-box;
}

/* =========================================================================
   Sidebar
   ========================================================================= */
.admin-sidebar {
  width: 240px;
  flex: 0 0 240px;
  min-height: 100vh;
  position: sticky;
  top: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  background: var(--nav-bg);
  border-right: 1px solid var(--line);
  padding: 18px 14px 14px;
  overflow-y: auto;
  z-index: 50;
}

.admin-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  transition: background-color 0.12s ease;
}

.admin-sidebar__brand:hover,
.admin-sidebar__brand:focus-visible {
  background: var(--card);
  text-decoration: none;
}

.admin-sidebar__brand:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.admin-sidebar__brand-logo {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: block;
}

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

.admin-sidebar__brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-sidebar__brand-name {
  font-size: 17px;
  font-weight: 850;
  letter-spacing: 0.4px;
  color: var(--text-strong);
}

.admin-sidebar__brand-tag {
  display: inline-block;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.7px;
  border-radius: 4px;
  background: var(--red-soft);
  color: var(--red);
  text-transform: uppercase;
}

.admin-sidebar__brand-tenant {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar__section {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}

.admin-sidebar__section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--muted-2);
  text-transform: uppercase;
  padding: 6px 10px 4px;
}

.admin-sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.admin-sidebar__item:hover {
  background: var(--card);
  color: var(--text-strong);
}

.admin-sidebar__item--active {
  background: var(--card-solid);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.admin-sidebar__item-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  opacity: 0.8;
}

/* Numeric counter pill rendered next to an .admin-sidebar__item label
   (e.g. pending referral leads next to «Компании»). Brand-green tint to
   match the «Реферал» row chip, so the visual association is one click
   wide. `margin-left: auto` pushes it to the right edge of the item. */
.admin-sidebar__item .admin-nav__badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  border-radius: 999px;
  color: var(--green);
  background: rgb(82 212 74 / 16%);
  border: 1px solid rgb(82 212 74 / 35%);
}

.admin-sidebar__bottom {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Sidebar bottom user block: avatar + stacked name/email. */
.admin-sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 8px;
  min-width: 0;

  /* Now a link to /profile — strip the default <a> styling and add a subtle
     hover so the chip reads as clickable. */
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.admin-sidebar__user:hover {
  background: rgb(128 139 150 / 8%);
  text-decoration: none;
}

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

.admin-sidebar__user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar__user-email {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-sidebar__sign-out {
  display: block;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}

.admin-sidebar__sign-out:hover {
  background: var(--red-soft);
}

.admin-sidebar__sign-out-form {
  margin: 0;
}

/* =========================================================================
   Main column
   ========================================================================= */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* =========================================================================
   Topbar
   ========================================================================= */
.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--admin-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.admin-topbar__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-topbar__user {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  max-width: 240px;

  /* Now a link to /profile — strip default <a> styling, add subtle hover. */
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.admin-topbar__user:hover {
  background: rgb(128 139 150 / 12%);
  color: var(--text);
  text-decoration: none;
}

.admin-topbar__user-name {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-topbar__tenant-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-topbar__tenant-button {
  display: inline-block;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}

.admin-topbar__tenant-button--current {
  background: var(--card-solid);
  color: var(--text-strong);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.admin-topbar__theme-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}

.admin-topbar__theme-toggle:hover {
  background: var(--card);
  color: var(--text-strong);
  border-color: var(--line);
}

.admin-topbar__theme-toggle:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.admin-topbar__theme-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  line-height: 1;
}

.admin-topbar__theme-toggle-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* =========================================================================
   Avatar — round initials chip used in sidebar bottom & topbar user blocks.
   Default size is 32×32; `--sm` (28×28) sits in the topbar, `--lg` (36×36)
   sits in the sidebar bottom.
   ========================================================================= */
.admin-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  user-select: none;
}

.admin-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.admin-avatar--lg {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

/* =========================================================================
   Pill tabs: quick-switch filter bar with a per-tab count badge. Used by
   /email_templates (channel filter), reused elsewhere. NOT to be confused
   with the deprecated bare `.admin-tabs` text-link variant.
   ========================================================================= */
.admin-pill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  font-size: 13px;
}

.admin-pill-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-solid);
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}

.admin-pill-tab:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgb(82 212 74 / 6%);
  text-decoration: none;
}

.admin-pill-tab:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.admin-pill-tab__label {
  letter-spacing: 0.02em;
}

.admin-pill-tab__count {
  display: inline-flex;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgb(128 139 150 / 18%);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  justify-content: center;
}

.admin-pill-tab--active {
  color: #04140a;
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 1px 3px rgb(82 212 74 / 25%);
}

.admin-pill-tab--active:hover {
  color: #04140a;
  background: var(--green);
  border-color: var(--green);
}

.admin-pill-tab--active .admin-pill-tab__count {
  background: rgb(4 20 10 / 18%);
  color: #04140a;
}

.admin-pill-tab--empty {
  opacity: 0.55;
}

.admin-pill-tab--empty:hover {
  opacity: 1;
}

/* When the user has uploaded an avatar via /profile, the helper emits an <img>
   inside the .admin-avatar circle. Cover the full circle, hide the inherited
   initials background so the image owns the visual. */
.admin-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.admin-avatar:has(.admin-avatar__img) {
  background: transparent;
}

/* Wrapper link making the avatar chip clickable on both admin chrome and the
   mobile employee statusbar. Keeps the chip look (no underline, no link
   colour shift) and adds a hover indication so it reads as clickable. */
.avatar-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border-radius: 50%;
  cursor: pointer;
  transition:
    filter 0.15s,
    box-shadow 0.15s;
}

.avatar-link:hover {
  filter: brightness(1.05);
  box-shadow: 0 0 0 3px rgb(82 212 74 / 18%);
  text-decoration: none;
}

.avatar-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* =========================================================================
   Content
   ========================================================================= */
.admin-content {
  padding: 28px 32px 48px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  flex: 1;

  /* Flex column so a child with `flex: 1` (e.g. `.companies-index`)
     can stretch to the full available height instead of leaving
     white space below the page footer. Pages that don't opt in keep
     their natural top-aligned block flow because they don't grow. */
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.admin-content > h1 {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 850;
  color: var(--text-strong);
}

/* =========================================================================
   Toolbar (above tables / content)
   ========================================================================= */
.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0 10px;
  flex-wrap: wrap;
}

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

.admin-toolbar__right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Mobile: collapse the toolbar to a single row.
   - "Компании · 84" subtitle is hidden (topbar already shows the page
     title; the bare count duplicated chrome).
   - Buttons get 26px height, 11px font, ⚙ stays icon-only.
   - Primary "Создать +" loses the inline word "компанию" via i18n
     so it fits next to the secondary actions. */
@media (width <= 1023px) {
  .admin-toolbar {
    gap: 4px 6px;
    padding: 4px 0 6px;
  }

  .admin-toolbar__left,
  .admin-toolbar__right {
    gap: 4px 6px;
  }

  .admin-toolbar__right .btn {
    height: 26px;
    padding: 0 7px;
    font-size: 11px;
    line-height: 1.1;
    gap: 4px;
    border-radius: 6px;
  }

  .admin-toolbar__right .btn--primary {
    padding: 0 9px;
  }

  .admin-toolbar__right .admin-form-icon {
    width: 13px;
    height: 13px;
  }
}

@media (width <= 720px) {
  .admin-toolbar__left {
    display: none;
  }

  .admin-toolbar__right {
    width: 100%;
  }

  .admin-toolbar__right .admin-table-config .btn .admin-form-label-text {
    display: none;
  }

  .admin-toolbar__right .admin-table-config .btn {
    padding: 0 6px;
  }
}

.admin-toolbar__search {
  height: 36px;
  padding: 0 12px;
  min-width: 220px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card-solid);
  color: var(--text);
  font-size: 13px;
}

.admin-toolbar__search:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn,
.admin-btn,
.btn:link,
.btn:visited,
.admin-btn:link,
.admin-btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  height: 36px;
  padding: 0 14px;

  /* Inherit page font so a `<input type="submit">` doesn't fall back
     to the OS-button face — UA stylesheets give submit inputs their
     own font/line-height, which made the primary action visually
     taller than the sibling `<a class="btn btn--ghost">`. */
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--card-solid);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  vertical-align: middle;
  appearance: none;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    transform 0.05s ease;
}

.btn:hover,
.admin-btn:hover {
  background: var(--card);
  border-color: var(--text);
}

.btn:active,
.admin-btn:active {
  transform: translateY(1px);
}

.btn--primary,
.admin-btn--primary {
  background: linear-gradient(var(--red), var(--red-2));
  border-color: var(--red-2);
  color: #fff;
}

.btn--primary:hover,
.admin-btn--primary:hover {
  filter: brightness(1.05);
  border-color: var(--red);
}

.btn--ghost,
.admin-btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn--ghost:hover,
.admin-btn--ghost:hover {
  color: var(--text-strong);
  background: var(--card);
}

.btn--danger,
.admin-btn--danger {
  background: transparent;
  border-color: var(--red);
  color: var(--red);
}

.btn--danger:hover,
.admin-btn--danger:hover {
  background: var(--red-soft);
}

.btn--small,
.admin-btn--small {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* =========================================================================
   Cards
   ========================================================================= */
.admin-card {
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: 0 8px 24px var(--shadow);
  margin-bottom: 18px;
}

.admin-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-strong);
}

.admin-card__subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

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

/* Breadcrumb-style "К списку" link rendered above an admin-card on
   show pages. Sits flush left, has a leading ← arrow, and is styled
   ghost-quiet so it does not compete with the primary action button
   inside the card header. */
.admin-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 6px 10px 6px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px;
  text-decoration: none;
  transition:
    color 0.12s ease,
    background 0.12s ease;
  cursor: pointer;
}

.admin-back-link:hover,
.admin-back-link:focus-visible {
  color: var(--text);
  background: var(--card-solid);
  text-decoration: none;
}

.admin-back-link__arrow {
  font-size: 16px;
  line-height: 1;
}

/* Inline copy-button affordance next to the address `<dd>` value.
   Two-column flex: address text on the left, 📋 button anchored top-
   right. Lets the operator copy the full Yandex-canonical address in
   one click — same UX as INN / website / contact email/phone. */
.admin-show-address__wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.admin-show-address__body {
  flex: 1 1 auto;
  min-width: 0;
}

/* Inline counter rendered inside `.admin-card__title` so the heading
   reads as a single line "Контакты · 4" instead of breaking the
   number onto a separate subtitle row. */
.admin-card__title-count {
  font-weight: 500;
  margin-left: 4px;
}

/* Embedded Yandex Maps view on `/companies/:id`. The canvas is hidden
   on first paint and only revealed once the Stimulus controller has
   resolved the address through Yandex's geocoder. The status paragraph
   carries the loading / error message until the canvas takes over. */
.company-map {
  position: relative;
  margin-top: 14px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card-solid);
  min-height: 320px;
}

.company-map__canvas {
  height: 320px;
  width: 100%;
  background: var(--card);
}

/* Dark-mode treatment for the Yandex map. The 2.1 JS API ships only
   a light schematic style — there's no `yandex#mapDark` we can pass
   to `new ymaps.Map`. Invert + hue-rotate the rendered tiles so the
   map matches the rest of the dark admin chrome. The placemark
   inside the tile canvas inherits the same filter (red → cyan-ish);
   that's an accepted tradeoff for getting a dark map without pulling
   in custom tiles. */
[data-theme="dark"] .company-map__canvas {
  filter: invert(0.92) hue-rotate(180deg) saturate(0.85);
}

.company-map__status {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  margin: 0;
}

/* Breadcrumbs above an admin-card show page. Section name is a link
   back to the index, separated by an arrow from the current record's
   name. Both crumbs share the same 18px/font-weight-700 type so they
   read as one continuous heading; only the colour differentiates the
   active link from the static current page. */
.admin-breadcrumbs {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--muted);
}

.admin-breadcrumbs__crumb {
  color: var(--muted);
  text-decoration: none;
  border-radius: 6px;
  padding: 2px 6px;
  margin: 0 -6px;
  transition:
    color 0.12s ease,
    background 0.12s ease;
}

.admin-breadcrumbs__crumb:hover,
.admin-breadcrumbs__crumb:focus-visible {
  color: var(--text);
  background: var(--card-solid);
  text-decoration: none;
}

.admin-breadcrumbs__sep {
  color: var(--muted);
  font-weight: 500;
  opacity: 0.7;
}

.admin-breadcrumbs__current {
  color: var(--text-strong);
  font-weight: 800;
}

.admin-card dl {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 10px 18px;
  margin: 0;
}

.admin-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.admin-card dd {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

/* =========================================================================
   Table
   ========================================================================= */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 12px;

  /* `overflow: hidden` would clip the sticky `thead th` cells below as soon
     as their offsetParent (the table) scrolled past, defeating the sticky
     header. We rely on `border-radius` + cell backgrounds to keep the
     rounded silhouette without clipping. */
  overflow: visible;
  box-shadow: 0 8px 24px var(--shadow);
}

/* Optional internal scroll wrapper. When `.admin-table--scroll` wraps the
   table, the `<tbody>` rows scroll inside the wrapper while the `<thead>`
   row stays pinned to the top of the visible viewport. Without the wrapper
   class the sticky offset still works against the page scroll. */
.admin-table-scroll {
  position: relative;
  overflow: auto;

  /* Reserve enough room for the toolbar (~60), the bulk footer with
     action buttons visible (~60), per-page selector + pagy nav on a
     wrapped row (~50), and a small breathing buffer (~30). The previous
     160px was tight when the bulk-actions panel was visible — the
     footer ended up squeezed against the viewport edge and overlapped
     by the last table row that bled past the scroll container. */
  max-height: calc(100vh - var(--admin-topbar-h) - 240px);
  border-radius: 12px;
}

/* Inline variant for tables that live inside a `.admin-card` (e.g. the
   contacts list on `/companies/:id`). Drops the page-level vertical
   max-height so the card grows with its content; only horizontal
   scroll kicks in if a row is wider than the card. */
.admin-table-scroll--inline {
  max-height: none;
  overflow-y: visible;
}

/* When the table has its own scroll container, sticky `<th>` should
   stick to the TOP of that container, not below the page-level
   topbar (the container already lives below the topbar, so the
   default `top: var(--admin-topbar-h)` opens an empty 56px gap where
   `<tbody>` rows bleed through). */
.admin-table-scroll .admin-table thead th,
.admin-table-scroll .admin-table__th {
  top: 0;
}

/* The cells (not the row) carry `position: sticky`. Sticking the row breaks
   in some browsers because `<tr>` has no offsetParent in CSS layout. Each
   `<th>` sticks individually, anchored just below the admin topbar. */
.admin-table thead th,
.admin-table__th {
  position: sticky;
  top: var(--admin-topbar-h);
  z-index: 5;
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-strong);

  /* Solid background — translucent backgrounds bleed table-body content
     through the sticky header during scroll. */
  background: var(--nav-bg);
  white-space: nowrap;
}

.admin-table td,
.admin-table__td {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;

  /* Keep every cell on one line. Long emails / addresses overflow
     the table horizontally and the surrounding `.admin-table-scroll`
     wrapper handles the horizontal scroll instead of breaking text
     in unsightly places. To opt out (free-flowing description columns),
     add the `admin-table__td--wrap` modifier. */
  white-space: nowrap;
}

.admin-table td.admin-table__td--wrap,
.admin-table__td--wrap {
  white-space: normal;
}

.admin-table tbody tr:nth-child(even) td {
  background: rgb(255 255 255 / 1.4%);
}

.admin-table tbody tr:hover td {
  background: var(--card);
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table__actions,
.admin-table td.admin-table__actions {
  text-align: right;
  white-space: nowrap;
}

.admin-table__actions a,
.admin-table__actions form {
  margin-left: 6px;
  display: inline-block;
}

.admin-table__link {
  color: var(--text-strong);
  font-weight: 700;
  text-decoration: none;
}

.admin-table__link:hover {
  text-decoration: underline;
}

.admin-table__muted {
  color: var(--muted);
  font-size: 12px;
}

/* Scrape-state badge — single-glyph indicator in /companies row.
   ✓ when SiteCrawler has run, otherwise a clickable ⟲ that posts
   to companies#scrape and enqueues the SiteCrawler job. */
.admin-table__td--badge,
.admin-table__th--badge {
  width: 56px;
  text-align: center;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: default;
  background: transparent;
  line-height: 1;
}

.admin-badge--ok {
  color: var(--green);
  background: rgb(82 212 74 / 12%);
  border-color: rgb(82 212 74 / 30%);
}

.admin-badge--action {
  cursor: pointer;
  color: var(--yellow);
  background: var(--yellow-soft);
  border-color: rgb(255 196 0 / 40%);
  transition:
    background 120ms ease,
    transform 120ms ease;
}

.admin-badge--action:hover {
  background: rgb(255 196 0 / 25%);
}

.admin-badge--action:active {
  transform: scale(0.94);
}

/* Text-pill badges (status / channel). The base .admin-badge is a 28px icon
   circle, which clips a word like «Активен»; these variants expand to a
   rounded pill that fits the label. */
.admin-badge--active,
.admin-badge--draft,
.admin-badge--channel,
.admin-badge--referral,
.admin-badge--service {
  width: auto;
  height: auto;
  padding: 3px 10px;
  font-size: 12px;
  border-radius: 999px;
}

.admin-badge--active {
  color: var(--green);
  background: rgb(82 212 74 / 14%);
  border-color: rgb(82 212 74 / 30%);
}

/* «Реферал» chip next to the company name when the row originated from the
   public /refer funnel. Brand-green like the landing's eyebrow + a margin so
   it doesn't collide with the company-name link. */
.admin-badge--referral {
  margin-left: 8px;
  color: var(--green);
  background: rgb(82 212 74 / 14%);
  border-color: rgb(82 212 74 / 30%);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* «Заявка» chip for direct IT-services leads (/services-* doorways) — same
   pill as «Реферал» but blue, so the two landing funnels are distinguishable
   at a glance. */
.admin-badge--service {
  margin-left: 8px;
  color: #58a6ff;
  background: rgb(88 166 255 / 14%);
  border-color: rgb(88 166 255 / 30%);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Whole-row tint for referral leads — subtle green background + a 3px
   left-accent on the first cell. Specificity is bumped (.admin-table) so the
   row's odd/even striping doesn't outrank us. */
.admin-table .admin-table__tr--referral > td {
  background: rgb(82 212 74 / 8%);
}

.admin-table .admin-table__tr--referral:hover > td {
  background: rgb(82 212 74 / 14%);
}

.admin-table .admin-table__tr--referral > td:first-child {
  box-shadow: inset 3px 0 0 var(--green);
}

/* Same whole-row treatment for direct service leads, in blue. */
.admin-table .admin-table__tr--service > td {
  background: rgb(88 166 255 / 8%);
}

.admin-table .admin-table__tr--service:hover > td {
  background: rgb(88 166 255 / 14%);
}

.admin-table .admin-table__tr--service > td:first-child {
  box-shadow: inset 3px 0 0 #58a6ff;
}

.admin-badge--draft {
  color: var(--muted);
  background: rgb(128 139 150 / 16%);
}

.admin-badge--channel {
  color: var(--text);
  background: rgb(128 139 150 / 14%);
}

/* Page header: title on the left, controls (badge + buttons) on the right,
   wrapping cleanly on narrow widths. Was unstyled, so the H1 and the controls
   collapsed onto each other (clipped badge + overlapping button). */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-page-header > h1 {
  margin: 0;
}

.admin-page-header > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* The Rails `button_to` helper wraps the button in a <form>. Strip
   the form's block-level box so the badge sits inline inside the
   <td>. */
.admin-table__td--badge form {
  display: inline;
  margin: 0;
}

/* SMS-reachability pill rendered next to a contact's phone
   (ContactsHelper#contact_sms_badge). Mobile = green (texts land),
   landline = muted (texts drop). Tooltip carries the full explanation. */
.contact-sms-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: default;
}

.contact-sms-badge--mobile {
  color: var(--green);
  background: rgb(82 212 74 / 12%);
  border-color: rgb(82 212 74 / 30%);
}

.contact-sms-badge--landline {
  color: var(--text-muted, #8a8f98);
  background: rgb(138 143 152 / 12%);
  border-color: rgb(138 143 152 / 30%);
}

/* Pending-invite acceptance link: a readonly URL field + copy button the
   admin hands to the invitee. Constrained width so the long token URL
   doesn't stretch the invite row. */
.tenant-invites__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.5rem;
}

.tenant-invites__link-input {
  width: 16rem;
  max-width: 40vw;
  padding: 0.25rem 0.5rem;
  font-size: 12px;
  font-family: var(--font-mono, ui-monospace, monospace);
  color: var(--text, inherit);
  background: var(--surface-2, rgb(255 255 255 / 4%));
  border: 1px solid rgb(138 143 152 / 30%);
  border-radius: 6px;
  cursor: text;
}

/* Status pills inside tables / cards */
.admin-status {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid transparent;
}

.admin-status--active,
.admin-status--success,
.admin-status--green {
  background: rgb(82 212 74 / 12%);
  color: var(--green);
  border-color: rgb(82 212 74 / 30%);
}

.admin-status--pending,
.admin-status--warning,
.admin-status--yellow {
  background: var(--yellow-soft);
  color: var(--yellow);
  border-color: rgb(255 196 0 / 30%);
}

.admin-status--suspended,
.admin-status--danger,
.admin-status--red {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgb(255 80 70 / 30%);
}

.admin-status--neutral,
.admin-status--muted,
.admin-status--cancelled,
.admin-status--draft,
.admin-status--expired {
  background: var(--card);
  color: var(--muted);
  border-color: var(--line-strong);
}

/*
   Domain-specific status modifiers. Map AASM states to one of the four
   visual buckets (green/yellow/red/muted). Defined here so views can write
   `admin-status--<%= record.status %>` without a per-domain helper.
*/
.admin-status--done,
.admin-status--approved,
.admin-status--completed,
.admin-status--reactivated {
  background: rgb(82 212 74 / 12%);
  color: var(--green);
  border-color: rgb(82 212 74 / 30%);
}

.admin-status--submitted {
  background: var(--yellow-soft);
  color: var(--yellow);
  border-color: rgb(255 196 0 / 30%);
}

.admin-status--rejected {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgb(255 80 70 / 30%);
}

/*
   Active/work-in-progress accent. Uses --orange because the design palette
   reserves blue tones for links only; orange reads as "attention, ongoing"
   and matches the start/pause buttons in the mobile design tokens.
   NB: `--active` is already green above (tenants/companies/employees use it
   for healthy/active state); orange is reserved for the "task is being
   worked on right now" / "force-review reopened" semantics.
*/
.admin-status--in_progress,
.admin-status--force_review {
  background: var(--orange-soft);
  color: var(--orange);
  border-color: rgb(255 159 20 / 30%);
}

/* =========================================================================
   Forms
   ========================================================================= */
.admin-form-grid {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 560px);
  gap: 14px 24px;
  align-items: start;
  margin-bottom: 18px;
}

.admin-form-grid > label,
.admin-form-grid > .admin-form-grid__label {
  padding-top: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.admin-form-grid input[type="text"],
.admin-form-grid input[type="email"],
.admin-form-grid input[type="password"],
.admin-form-grid input[type="url"],
.admin-form-grid input[type="number"],
.admin-form-grid input[type="tel"],
.admin-form-grid input[type="date"],
.admin-form-grid input[type="datetime-local"],
.admin-form-grid input[type="search"],
.admin-form-grid select,
.admin-form-grid textarea,
.admin-form-row input[type="text"],
.admin-form-row input[type="email"],
.admin-form-row input[type="password"],
.admin-form-row input[type="url"],
.admin-form-row select,
.admin-form-row textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text);
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
}

.admin-form-grid textarea,
.admin-form-row textarea {
  min-height: 84px;
  resize: vertical;
}

.admin-form-grid input:focus,
.admin-form-grid select:focus,
.admin-form-grid textarea:focus,
.admin-form-row input:focus,
.admin-form-row select:focus,
.admin-form-row textarea:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: var(--red);
}

/* Placeholder text in admin inputs/textareas. Browser default sits at
   ~50% of the input's `color`, which on the dark theme renders as a
   washed-out grey that's borderline-illegible. Pin to `--muted-2` so
   the example values stay visible without competing with the user's
   real input. */
.admin-form-grid input::placeholder,
.admin-form-grid textarea::placeholder,
.admin-form-row input::placeholder,
.admin-form-row textarea::placeholder {
  color: var(--muted-2);
  opacity: 1;
}

.admin-form-grid input:focus::placeholder,
.admin-form-grid textarea:focus::placeholder,
.admin-form-row input:focus::placeholder,
.admin-form-row textarea:focus::placeholder {
  color: var(--muted);
}

.admin-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.admin-form-row label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.admin-form-help {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* Inline 16×16 SVG glyph rendered at the start of a form-field label.
   Inherits the label's text colour through `currentColor`, so the icon
   tints with the surrounding label. */
.admin-form-icon {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  flex-shrink: 0;
  vertical-align: -3px;
  color: var(--muted);
}

/* Keep the icon and label text on a single baseline-aligned row. The
   `.admin-form-label-text` span makes it possible to truncate or
   restyle the wording without affecting the icon. */
.admin-form-grid > label,
.admin-form-row > label {
  display: inline-flex;
  align-items: center;
}

.admin-form-label-text {
  display: inline-block;
}

/* Stack the input + help/hint inside a single grid cell so the
   `.admin-form-grid` two-column layout still aligns the label to the
   first row. Without this wrapper the help text would steal a third
   column. */
.admin-form-grid__field {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
}

/* Required-field marker. Decorative — actual required-ness is conveyed to
   assistive tech via the `<input required>` attribute and `speak: never`
   tells screen readers to skip the visual asterisk. */
.admin-form-grid > label.admin-form-required::after,
.employee-edit-form label.admin-form-required::after {
  content: " *";
  color: var(--red);
  font-weight: 800;
  margin-left: 2px;
  speak: never;
}

/* One-line legend that explains the meaning of `*` once per form. */
.admin-form-required-hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}

/* Native <select> styling — matches input height/border, drops the
   browser caret in favour of a chevron drawn as a background-image. */
.admin-form-grid select,
.admin-form-row select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%2393a4b8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 12px;
  padding-right: 32px;
  cursor: pointer;
}

.admin-form-grid select:focus,
.admin-form-row select:focus {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23ff5046' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}

/* HTML5 :invalid styling — lights up the field once the user has
   touched it and left it empty (or in a wrong format). Only kicks in
   after a focus pass to avoid screaming red on first paint. */
.admin-form-grid input:user-invalid,
.admin-form-grid select:user-invalid,
.admin-form-grid textarea:user-invalid,
.admin-form-row input:user-invalid,
.admin-form-row select:user-invalid,
.admin-form-row textarea:user-invalid {
  border-color: var(--red);
  background-color: var(--red-soft);
}

.admin-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-form-errors {
  list-style: none;
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
}

.admin-form-errors li + li {
  margin-top: 4px;
}

/* Sub-section inside an admin form (e.g. nested-attributes contacts on
   the Company form). Visually a soft-bordered block so the operator
   reads it as a related-but-detachable group without a hard rule. */
.admin-form-fieldset {
  margin: 18px 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}

.admin-form-fieldset__legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text-strong);
  text-transform: uppercase;
}

.admin-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 12px 0 16px;
}

.admin-contact-row {
  position: relative;
  padding: 14px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-solid);
}

.admin-contact-row[hidden] {
  display: none;
}

.admin-contact-row__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

@media (width <= 720px) {
  .admin-contact-row__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.admin-contact-row__destroy-flag {
  display: none;
}

.admin-contact-row__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.admin-contact-row__remove:hover {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red);
}

/* Address suggester (Yandex Geocoder proxy). The wrapper is `position:
   relative` so the dropdown anchors to the input below it. */
.address-suggest {
  position: relative;
}

/* `.address-block` carries `data-controller="address-suggest"` and wraps
   BOTH the search input and the structured sub-fields (postal_code, city,
   street, house, office) so Stimulus targets resolve. `display: contents`
   makes the wrapper invisible to the layout so its label + field children
   stay direct grid items of the parent `.admin-form-grid` (label | field). */
.address-block {
  display: contents;
}

/* Sub-field collapsible. Spans both columns of the parent admin-form-grid
   and re-establishes its own grid for the label/input pairs inside, so
   the dense form layout stays consistent. Hidden by default — revealed
   either by a successful suggestion pick OR by clicking the toggle. */
.address-block__details {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 560px);
  gap: 14px 24px;
  align-items: start;
  margin-top: 6px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 10px;
}

/* "Без квартиры" checkbox row + the greyed flat field it controls. */
.address-block__no-flat {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.address-block__no-flat input {
  cursor: pointer;
}

.address-block .is-muted {
  opacity: 0.5;
}

.address-block__details[hidden] {
  display: none;
}

.address-block__details > label {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

/* Readonly sub-fields look quieter than active inputs so the operator
   sees at a glance "this came from the geocoder". `enableEdit` flips
   readOnly off; the muted style fades back to normal once the attribute
   is gone. */
.address-block__details input[readonly] {
  background: var(--card-solid);
  color: var(--muted);
  cursor: not-allowed;
}

/* Container for the toggle button under the address search input. Sits
   inside the field column so it aligns with the input, not the label. */
.address-block__toggles {
  display: flex;
  margin-top: 6px;
}

.address-block__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 4px 0;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.address-block__toggle:hover {
  color: var(--accent-strong, var(--accent));
}

.address-block--expanded .address-block__toggle-arrow {
  transform: rotate(180deg);
}

.address-block__toggle-arrow {
  display: inline-block;
  transition: transform 0.15s ease;
}

/* "Изменить вручную" sits at the end of the details panel, spans both
   columns, and is right-aligned so it reads as a footer action. */
.address-block__edit-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.address-block__edit-toggle {
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.address-block__edit-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.address-suggest__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 12px 24px var(--shadow);
}

.address-suggest__list[hidden] {
  display: none;
}

.address-suggest__item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  outline: none;
}

.address-suggest__item:hover,
.address-suggest__item:focus {
  background: var(--card);
  color: var(--text-strong);
}

.address-suggest__value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-suggest__meta {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   Show pages — read-only details for `companies/show`, `tasks/show`, etc.
   ========================================================================= */

/* Inline 16×16 icon at the start of a `<dt>` label. Mirrors the
   `.admin-form-icon` baseline tweak so icon + text align on the same row. */
.admin-card dt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-card dt .admin-form-icon {
  margin-right: 0;
  color: var(--muted);
}

/* Numeric values that benefit from monospaced digits (INN, postal code,
   phone). `<code>`-like font so 10/12-digit strings line up cleanly. */
.admin-show-mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

/* Inline copy-to-clipboard button. Lives next to a value (INN, email,
   phone) inside an `<dd>` — kept small + ghost so it does not compete
   with the value itself. `is-copied` is added by the Stimulus
   `copy-button` controller for ~1.2s. */
.admin-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 22px;
  padding: 0 6px;
  margin-left: 8px;
  font-size: 11px;
  line-height: 1;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}

.admin-copy-btn:hover {
  background: var(--card-solid);
  color: var(--text-strong);
  border-color: var(--text);
}

.admin-copy-btn.is-copied {
  background: rgb(82 212 74 / 12%);
  color: var(--green);
  border-color: rgb(82 212 74 / 30%);
}

/* Structured address block on `companies/show`. One `<dd>` value per line
   with the postal_code muted-and-monospaced ahead of the locality block. */
.admin-show-address {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.admin-show-address__postal {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 12px;
}

/* Highlighted card for free-form prose inside a show page (task
   instructions, result notes). Reads as a separate panel rather than a
   flat `<dd>` line. */
.admin-show-card {
  margin: 0;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--red);
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* =========================================================================
   Empty state
   ========================================================================= */
.admin-empty-state {
  background: var(--card-solid);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  margin: 18px 0;
}

.admin-empty-state__icon {
  font-size: 30px;
  margin-bottom: 8px;
  color: var(--muted);
}

.admin-empty-state__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
}

.admin-empty-state__body {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

/* =========================================================================
   Pagination (kaminari / will_paginate friendly)
   ========================================================================= */
.admin-pagination,
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
  flex-wrap: wrap;
}

.admin-pagination a,
.admin-pagination span,
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--card-solid);
  text-decoration: none;
  cursor: pointer;
}

.admin-pagination a:hover,
.pagination a:hover {
  border-color: var(--text);
}

.admin-pagination .current,
.pagination .current {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 800;
  cursor: default;
}

/* =========================================================================
   Flash messages (admin layout)
   ========================================================================= */
.admin-body .flash {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
}

.admin-body .flash--notice {
  background: rgb(82 212 74 / 10%);
  border-color: rgb(82 212 74 / 40%);
  color: var(--green);
}

.admin-body .flash--alert {
  background: var(--red-soft);
  border-color: var(--red);
  color: var(--red);
}

/* =========================================================================
   Devise pre-auth screens
   ========================================================================= */
body.devise-body {
  margin: 0;
  max-width: none;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.devise-shell {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.devise-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-strong);
}

.devise-brand__name {
  font-size: 22px;
  font-weight: 850;
  letter-spacing: 0.4px;
}

.devise-brand__tagline {
  font-size: 12px;
  color: var(--muted);
}

.devise-card {
  width: 100%;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 24px;
  box-shadow: 0 18px 40px var(--shadow);
}

.devise-card__title {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-strong);
}

.devise-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.devise-card .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.devise-card label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.devise-card input[type="text"],
.devise-card input[type="email"],
.devise-card input[type="password"] {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--page-bg-a);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-sizing: border-box;
  font-family: inherit;
}

.devise-card input:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
  border-color: var(--red);
}

.devise-card .field-hint {
  font-size: 11px;
  color: var(--muted);
}

.devise-card .actions {
  margin-top: 6px;
}

.devise-card input[type="submit"],
.devise-card button[type="submit"] {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(var(--red), var(--red-2));
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.devise-card input[type="submit"]:hover,
.devise-card button[type="submit"]:hover {
  filter: brightness(1.05);
}

.devise-card .remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.devise-card .remember-me input[type="checkbox"] {
  cursor: pointer;
}

.devise-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}

.devise-links a {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.devise-links a:hover {
  color: var(--text-strong);
  text-decoration: underline;
}

/* stylelint-disable-next-line selector-class-pattern -- класс рисует сам Rails (field_error_proc), переименовать нечем */
.devise-card .field_with_errors {
  display: contents;
}

/* stylelint-disable-next-line selector-class-pattern -- класс рисует сам Rails (field_error_proc), переименовать нечем */
.devise-card .field_with_errors input {
  border-color: var(--red);
}

/* =========================================================================
   Daily-plan progress bars (used inside .admin-card on
   `app/views/daily_plans/show.html.erb`). The base `.daily-plan__bars`
   class lives in components.css; this block adds row layout for each
   `<li>` so the label / progress / percentage line up.
   ========================================================================= */
.daily-plan__bars {
  list-style: none;
  padding: 0;
  margin: 0;
  height: auto;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.daily-plan__bar {
  display: grid;
  grid-template-columns: 110px 1fr 60px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text);
}

.daily-plan__bar-label {
  font-weight: 700;
  color: var(--text-strong);
}

.daily-plan__bar progress {
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 99px;
  border: 0;
  background: rgb(128 139 150 / 18%);
  overflow: hidden;
}

.daily-plan__bar progress::-webkit-progress-bar {
  background: rgb(128 139 150 / 18%);
  border-radius: 99px;
}

.daily-plan__bar progress::-webkit-progress-value {
  background: linear-gradient(var(--red), var(--red-2));
  border-radius: 99px;
}

.daily-plan__bar progress::-moz-progress-bar {
  background: var(--red);
  border-radius: 99px;
}

.daily-plan__bar-value {
  text-align: right;
  font-weight: 700;
  color: var(--muted);
}

/* =========================================================================
   Evidence file list (used inside `.admin-card` on
   `app/views/evidences/show.html.erb`). One row per attached file —
   plain link with hover underline; the muted block below replaces a
   bullet so the list reads cleanly inside the dark card.
   ========================================================================= */
.evidence-show__files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.evidence-show__file {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  font-size: 13px;
}

.evidence-show__reject-reason {
  color: var(--red);
  font-weight: 600;
}

/* Side-by-side compare on evidences/show: entered company data (left) vs the
   proof screenshot (right), so the reviewer checks them at a glance. Collapses
   to one column on narrow screens. */
.evidence-compare {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.evidence-compare--single {
  grid-template-columns: 1fr;
}

.evidence-compare .admin-card {
  margin-bottom: 0;
  align-self: start; /* content-height — never stretch the short card into a void */
}

/* The proof thumbnail button: a click opens the image full-size in the lightbox. */
.evidence-show__thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

/* Cap the inline screenshot to a preview height so a full-page capture doesn't
   dominate the card; the full image is one click away in the lightbox. */
.evidence-show__image {
  max-width: 100%;
  max-height: 420px;
  width: auto;
  height: auto;
  border-radius: 10px;
  display: block;
}

@media (width <= 900px) {
  .evidence-compare {
    grid-template-columns: 1fr;
  }
}

/* Full-size image lightbox — lightbox_controller.js builds the overlay on click. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgb(0 0 0 / 82%);
  cursor: zoom-out;
}

.lightbox__img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 16px 56px rgb(0 0 0 / 60%);
  cursor: default;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 40px;
  height: 40px;
  font-size: 26px;
  line-height: 1;
  color: #fff;
  background: rgb(0 0 0 / 45%);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

body.lightbox-open {
  overflow: hidden;
}

/*
   Tenant tab strip (used inside `.admin-card` on
   `app/views/tenants/show.html.erb`). Pure layout — links inside use
   `.btn .btn--ghost` so they automatically pick up the design-system
   focus / hover states; this rule only spaces them and gives the
   `tenant-tabs` container an underline so it still reads as a "tab
   strip" against the rest of the card.
*/
.tenant-show__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.tenant-show__billing-placeholder {
  margin: 0;
  padding: 18px 0;
  font-size: 13px;
}

/* Tenant suspended banner (`app/views/tenants/_suspended_banner.html.erb`).
   Keeps the legacy `.tenant-banner--<status>` BEM modifier so any
   request specs that select on the status data attribute keep working;
   visually it is a flash-like callout pinned above the tenant header. */
.tenant-banner {
  margin: 0 0 16px;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--card-solid);
}

.tenant-banner__title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-strong);
}

.tenant-banner__body {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.tenant-banner--suspended {
  border-color: var(--red);
  background: var(--red-soft);
}

.tenant-banner--suspended .tenant-banner__title {
  color: var(--red);
}

.tenant-banner--pending {
  border-color: rgb(255 196 0 / 40%);
  background: var(--yellow-soft);
}

.tenant-banner--pending .tenant-banner__title {
  color: var(--yellow);
}

.tenant-banner--deleted {
  border-color: var(--line-strong);
  background: var(--card);
}

/* =========================================================================
   Topbar hamburger (mobile only — hidden by default at >= 1024px)
   ========================================================================= */
.admin-topbar__menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease;
}

.admin-topbar__menu-toggle:hover {
  background: var(--card);
  border-color: var(--line);
}

.admin-topbar__menu-toggle:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.admin-topbar__menu-toggle-icon {
  font-size: 22px;
  line-height: 1;
}

/* =========================================================================
   Off-canvas drawer backdrop (mobile only — sibling of the sidebar)
   ========================================================================= */
.admin-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgb(0 0 0 / 55%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

/* =========================================================================
   Responsive
   ========================================================================= */
@media (width <= 1023px) {
  .admin-topbar__menu-toggle {
    display: inline-flex;
  }

  .admin-topbar {
    padding: 0 16px;
    gap: 12px;
  }

  /* Off-canvas drawer: sidebar slides in from the left over a backdrop. */
  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(86vw, 320px);
    flex: 0 0 auto;
    height: 100vh;
    height: 100dvh;
    padding: 18px 14px 14px;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 12px 32px var(--shadow);
  }

  .admin-drawer-backdrop {
    display: block;
  }

  /* Tap-friendly nav items (>= 44px per Apple HIG). */
  .admin-sidebar__item {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .admin-sidebar__sign-out {
    min-height: 44px;
    padding: 10px 12px;
  }

  .admin-sidebar__brand {
    min-height: 44px;
  }

  /* Drawer-open state: slide sidebar in, fade backdrop in, lock body scroll. */
  body.admin-body.admin-body--drawer-open {
    overflow: hidden;
  }

  body.admin-body--drawer-open .admin-sidebar {
    transform: translateX(0);
  }

  body.admin-body--drawer-open .admin-drawer-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (width <= 767px) {
  .admin-topbar {
    height: 50px;
    padding: 0 12px;
    gap: 8px;
  }

  .admin-topbar__title {
    font-size: 15px;
  }

  /* On phones the tenant switcher would steal the topbar; current tenant is
     still visible inside the drawer (admin-sidebar__brand-tenant). Hide
     until the user reaches a wider viewport. */
  .admin-topbar__tenant-switcher {
    display: none;
  }

  .admin-topbar__user-name {
    display: none;
  }

  .admin-content {
    padding: 16px 12px 32px;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-form-grid > label {
    padding-top: 0;
  }

  .admin-card dl {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }

  .admin-card dt {
    margin-top: 8px;
  }

  /* Tables — let them scroll horizontally */
  .admin-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* =========================================================================
   Light theme overrides
   ========================================================================= */
body.admin-body[data-theme="light"] .admin-sidebar {
  border-right-color: var(--line-strong);
}

body.admin-body[data-theme="light"] .admin-table tbody tr:nth-child(even) td {
  background: rgb(0 0 0 / 1.8%);
}

/* =========================================================================
   /companies index — filters + sortable headers + bulk actions + pagy
   ========================================================================= */
.admin-table__filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-table__filters-spacer {
  flex: 1 1 auto;
}

.admin-toolbar__select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card-solid);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.admin-table__per-page {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1;
  margin: 0;
}

.admin-table__per-page label {
  margin: 0;
  line-height: 28px;
}

.admin-table__per-page select {
  box-sizing: border-box;
  height: 28px;
  min-height: 28px;
  max-height: 28px;
  margin: 0;
  padding: 0 26px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background-color: var(--card-solid);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='none' stroke='%2399a2ad' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  color: var(--text);
  font-size: 12px;
  line-height: 26px;
  cursor: pointer;
  align-self: center;
  appearance: none;
}

.admin-table__sort {
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-table__sort.is-active {
  color: var(--text);
}

.admin-table__sort:hover {
  color: var(--text);
}

.admin-table__th--checkbox,
.admin-table__td--checkbox {
  width: 56px;
  text-align: left;
  padding-left: 8px;
  padding-right: 4px;
}

.admin-table__th--checkbox {
  width: 56px;
  padding-left: 8px;
  padding-right: 4px;
}

.admin-table__th--checkbox input,
.admin-table__td--checkbox input {
  cursor: pointer;
}

/* Combined checkbox + row-menu cell. Checkbox on the left, `⋮` trigger
   to its right — replaces the dedicated trailing "Действия" column.
   Tightened gap from 6px → 2px so the column reads as a compact
   "selectable + actions" gutter, not a half-width column of empty space. */
.admin-table__row-controls {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* The `<td>` containing the row-menu trigger needs `position: relative`
   so the absolutely-positioned `.row-menu__panel` anchors to it. */
.admin-table td.admin-table__td--checkbox[data-controller~="row-menu"] {
  position: relative;
}

/* =========================================================================
   Per-column filter popovers (rendered inside `<th>` cells)
   ========================================================================= */
.admin-table__th--filterable {
  /* Anchor for the absolutely-positioned popover. The cell is already
     `position: sticky`; `position: relative` inside the same rule has no
     effect on sticky behaviour, but DOES create a containing block for
     the popover's `position: absolute`. */
  position: sticky;
}

.admin-table__col-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-table__filter-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.admin-table__filter-trigger:hover {
  background: var(--card);
  color: var(--text-strong);
}

.admin-table__filter-trigger.is-active {
  color: var(--red);
  border-color: var(--line-strong);
  background: var(--card);
}

.admin-table__filter-trigger:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.admin-table__filter-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 20;
  min-width: 220px;
  max-width: 280px;
  padding: 12px;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 16px 32px var(--shadow);
}

.admin-table__filter-popover[hidden] {
  display: none;
}

.admin-table__filter-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-table__filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin: 0;
}

.admin-table__filter-input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--card-solid);
  color: var(--text);
  font-size: 13px;
}

.admin-table__filter-input:focus {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.admin-table__filter-checks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 0;
  padding: 0;
  margin: 0;
  max-height: 240px;
  overflow-y: auto;
}

.admin-table__filter-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

.admin-table__filter-check input {
  cursor: pointer;
}

/* =========================================================================
   Bottom bulk + per-page + pagy footer
   ========================================================================= */

/* Single bordered card. Mobile: rows stack vertically (column).
   Desktop (≥768px): rows on one line — bulk grows to push nav right. */
.companies-bulk__footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.companies-bulk__row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.companies-bulk__row--nav {
  justify-content: space-between;
}

.companies-bulk__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.companies-bulk__actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.companies-bulk__actions[hidden] {
  display: none;
}

.companies-bulk__footer .admin-table__pagination {
  margin: 0;
  padding: 0;
  border: 0;
}

@media (width >= 768px) {
  .companies-bulk__footer {
    flex-flow: row wrap;
    align-items: center;
    gap: 12px;
  }

  /* `flex: 1 1 auto` on bulk + `flex: 0 0 auto` on nav makes the
     bulk row absorb leftover horizontal space, which naturally pushes
     the nav row to the right edge — no `margin-left: auto` trick. */
  .companies-bulk__row--bulk {
    flex: 1 1 auto;
  }

  .companies-bulk__row--nav {
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
  }
}

/* Sentinel row for `?items=all` infinite scroll. Centred status text
   doubles as a "loading" indicator while the IntersectionObserver
   waits for the next page to land. */
.companies-infinite__sentinel,
.admin-infinite__sentinel {
  text-align: center;
  font-size: 12px;
  padding: 14px 12px;
}

/* Generic shared variants of the .companies-bulk__* / .companies-index
   classes so every admin index can opt into the same standard chrome
   without duplicating CSS. */
.admin-bulk-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 10px;
}

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

.admin-bulk-footer__row--nav {
  justify-content: space-between;
}

.admin-bulk-footer__count {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.admin-bulk-footer__actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-bulk-footer__actions[hidden] {
  display: none;
}

.admin-bulk-footer .admin-table__pagination {
  margin: 0;
  padding: 0;
  border: 0;
}

@media (width >= 768px) {
  .admin-bulk-footer {
    flex-flow: row wrap;
    align-items: center;
    gap: 12px;
  }

  .admin-bulk-footer__row--bulk {
    flex: 1 1 auto;
  }

  .admin-bulk-footer__row--nav {
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
  }
}

/* Make admin index pages fill the viewport vertically: toolbar +
   table-scroll + footer take the full height of `.admin-content`,
   the table-scroll grows to fill the gap, and the bulk/pagy footer
   sticks at the bottom edge instead of leaving white space below.
   `.companies-index` and `.admin-index--fill` both opt in by setting
   `flex: 1`; other admin pages keep their natural top-aligned layout
   because they don't grow. */
.companies-index,
.admin-index--fill {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.companies-index .admin-table-scroll,
.admin-index--fill .admin-table-scroll {
  flex: 1 1 0;
  min-height: 200px;

  /* Override the conservative global `max-height` cap (computed
     against `100vh` minus a fudge factor) — inside this flex column
     the parent already constrains us, and the cap was clipping the
     table to roughly half the viewport. */
  max-height: none;
}

/* =========================================================================
   "Настроить таблицу" modal
   ========================================================================= */
.admin-table-config {
  position: relative;
  display: inline-block;
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.admin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 50%);
}

.admin-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 20px 22px;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 24px 64px var(--shadow);
}

.admin-modal__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
}

.admin-modal__hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
}

.admin-modal__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-modal__check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.admin-modal__check input {
  cursor: pointer;
}

.admin-modal__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

body.admin-modal--open {
  overflow: hidden;
}

/* =========================================================================
   Per-row "⋮" action menu
   ========================================================================= */
.admin-table td.admin-table__actions[data-controller~="row-menu"] {
  position: relative;
}

.row-menu__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}

.row-menu__trigger:hover {
  background: var(--card);
  color: var(--text-strong);
  border-color: var(--line);
}

.row-menu__trigger:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.row-menu__panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 8px;
  z-index: 15;
  min-width: 180px;
  padding: 6px;
  background: var(--card-solid);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 16px 32px var(--shadow);
  display: flex;
  flex-direction: column;
}

.row-menu__panel[hidden] {
  display: none;
}

.row-menu__item {
  display: block;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
}

.row-menu__item:hover,
.row-menu__item:focus {
  background: var(--card);
  color: var(--text-strong);
  outline: none;
}

.row-menu__item--danger {
  color: var(--red);
}

.row-menu__item--danger:hover,
.row-menu__item--danger:focus {
  background: var(--red);
  color: #fff;
}

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

.admin-table__pagination .pagy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Pagy 9 emits plain `<a>` for prev/next/page links — disabled prev/next
   omit the `href` and add `aria-disabled="true"`. Background is
   transparent so the chip doesn't merge into the parent card (which
   itself uses `--card-solid`); border + text colour carry the shape. */
.admin-table__pagination .pagy a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.admin-table__pagination .pagy a:hover {
  background: var(--card);
  border-color: var(--text);
}

.admin-table__pagination .pagy a.current,
.admin-table__pagination .pagy .current {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 700;
  cursor: default;
}

.admin-table__pagination .pagy a[aria-disabled="true"]:not(.current),
.admin-table__pagination .pagy .gap,
.admin-table__pagination .pagy .disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.55;
}

/* Pointer cursor on every interactive element (AGENTS.md UI rule). */
.admin-body a,
.admin-body button,
.admin-body summary,
.admin-body label[for],
.admin-body [role="button"],
.admin-body [data-action] {
  cursor: pointer;
}

.admin-body button:disabled,
.admin-body [aria-disabled="true"] {
  cursor: not-allowed;
}

/* Second-row pill tabs (the status funnel under the channel tabs on
   /outreach/activity) tuck closer under the primary tab row. */
.admin-pill-tabs--sub {
  margin-top: -4px;
}

/* ── Article cover drag-and-drop upload ─────────────────────────────────────
   Drop zone for the cover image in /admin/articles (file-dropzone controller).
   Dashed target that highlights on drag-over, with a preview + remove row. */
.admin-form-hint {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* The cover dropzone is one grid field (label | dropzone), but its hint and the
   «current cover» preview are extra DIRECT children of `.admin-form-grid`. Span
   them full-width so each takes its own row instead of stealing the next field's
   column and shifting every following label/input out of alignment. */
.admin-form-grid > .admin-form-hint,
.admin-form-grid > .article-dropzone__current {
  grid-column: 1 / -1;
}

.article-dropzone__zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
  border: 2px dashed var(--line-strong, #3a3a42);
  border-radius: 10px;
  background: var(--surface-2, rgb(255 255 255 / 2%));
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}

.article-dropzone__zone.is-dragging {
  border-color: var(--accent, #4ade80);
  background: var(--accent-soft, rgb(74 222 128 / 8%));
}

.article-dropzone__prompt {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* The real <input type=file> is hidden — the «Выбрать файл» button proxies it. */
.article-dropzone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.article-dropzone__error {
  margin: 4px 0 0;
  color: var(--red, #f87171);
  font-size: 13px;
}

.article-dropzone__preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

/* Respect the `hidden` attribute the Stimulus controller toggles — a bare
   `display: flex` would otherwise override the UA `[hidden] { display:none }`
   and show an empty preview + «remove» before any file is picked. */
.article-dropzone__preview[hidden] {
  display: none;
}

.article-dropzone__current {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.article-dropzone__thumb {
  width: 120px;
  height: 70px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line, #2a2a30);
}

.article-dropzone__name {
  font-size: 13px;
  color: var(--muted-2, #9a9aa2);
  word-break: break-all;
}
/* app/assets/stylesheets/blog.css
   Public SEO blog (/articles) — feed + article page. Standalone LIGHT layout
   (rendered inside layouts/referral), so it reads the light design tokens with
   safe literal fallbacks. Every interactive element gets cursor: pointer. */

.blog {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 20px 80px;
  color: var(--text, #1a1a1a);
}

.blog__head {
  text-align: center;
  margin-bottom: 28px;
}

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

/* Brand = logo + wordmark inline, matching the home (/) header. */
.blog__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  text-decoration: none;
  color: var(--text, #1a1a1a);
  cursor: pointer;
}

.blog__brand:hover .blog__brand-name {
  color: var(--red, #e11d2a);
}

.blog__brand-logo {
  display: block;
  width: 56px;
  height: 56px;
}

.blog__brand-name {
  line-height: 1;
}

.blog__head:not(.blog__head--row) .blog__brand {
  justify-content: center;
  margin-bottom: 14px;
}

.blog__head--row .blog__brand-logo {
  width: 48px;
  height: 48px;
}

.blog__head--row .blog__brand {
  font-size: 18px;
}

.blog__title {
  font-size: 34px;
  line-height: 1.15;
  margin: 6px 0;
}

.blog__subtitle {
  color: var(--muted, #6b7280);
  font-size: 16px;
  margin: 0;
}

.blog__back {
  display: inline-block;
  color: var(--muted, #6b7280);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.blog__back:hover {
  text-decoration: underline;
}

.blog__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 18px 0 28px;
}

.blog__chip {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 999px;
  background: var(--card, #fff);
  color: var(--text, #1a1a1a);
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}

.blog__chip:hover {
  border-color: var(--red, #e11d2a);
}

.blog__chip--active {
  background: var(--red, #e11d2a);
  border-color: var(--red, #e11d2a);
  color: #fff;
}

/* Weighted tag cloud — chips sized by tag popularity (s1 = rarest … s5 = top).
   `align-items: baseline` keeps the different-sized pills sitting on a line. */
.blog__tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 8px 10px;
}

.blog__chip--s1 {
  font-size: 12px;
  opacity: 0.82;
}

.blog__chip--s2 {
  font-size: 14px;
  opacity: 0.9;
}

.blog__chip--s3 {
  font-size: 16px;
}

.blog__chip--s4 {
  font-size: 19px;
  font-weight: 600;
}

.blog__chip--s5 {
  font-size: 23px;
  font-weight: 700;
}

.blog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.blog-card {
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card, #fff);
  transition:
    box-shadow 0.15s,
    transform 0.15s;
}

.blog-card:hover {
  box-shadow: 0 8px 28px rgb(0 0 0 / 8%);
  transform: translateY(-2px);
}

.blog-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.blog-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--page-bg-b, #f3f4f6);
}

.blog-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
  flex: 1;
}

.blog-card__channel {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--red, #e11d2a);
  font-weight: 600;
}

.blog-card__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.blog-card__excerpt {
  font-size: 14px;
  color: var(--muted, #6b7280);
  line-height: 1.45;
  flex: 1;
}

.blog-card__meta {
  font-size: 13px;
  color: var(--muted, #9ca3af);
  margin-top: 4px;
}

.blog__empty {
  text-align: center;
  color: var(--muted, #6b7280);
  padding: 60px 0;
}

.blog__pagination {
  margin: 36px 0 0;
  display: flex;
  justify-content: center;
}

.blog__pagination .pagy,
.blog__pagination nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.blog__pagination a,
.blog__pagination span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text, #1a1a1a);
  background: var(--card, #fff);
  cursor: pointer;
}

.blog__pagination a:hover {
  border-color: var(--red, #e11d2a);
}

.blog__pagination .current {
  background: var(--red, #e11d2a);
  color: #fff;
  border-color: var(--red, #e11d2a);
}

.blog__pagination .disabled,
.blog__pagination .gap {
  color: var(--muted, #9ca3af);
  border-color: transparent;
  cursor: default;
}

.blog__tags {
  margin-top: 48px;
  text-align: center;
}

.blog__tags-title,
.blog__related-title {
  font-size: 18px;
  margin-bottom: 14px;
}

/* Article page */
.blog--article {
  max-width: 760px;
}

.article__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 10px;
  font-size: 14px;
}

.article__date {
  color: var(--muted, #6b7280);
}

.article__title {
  font-size: 32px;
  line-height: 1.2;
  margin: 4px 0 20px;
}

.article__hero {
  margin: 0 0 24px;
}

.article__img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
}

.article__body {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text, #1a1a1a);
}

.article__body p {
  margin: 0 0 1em;
}

.article__cta {
  margin: 28px 0;
  text-align: center;
}

.blog-btn {
  display: inline-block;
  padding: 14px 28px;
  background: var(--red, #e11d2a);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.blog-btn:hover {
  opacity: 0.9;
}

.article__tags {
  justify-content: flex-start;
  margin-top: 28px;
}

.blog__related {
  margin-top: 56px;
}

@media (width <= 600px) {
  .blog__title {
    font-size: 27px;
  }

  .article__title {
    font-size: 25px;
  }

  .blog__head--row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
/* Minimal component layer — Phase 0 gap-fill until proper design system.
   Uses tokens from design_tokens.css. */

html,
body {
  background: linear-gradient(180deg, var(--page-bg-a) 0%, var(--page-bg-b) 100%);
  color: var(--text);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.45;
}

* {
  box-sizing: border-box;
}

body {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 18px 96px;
}

h1,
h2,
h3,
h4 {
  color: var(--text-strong);
  margin: 0 0 12px;
  line-height: 1.2;
}

h1 {
  font-size: 28px;
  font-weight: 700;
}

h2 {
  font-size: 22px;
  font-weight: 600;
}

h3 {
  font-size: 18px;
  font-weight: 600;
}

p,
ul,
ol {
  margin: 0 0 12px;
}

a {
  color: #6aa9ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6aa9ff;
  box-shadow: 0 0 0 3px rgb(106 169 255 / 18%);
}

/* Double-submit guard: a submitted button is disabled + aria-busy="true"
   (double_submit_guard.js) so it can't fire the same action twice. Show that
   blocked state everywhere — dimmed, no pointer, and inert to clicks. */
button[aria-busy="true"],
input[type="submit"][aria-busy="true"],
.btn[aria-busy="true"],
.admin-btn[aria-busy="true"] {
  opacity: 0.65;
  cursor: progress;
  pointer-events: none;
}

/* Mobile-only button defaults. The `body:not(.admin-body)` guard keeps these
   from cascading into the desktop admin chrome, where admin.css owns the
   `.btn` family and uses the red-gradient primary / ghost / danger variants
   defined under `body.admin-body`. Without the guard, this block would beat
   admin.css purely on source order (require_tree . loads alphabetically:
   admin → components). */
body:not(.admin-body) button,
body:not(.admin-body) input[type="submit"],
body:not(.admin-body) .btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 10px;
  background: #6aa9ff;
  color: #04101f;
  border: 0;
  font-weight: 600;
  cursor: pointer;
  font-size: 15px;
  text-decoration: none;
  font-family: inherit;
}

body:not(.admin-body) button:hover,
body:not(.admin-body) input[type="submit"]:hover,
body:not(.admin-body) .btn:hover {
  filter: brightness(1.08);
  text-decoration: none;
}

body:not(.admin-body) .btn--secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line-strong);
}

body:not(.admin-body) .btn--danger {
  background: var(--red);
  color: #fff;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 6px;
  accent-color: #6aa9ff;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}

form > div,
form > p {
  margin-bottom: 10px;
}

.flash,
.errors {
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  background: var(--card);
  border: 1px solid var(--line);
}

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.flash__text {
  flex: 1;
  min-width: 0;
}

.flash__close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.flash__close:hover {
  opacity: 1;
}

.flash--leaving {
  opacity: 0;
  transform: translateY(-6px);
}

.flash--notice {
  border-color: var(--green);
}

.flash--alert {
  border-color: var(--red);
  background: var(--red-soft);
}

.errors {
  border-color: var(--red);
  background: var(--red-soft);
}

/* Cards & lists */
.card,
.company,
.contact,
.daily-plan,
.employee-profile,
.calendar,
.approval-detail,
.approval-queue,
.billing-tab,
.companies,
.contacts,
.daily-plans,
.csv-import,
.earn {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
}

/* Bottom nav (mobile-first) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: var(--nav-bg);
  border-top: 1px solid var(--line);
  padding: 8px 4px env(safe-area-inset-bottom);
  z-index: 50;
  backdrop-filter: blur(14px);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}

.nav-item:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-item--active {
  color: var(--text-strong);
}

.nav-item--disabled {
  opacity: 0.5;
  pointer-events: none;
}

.nav-icon {
  font-size: 18px;
  line-height: 1;
}

.nav-label {
  font-size: 11px;
}

/* Brand / status bar */
.brand,
.brand-text {
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-strong);
  margin-bottom: 8px;
}

/* More-menu sheet */
.more-menu {
  background: var(--sheet-bg-a);
  border-radius: 14px;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid var(--line);
}

.more-menu__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Status pills */
.companies__status,
.daily-plans__status,
.employees-table__status,
.contacts__email,
.company__status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

/* Generic table-ish blocks */
.employees-table,
.approval-queue__row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

/* Forms within cards spacing */
form {
  margin: 0;
}

form input,
form select,
form textarea,
form button {
  margin-bottom: 6px;
}

/* Calendar (basic legibility) */
.calendar__cell {
  display: inline-block;
  width: 26px;
  height: 26px;
  margin: 2px;
  border-radius: 6px;
  background: var(--card-solid);
}

.calendar__cell--green {
  background: var(--green);
}

.calendar__cell--yellow {
  background: var(--yellow);
}

.calendar__cell--red {
  background: var(--red);
}

.calendar__cell--muted {
  background: var(--card-solid);
}

.calendar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.calendar__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Daily plan bars */
.daily-plan__bars {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  height: 60px;
}

/* Earn widget */
.earn {
  font-size: 18px;
  font-weight: 600;
}

/* Responsive */
@media (width <= 600px) {
  body {
    padding: 16px 12px 96px;
  }

  h1 {
    font-size: 24px;
  }
}

/* EmailTemplate post-image preview (form + show). */
.email-template__image-preview {
  display: block;
  max-width: 240px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
}

/* EmailTemplate body on the show page — a <pre> defaults to no-wrap, so long
   lines (e.g. the «Сайт, который приводит клиентов…» sentence) overflowed the
   card to the right. Keep the newlines, but wrap long lines. */
.email-template__body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow-wrap: break-word;
  max-width: 100%;
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
}
/* app/assets/stylesheets/product.css */

/* Public «About MarketPult» product page (/about). Standalone light layout. */

.product {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 20px 72px;
  color: var(--text);
}

.product__hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
  align-items: center;
}

.product__eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgb(82 212 74 / 14%);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.product__title {
  margin: 14px 0 10px;
  font-size: 32px;
  line-height: 1.12;
  font-weight: 900;
  color: var(--text-strong);
}

.product__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
}

.product__hero-art {
  display: block;
  width: 100%;
}

.product__hero-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px var(--shadow);
}

.product__cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.product__cta-row--center {
  justify-content: center;
}

.product__btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition:
    filter 0.15s,
    background 0.15s;
}

.product__btn--primary {
  background: linear-gradient(var(--green), #3cae34);
  color: #04140a;
}

.product__btn--primary:hover {
  filter: brightness(1.05);
}

.product__btn--ghost {
  border: 2px solid var(--green);
  color: var(--green);
  background: transparent;
}

.product__btn--ghost:hover {
  background: color-mix(in srgb, var(--green), transparent 88%);
}

.product__btn--lg {
  padding: 18px 32px;
  font-size: 17px;
}

.product__block {
  margin-top: 44px;
}

.product__h2 {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-strong);
  margin: 0 0 12px;
  line-height: 1.2;
}

.product__lead {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
}

.product__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.product__card {
  position: relative;
  padding: 18px 18px 18px 22px;
  border-radius: 16px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  overflow: hidden;
}

.product__card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--green);
}

.product__card-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-strong);
}

.product__card-desc {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.product__steps {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 12px;
}

.product__steps li {
  position: relative;
  padding: 14px 16px 14px 56px;
  border-radius: 14px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  counter-increment: step;
}

.product__steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #04140a;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product__why {
  margin: 8px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.product__why li {
  position: relative;
  padding-left: 28px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.product__why li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--green);
  font-weight: 900;
}

.product__cta {
  margin-top: 48px;
  padding: 30px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--green), transparent 86%), transparent 60%),
    var(--card-solid);
  border: 1px solid color-mix(in srgb, var(--green), transparent 55%);
  text-align: center;
}

.product__cta .product__lead {
  max-width: 600px;
  margin: 0 auto 18px;
  color: var(--muted);
}

@media (width <= 720px) {
  .product__hero {
    grid-template-columns: 1fr;
  }

  .product__title {
    font-size: 27px;
  }

  .product__grid {
    grid-template-columns: 1fr;
  }

  .product__btn {
    width: 100%;
  }
}
/* app/assets/stylesheets/profile.css
 *
 * Profile page (/profile). Mobile-first card column, max 720px on desktop.
 * Picked up automatically by `*= require_tree` in application.css. Component
 * styles mirror the admin token palette (var(--card), var(--red), etc.). */

.profile {
  max-width: 720px;
  margin: 0 auto;

  /* Bottom padding clears the 64-pixel fixed `.bottom-nav` that sits on top of
     the mobile employee layout — without it the last cards (sign-out / danger
     zone) end up scrolled UNDER the nav and looked «hidden» on mobile. */
  padding: 1rem 1rem calc(64px + env(safe-area-inset-bottom, 0px) + 24px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Desktop admin chrome has no bottom-nav; trim the extra padding back to
   normal so the danger card isn't floating in a giant white space. */
body.admin-body .profile {
  padding-bottom: 1rem;
}

.profile__header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile__title {
  font-size: 1.5rem;
  margin: 0;
}

.profile__subtitle {
  margin: 0;
  color: var(--text-muted, #888);
  font-size: 0.95rem;
}

.profile__alert {
  background: rgb(220 53 69 / 10%);
  border: 1px solid var(--red, #dc3545);
  color: var(--red, #dc3545);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
}

.profile-card {
  background: var(--card, #1b1c20);
  border: 1px solid var(--line, #2a2b30);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-card__title {
  font-size: 1.1rem;
  margin: 0;
}

.profile-card__form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-card__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.profile-card__label {
  font-size: 0.9rem;
  color: var(--text-muted, #888);
}

.profile-card__field input[type="text"],
.profile-card__field input[type="email"],
.profile-card__field input[type="tel"],
.profile-card__field input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font-size: 16px; /* prevent iOS zoom on focus */
  border: 1px solid var(--line, #2a2b30);
  border-radius: 8px;
  background: var(--page-bg-a, #0f1014);
  color: var(--text, #eaeaea);
}

.profile-card__field input[aria-invalid="true"] {
  border-color: var(--red, #dc3545);
}

.profile-card__req {
  color: var(--red, #dc3545);
  font-style: normal;
  margin-left: 0.15rem;
}

.profile-card__required-hint,
.profile-card__hint {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  margin: 0;
}

.profile-card__current {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.profile-card__chip {
  display: inline-block;
  align-self: flex-start;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
}

.profile-card__chip--success {
  background: rgb(40 167 69 / 15%);
  color: var(--green, #28a745);
  border: 1px solid var(--green, #28a745);
}

.profile-card__chip--muted {
  background: rgb(120 120 120 / 12%);
  color: var(--muted, #888);
  border: 1px solid rgb(120 120 120 / 35%);
}

.profile-card__chip--warning {
  background: rgb(255 168 0 / 12%);
  color: var(--orange, #d97706);
  border: 1px solid var(--orange, #d97706);
}

.profile-card__verify-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.profile-card__verify-code {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px dashed var(--line, #2a2b30);
  border-radius: 8px;
}

.profile-card__verify-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-card__error {
  color: var(--red, #dc3545);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.profile-card__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.profile-card__file-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--line, #2a2b30);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}

.profile-card__file-label input[type="file"] {
  cursor: pointer;
}

.profile-card__remove {
  align-self: flex-start;
  margin-top: 0.5rem;
  cursor: pointer;
}

.profile-avatar {
  display: flex;
  justify-content: center;
}

.profile-avatar__img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--page-bg-a, #0f1014);
  border: 2px solid var(--line, #2a2b30);
}

.profile-avatar__img--empty {
  object-fit: contain;
  padding: 28px;
  opacity: 0.6;
}

.profile-avatar__error {
  display: block;
  color: var(--red, #dc3545);
  font-size: 0.85rem;
  text-align: center;
}

/* Inline field errors emitted by form_validation_controller.js — keep red so
   the user spots them even with a desktop-admin theme override. */
.profile-card__field .field-error,
.profile-card .field-error {
  display: block;
  color: var(--red, #dc3545);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Buttons get pointer cursors everywhere on this page. */
.profile button,
.profile .btn,
.profile input[type="submit"] {
  cursor: pointer;
}

/* ── Avatar crop modal ─────────────────────────────────────────────
   Opened by avatar_cropper_controller.js after a successful file pick.
   The backdrop catches clicks → controller#cancel. The panel uses the
   shared design tokens so it themes correctly under BOTH the mobile
   application layout AND the desktop admin chrome. */
.profile-avatar__modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.profile-avatar__modal[hidden] {
  display: none;
}

.profile-avatar__modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 65%);
  cursor: pointer;
}

.profile-avatar__modal-panel {
  position: relative;
  background: var(--card, #1b1c20);
  color: var(--text, #eaeaea);
  border: 1px solid var(--line, #2a2b30);
  border-radius: 12px;
  padding: 1.25rem;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 12px 40px rgb(0 0 0 / 45%);
}

.profile-avatar__modal-title {
  margin: 0;
  font-size: 1.05rem;
}

.profile-avatar__cropper {
  max-height: 60vh;
  background: var(--page-bg-a, #0f1014);
  border-radius: 8px;
  overflow: hidden;
}

/* Cropper.js measures the host element to fit its canvas — `display: block`
   on the <img> avoids the inline-baseline gap that throws off the math. */
.profile-avatar__cropper img {
  display: block;
  max-width: 100%;
  max-height: 60vh;
}

.profile-avatar__modal-loading {
  font-size: 0.85rem;
  color: var(--text-muted, #888);
  text-align: center;
}

.profile-avatar__modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.profile-avatar__modal-actions .btn {
  cursor: pointer;
}

.profile-avatar__modal-actions .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Light-theme override: admin chrome flips background tokens to white but the
   modal needs to keep enough contrast against the dimmed page underneath. */
body.admin-body .profile-avatar__modal-panel {
  background: var(--card, #fff);
  color: var(--text, #1a1a1a);
  border-color: var(--line, #e1e4eb);
  box-shadow: 0 18px 50px rgb(15 23 42 / 22%);
}

body.admin-body .profile-avatar__cropper {
  background: var(--page-bg-a, #f5f6f8);
}

/* Lock body scroll while the cropper is open. */
body.profile-avatar__modal--lock {
  overflow: hidden;
}

@media (width >= 768px) {
  .profile {
    padding: 2rem 1rem;
  }
}
/* app/assets/stylesheets/referrals.css */

/* Public referral landing (/refer) — offer + live probability/reward meter +
   quiz + lead form. Uses design tokens; standalone (no app chrome). */

/* The shared app body is capped at 760px + centered (components.css) for the
   mobile field-worker view. That leaves the body's light background framed by
   the unstyled (dark) <html> canvas on this full-bleed marketing page. Let the
   body fill the viewport so the light theme covers edge-to-edge; .ref still
   centers the content column at 640px. */
body.ref-page {
  max-width: none;
  margin: 0;
  padding: 0;
}

.ref {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  color: var(--text);

  /* Even, generous spacing between every top-level block so nothing sticks. */
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.ref__hero {
  text-align: center;
  margin-bottom: 2px;
}

.ref__eyebrow {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgb(82 212 74 / 14%);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ref__title {
  margin: 14px 0 8px;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 900;
  color: var(--text-strong);
}

.ref__subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 700;
}

.ref__about-link {
  margin: 12px 0 0;
}

.ref__about-link a {
  color: var(--green);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.ref__about-link a:hover {
  text-decoration: underline;
}

/* Prominent variant: a large, green-tinted button so cold visitors actually
   notice the «что мы делаем» services page (not a small text link). */
.ref__about-link--btn {
  margin-top: 16px;
}

.ref__about-link--btn a {
  display: inline-block;
  padding: 15px 28px;
  border: 2px solid var(--green);
  border-radius: 14px;
  font-size: 16px;
  background: color-mix(in srgb, var(--green), transparent 88%);
  transition: background 0.15s;
}

.ref__about-link--btn a:hover {
  background: color-mix(in srgb, var(--green), transparent 78%);
  text-decoration: none;
}

/* Hero nav: «Что мы делаем» + «Реферальная программа» on one row. Labels are
   long, so the buttons run tighter than the standalone --btn variant. */
.ref__hero-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 16px;
}

.ref__hero-nav .ref__about-link--btn {
  margin: 0;
  min-width: 0;
}

.ref__hero-nav .ref__about-link--btn a {
  display: block;
  padding: 13px 16px;
  font-size: 14px;
  white-space: nowrap;
  text-align: center;
}

/* The pair needs ~524px of row; below a 600px viewport the hero column is too
   narrow for that, so stack instead of letting nowrap spill. */
@media (width <= 599px) {
  .ref__hero-nav {
    flex-wrap: wrap;
  }

  .ref__hero-nav .ref__about-link--btn a {
    font-size: 13px;
    padding: 12px 14px;
  }
}

/* Intro «что мы делаем» paragraph — broad capability context up top. */
.ref__blurb {
  margin: 14px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 600;
}

/* Trust proof grid — one card per claim, scannable, green tick. */
.ref__trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ref__trust-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--card-solid);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.4;
  font-weight: 700;
}

.ref__trust-tick {
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 900;
}

/* Guarantee banner — the headline trust argument («сделаем и не исчезнем»).
   Accented card so it stands out from the neutral proof grid above. */
.ref__guarantee {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 2px solid color-mix(in srgb, var(--green), transparent 45%);
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--green), transparent 86%), transparent 60%),
    var(--card-solid);
}

.ref__guarantee-title {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
}

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

.ref__guarantee-list li {
  position: relative;
  padding-left: 26px;
  font-size: 14.5px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--text);
}

.ref__guarantee-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--green);
  font-weight: 900;
}

.ref__guarantee-slogan {
  margin: 14px 0 0;
  font-size: 16px;
  font-weight: 900;
  color: var(--green);
}

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

/* Simple lead forms (services + refer-simple + white-label): the form is the
   PRIMARY action, so wrap it in one cohesive, accented card that reads as a
   single element and stands apart from the neutral info sections. NOT applied to
   the /refer quiz form, whose inner meter/quiz/registration are already carded. */
.ref__form--card {
  padding: 22px;
  border: 2px solid color-mix(in srgb, var(--green), transparent 45%);
  border-radius: 18px;
  background: var(--card-solid);
  box-shadow: 0 8px 24px rgb(16 24 40 / 10%);
}

.ref__alert {
  margin: 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--red-soft, rgb(255 81 71 / 16%));
  color: var(--red);
  font-size: 13px;
}

/* ---- Live meter ---------------------------------------------------------- */
.ref__meter {
  padding: 18px;
  border-radius: 16px;
  background: var(--card-solid);
  border: 1px solid color-mix(in srgb, var(--green), transparent 60%);
  box-shadow: 0 1px 3px rgb(16 24 40 / 6%);
}

.ref__meter-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ref__meter-reward {
  text-align: right;
}

.ref__meter-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ref__probability {
  display: block;
  margin-top: 2px;
  font-size: 34px;
  font-weight: 900;
  color: var(--green);
  line-height: 1;
}

.ref__reward {
  display: block;
  margin-top: 2px;
  font-size: 24px;
  font-weight: 900;
  color: var(--text-strong);
  line-height: 1;
}

.ref__meter-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ref__bar {
  margin-top: 14px;
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: rgb(128 139 150 / 20%);
}

.ref__bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  box-shadow: 0 0 12px rgb(82 212 74 / 45%);
  transition: width 220ms ease;
}

/* ---- Quiz + form fieldsets ----------------------------------------------- */
.ref__quiz,
.ref__refer,
.ref__lead {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Referral-program cross-sell block — a green-tinted accent so the «get 10%»
   CTA stands apart from the neutral info cards above it. */
.ref__refer {
  border-color: color-mix(in srgb, var(--green), transparent 55%);
  background: color-mix(in srgb, var(--green), transparent 92%);
}

.ref__refer .ref__submit--link {
  margin-top: 2px;
}

/* `display: flex` above outranks the UA `[hidden]` rule, so the form would
   stay visible before opt-in. Re-assert hidden at matching specificity. */
.ref__lead[hidden] {
  display: none;
}

.ref__section-title {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.ref__q {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 15px 18px;
  border-radius: 14px;
  background: var(--card-solid);
  border: 1.5px solid var(--line);
  cursor: pointer;
  font-size: 15px;
  line-height: 1.35;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.ref__q input {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  cursor: pointer;
  accent-color: var(--green);
}

.ref__q:hover {
  border-color: var(--line-strong);
}

/* A ticked answer reads as "selected" — green tint + ring. */
.ref__q:has(input:checked) {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(82 212 74 / 15%);
  background: rgb(82 212 74 / 6%);
}

.ref__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
}

.ref__field > span {
  color: var(--text);
  font-weight: 700;
}

.ref__field small {
  color: var(--muted);
  font-size: 12px;
}

.ref__field input,
.ref__field select {
  width: 100%;
  min-height: 56px;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--card-solid);
  color: var(--text-strong);
  font-size: 16px; /* >=16px so iOS Safari doesn't zoom on focus */
  font-weight: 600;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

/* Bigger, prettier dropdowns: native chrome off + a roomy custom chevron, and
   a comfortable tap target on touch. */
.ref__field select {
  cursor: pointer;
  appearance: none;
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23637080' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.ref__field input:focus,
.ref__field select:focus,
.ref__field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(82 212 74 / 18%);
}

/* Red ring once the user has actually interacted and left a field invalid
   (:user-invalid fires after blur/submit, not on first paint — so the form
   doesn't look angry before it's touched). */
.ref__field input:user-invalid,
.ref__field textarea:user-invalid {
  border-color: #e5484d;
  box-shadow: 0 0 0 3px rgb(229 72 77 / 16%);
}

/* Inline per-field error message under an invalid field (form-validation
   controller, inline mode). Scoped to .ref__field so it OUTRANKS the
   `.ref__field > span` label-title rule (which would otherwise paint it dark). */
.ref__field .field-error {
  display: block;
  margin-top: 6px;
  color: #e5484d;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.ref__required-hint {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.ref__req {
  color: #e5484d;
  font-style: normal;
  font-weight: 900;
}

/* Phones: stretch tap targets + text a touch larger so it's easy to thumb. */
@media (width <= 560px) {
  .ref__q {
    min-height: 64px;
    padding: 16px;
    font-size: 16px;
  }

  .ref__q input {
    width: 28px;
    height: 28px;
  }

  .ref__field input,
  .ref__field select {
    min-height: 60px;
    padding: 17px 16px;
    font-size: 17px;
  }

  .ref__field select {
    padding-right: 48px;
  }
}

.ref__submit {
  display: block;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(var(--green), #3cae34);
  color: #04140a;
  font-size: 16px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.ref__submit:hover {
  filter: brightness(1.05);
}

.ref__submit--link {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}

/* Disabled until the ФЗ-152 consent checkbox is ticked (consent_controller). */
.ref__submit:disabled {
  opacity: 0.45;
  filter: none;
  cursor: not-allowed;
}

/* Consent row — lighter than a quiz answer, top-aligned for the two-line text. */
.ref__consent {
  min-height: 0;
  align-items: flex-start;
  font-size: 13px;
  font-weight: 600;
}

.ref__consent span {
  line-height: 1.4;
}

.ref__consent a {
  color: var(--green);
  text-decoration: underline;
}

.ref__thanks {
  text-align: center;
  padding: 48px 0;
}

/* ---- Quick contacts (paid doorway landings) ------------------------------ */
.ref__contacts {
  border: 1px solid color-mix(in srgb, var(--green), transparent 60%);
  border-radius: 16px;
  padding: 18px;
  background: var(--card-solid);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref__contacts-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.ref__contacts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Slightly tighter so all three (Telegram / MAX / Save) fit one desktop row;
   they still wrap on a narrow phone where three Russian labels can't fit. */
.ref__contacts-row .ref__contact {
  padding: 12px 15px;
  font-size: 14px;
}

.ref__contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 12px;
  border: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgb(16 24 40 / 18%);
  transition:
    filter 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}

.ref__contact:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgb(16 24 40 / 24%);
}

/* Bright, messenger-branded fills so the «write to us» buttons pop. */
.ref__contact--tg {
  background: linear-gradient(135deg, #2aabee, #1d93d2);
}

.ref__contact--max {
  background: linear-gradient(135deg, #7b61ff, #9a52f5);
}

/* «Сохранить страницу» — neutral, secondary to the messenger CTAs. */
.ref__contact--save {
  background: var(--card);
  color: var(--text-strong);
  border: 1.5px solid var(--line);
  box-shadow: none;
}

.ref__contact--save:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

/* The Ctrl+D hint sits on its own line under the one-row button group. */
.ref__contacts-savehint {
  flex-basis: 100%;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.ref__contacts-savehint.is-pulsing {
  animation: ref-pulse 0.6s ease 2;
  color: var(--green);
  font-weight: 700;
}

@keyframes ref-pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

/* ---- Exit-intent modal --------------------------------------------------- */
.ref-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.ref-modal[hidden] {
  display: none;
}

.ref-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgb(16 24 40 / 55%);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.ref-modal__box {
  position: relative;
  width: min(440px, 100%);
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 24px 20px;
  box-shadow: 0 18px 50px rgb(16 24 40 / 35%);
  text-align: center;
  animation: ref-modal-in 0.18s ease-out;
}

@keyframes ref-modal-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* The global `body:not(.admin-body) button` rule paints every public-page
   button blue with 10px 18px padding and display:inline-block — and it
   OUT-SPECIFIES a bare `.ref-modal__close`, so the modal × came out blue and
   shoved to the bottom-right (padding + no flex centring). Scope the close
   button under the SAME `body:not(.admin-body)` prefix so it out-specifies
   that rule and resets to a transparent, flex-centred 32×32 square. */
body:not(.admin-body) .ref-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  appearance: none;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

body:not(.admin-body) .ref-modal__close::before {
  content: "\00D7";
  font-size: 24px;
  line-height: 1;
}

body:not(.admin-body) .ref-modal__close:hover {
  background: rgb(128 139 150 / 16%);
  color: var(--text-strong);
}

.ref-modal__title {
  margin: 4px 14px 8px;
  font-size: 21px;
  font-weight: 900;
  color: var(--text-strong);
  line-height: 1.25;
}

.ref-modal__body {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.ref-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.ref-modal__actions .ref__contact {
  flex: 1 1 160px;
  justify-content: center;
}

.ref-modal__hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.ref-modal__hint.is-pulsing {
  animation: ref-pulse 0.6s ease 2;
  color: var(--green);
  font-weight: 700;
}

.ref-modal__dismiss {
  margin-top: 14px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.ref-modal__dismiss:hover {
  color: var(--text);
}

/* Plain-text contact line at the very bottom; « · » separators via CSS. */
.ref__contacts-line {
  margin: 4px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.ref__contacts-line a {
  color: var(--green);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.ref__contacts-line a:hover {
  text-decoration: underline;
}

.ref__contacts-line a + a {
  margin-left: 6px;
}

.ref__contacts-line a + a::before {
  content: "· ";
  color: var(--muted);
  font-weight: 400;
}

/* ---- «Клиент остаётся вашим» — reassurance, high up on white-label ------- */
.ref__reassure {
  border: 1px solid color-mix(in srgb, var(--green), transparent 55%);
  border-radius: 16px;
  padding: 18px;
  background: rgb(82 212 74 / 6%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ref__reassure p:not(.ref__section-title) {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

/* Anti-bot honeypot (shared/_bot_gate.html.erb): parked far off-screen, not
   display:none — some bots skip invisible fields but not off-screen ones. */
.bot-gate__hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Visible SmartCaptcha widget above the submit button (shared/_captcha_field).
   The widget itself is a fixed-size iframe — let it shrink on narrow phones
   rather than push the form wider. */
.bot-gate__captcha {
  margin: 18px 0 4px;
  max-width: 100%;
  overflow-x: auto;
}

.bot-gate__error {
  margin: 8px 0 0;
  color: var(--danger, #d64545);
  font-size: 14px;
  font-weight: 700;
}
/* app/assets/stylesheets/reviews.css
   Блок отзывов/рейтинга на посадочных и /services (shared/_reviews).
   Токены темы (--card-solid / --text / --line) — как у остальных ref__-карт. */

.reviews__sub {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.reviews__rating {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.reviews__stars {
  color: #f5a623;
  font-size: 20px;
  letter-spacing: 2px;
  line-height: 1;
}

/* В карточке отзыва звёзды — строкой под ролью (см. комментарий в партиале). */
.reviews__stars--small {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  letter-spacing: 1px;
}

.reviews__score {
  color: var(--text-strong);
  font-size: 16px;
  font-weight: 800;
}

.reviews__note {
  color: var(--muted);
  font-size: 13px;
}

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

.reviews__card {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-solid);
}

.reviews__head {
  display: flex;
  gap: 10px;

  /* Аватар к верху: столбец имя/роль/звёзды бывает выше 40px, и центрирование
     подвешивало кружок посреди пустоты. */
  align-items: flex-start;
  margin-bottom: 10px;
}

/* Аватар — круг с инициалами. Никаких чужих фотографий: на них нужно
   разрешение, а стоковые лица в отзывах читаются как фейк. */
.reviews__avatar {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.reviews__who {
  min-width: 0;
}

.reviews__name {
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 700;
}

.reviews__role {
  color: var(--muted);
  font-size: 12px;
}

.reviews__text {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}
/*!
 * Cropper.js v1.6.2
 * https://fengyuanchen.github.io/cropperjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2024-04-21T07:43:02.731Z
 */

.cropper-container {
  direction: ltr;
  font-size: 0;
  line-height: 0;
  position: relative;
  -ms-touch-action: none;
      touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

.cropper-container img {
    backface-visibility: hidden;
    display: block;
    height: 100%;
    image-orientation: 0deg;
    max-height: none !important;
    max-width: none !important;
    min-height: 0 !important;
    min-width: 0 !important;
    width: 100%;
  }

.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

.cropper-wrap-box,
.cropper-canvas {
  overflow: hidden;
}

.cropper-drag-box {
  background-color: #fff;
  opacity: 0;
}

.cropper-modal {
  background-color: #000;
  opacity: 0.5;
}

.cropper-view-box {
  display: block;
  height: 100%;
  outline: 1px solid #39f;
  outline-color: rgba(51, 153, 255, 0.75);
  overflow: hidden;
  width: 100%;
}

.cropper-dashed {
  border: 0 dashed #eee;
  display: block;
  opacity: 0.5;
  position: absolute;
}

.cropper-dashed.dashed-h {
    border-bottom-width: 1px;
    border-top-width: 1px;
    height: calc(100% / 3);
    left: 0;
    top: calc(100% / 3);
    width: 100%;
  }

.cropper-dashed.dashed-v {
    border-left-width: 1px;
    border-right-width: 1px;
    height: 100%;
    left: calc(100% / 3);
    top: 0;
    width: calc(100% / 3);
  }

.cropper-center {
  display: block;
  height: 0;
  left: 50%;
  opacity: 0.75;
  position: absolute;
  top: 50%;
  width: 0;
}

.cropper-center::before,
  .cropper-center::after {
    background-color: #eee;
    content: ' ';
    display: block;
    position: absolute;
  }

.cropper-center::before {
    height: 1px;
    left: -3px;
    top: 0;
    width: 7px;
  }

.cropper-center::after {
    height: 7px;
    left: 0;
    top: -3px;
    width: 1px;
  }

.cropper-face,
.cropper-line,
.cropper-point {
  display: block;
  height: 100%;
  opacity: 0.1;
  position: absolute;
  width: 100%;
}

.cropper-face {
  background-color: #fff;
  left: 0;
  top: 0;
}

.cropper-line {
  background-color: #39f;
}

.cropper-line.line-e {
    cursor: ew-resize;
    right: -3px;
    top: 0;
    width: 5px;
  }

.cropper-line.line-n {
    cursor: ns-resize;
    height: 5px;
    left: 0;
    top: -3px;
  }

.cropper-line.line-w {
    cursor: ew-resize;
    left: -3px;
    top: 0;
    width: 5px;
  }

.cropper-line.line-s {
    bottom: -3px;
    cursor: ns-resize;
    height: 5px;
    left: 0;
  }

.cropper-point {
  background-color: #39f;
  height: 5px;
  opacity: 0.75;
  width: 5px;
}

.cropper-point.point-e {
    cursor: ew-resize;
    margin-top: -3px;
    right: -3px;
    top: 50%;
  }

.cropper-point.point-n {
    cursor: ns-resize;
    left: 50%;
    margin-left: -3px;
    top: -3px;
  }

.cropper-point.point-w {
    cursor: ew-resize;
    left: -3px;
    margin-top: -3px;
    top: 50%;
  }

.cropper-point.point-s {
    bottom: -3px;
    cursor: s-resize;
    left: 50%;
    margin-left: -3px;
  }

.cropper-point.point-ne {
    cursor: nesw-resize;
    right: -3px;
    top: -3px;
  }

.cropper-point.point-nw {
    cursor: nwse-resize;
    left: -3px;
    top: -3px;
  }

.cropper-point.point-sw {
    bottom: -3px;
    cursor: nesw-resize;
    left: -3px;
  }

.cropper-point.point-se {
    bottom: -3px;
    cursor: nwse-resize;
    height: 20px;
    opacity: 1;
    right: -3px;
    width: 20px;
  }

@media (min-width: 768px) {

.cropper-point.point-se {
      height: 15px;
      width: 15px;
  }
    }

@media (min-width: 992px) {

.cropper-point.point-se {
      height: 10px;
      width: 10px;
  }
    }

@media (min-width: 1200px) {

.cropper-point.point-se {
      height: 5px;
      opacity: 0.75;
      width: 5px;
  }
    }

.cropper-point.point-se::before {
    background-color: #39f;
    bottom: -50%;
    content: ' ';
    display: block;
    height: 200%;
    opacity: 0;
    position: absolute;
    right: -50%;
    width: 200%;
  }

.cropper-invisible {
  opacity: 0;
}

.cropper-bg {
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC');
}

.cropper-hide {
  display: block;
  height: 0;
  position: absolute;
  width: 0;
}

.cropper-hidden {
  display: none !important;
}

.cropper-move {
  cursor: move;
}

.cropper-crop {
  cursor: crosshair;
}

.cropper-disabled .cropper-drag-box,
.cropper-disabled .cropper-face,
.cropper-disabled .cropper-line,
.cropper-disabled .cropper-point {
  cursor: not-allowed;
}
/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * design_tokens.css MUST be loaded first because every other stylesheet —
 * including components.css and admin.css — references the CSS variables it
 * publishes (--page-bg-a, --text, --card, --line, --red, etc.).
 *
 * After design_tokens, require_tree picks up components.css (base components)
 * and admin.css (desktop chrome gated by `body.admin-body`).
 *
 * `body.admin-body` rules in admin.css override the bare `body` rules in
 * components.css thanks to specificity (one class + one element > one
 * element), so source order between admin.css and components.css is
 * non-load-bearing.
 *
 * cropper.css is the vendored overlay/grid theme for the avatar cropper on
 * /profile. It comes from node_modules/cropperjs/dist (added to the asset
 * path in config/initializers/assets.rb).
 *




 */
