:root {
  color: #172033;
  background: #f4f7fa;
  font-family: Arial, Helvetica, sans-serif;
  font-synthesis: none;
  --ink: #172033;
  --ink-muted: #647184;
  --line: #dce3ec;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --cyan: #35b7ef;
  --cyan-strong: #078bc7;
  --navy: #0d1726;
  --success: #16805d;
  --danger: #b42318;
  --shadow-modal: 0 26px 72px rgba(1, 12, 20, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(53, 183, 239, 0.32);
  outline-offset: 2px;
}

::selection {
  color: #07111e;
  background: #9ee2ff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Public reference surface */

.public-site {
  height: 100vh;
  min-height: 540px;
  overflow: hidden;
  color: #172033;
  background: #07111a;
}

.site-header {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 59px;
  padding: 0 33px;
  background: var(--header-background-color, #ffffff);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 10px;
  color: var(--header-text-color, #172033);
  text-decoration: none;
}

.brand > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: #078bc7;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.brand strong {
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.05;
}

.brand small {
  margin-top: 5px;
  color: #8290a0;
  font-size: 10px;
  font-weight: 400;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 31px;
}

.site-header nav a {
  color: var(--header-text-color, #344053);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 4px;
}

.site-header nav a:hover {
  color: #078bc7;
  text-decoration: underline;
}

.header-action {
  justify-self: end;
  min-width: 117px;
  padding: 10px 20px;
  border-radius: 999px;
  color: #0874aa;
  background: #e0f4fd;
  font-size: 12px;
  font-weight: 700;
}

.header-action:hover {
  background: #c9ecfb;
}

.hero {
  position: relative;
  display: flex;
  height: calc(100vh - 59px);
  min-height: 481px;
  align-items: center;
  overflow: hidden;
  padding: 0 34px 0;
  background-image: url('/clinic-reception-reference.png');
  background-position: center;
  background-size: cover;
}

.overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(4, 17, 23, 0.72) 0%, rgba(5, 14, 20, 0.54) 45%, rgba(5, 12, 18, 0.39) 100%);
}

.hero section {
  position: relative;
  z-index: 1;
  width: min(510px, 100%);
  transform: translateY(56px);
  color: var(--hero-text-color, #ffffff);
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--hero-text-color, #ffffff);
}

.hero h1 {
  max-width: 510px;
  margin: 22px 0;
  white-space: pre-line;
  text-wrap: balance;
  color: var(--hero-title-color, #ffffff);
  font-size: clamp(30px, 3.35vw, var(--hero-title-size, 44px));
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.hero-description {
  max-width: 510px;
  margin: 0;
  white-space: pre-line;
  color: var(--hero-text-color, #ffffff);
  font-size: var(--hero-text-size, 15px);
  line-height: 1.55;
}

.actions {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.actions button,
.modal form > button,
.warning button {
  min-width: 126px;
  padding: 13px 24px;
  border-radius: 999px;
  color: #ffffff;
  background: #35b7ef;
  font-size: 14px;
  font-weight: 700;
  transition: background-color 160ms ease-out, transform 160ms ease-out;
}

.actions button,
.actions .secondary {
  color: var(--hero-button-text-color, #ffffff);
  background: var(--hero-button-color, #35b7ef);
}

.actions button:hover,
.modal form > button:hover {
  filter: brightness(0.94);
}

.actions button:active,
.modal form > button:active,
.warning button:active {
  transform: translateY(1px);
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 12, 18, 0.82);
  backdrop-filter: blur(5px);
}

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

.modal,
.warning {
  position: relative;
  width: min(400px, calc(100vw - 40px));
  border-radius: 18px;
  background: #f7f9fc;
  box-shadow: var(--shadow-modal);
}

.modal {
  padding: 30px 28px 34px;
  background: var(--popup-block-color, #f7f9fc);
}

.modal h2,
.warning h2 {
  margin: 0;
  white-space: pre-line;
  text-wrap: balance;
  color: #172033;
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.modal h2 {
  color: var(--popup-title-color, #172033);
  font-size: var(--popup-title-size, 26px);
}

.modal > p {
  margin: 16px 0 0;
  white-space: pre-line;
  color: var(--popup-text-color, #172033);
  font-size: var(--popup-text-size, 15px);
  line-height: 1.25;
}

.close {
  position: absolute;
  top: 17px;
  right: 19px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  color: #101820;
  background: transparent;
}

.close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.4;
}

.demo-code {
  min-height: 67px;
  margin: 26px 0 23px;
  padding: 18px;
  border-radius: 12px;
  color: var(--popup-code-text-color, #172033);
  background: var(--popup-code-color, #e4e9ef);
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.22em;
  line-height: 31px;
}

.modal form {
  display: grid;
}

.modal label {
  margin-bottom: 8px;
  color: var(--popup-text-color, #172033);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.modal input,
.modal input:hover,
.modal input:valid,
.modal input:invalid,
.modal input:user-invalid,
.modal input[aria-invalid='true'] {
  width: 100%;
  height: 46px;
  padding: 9px 14px;
  border: 1px solid #dde1e3 !important;
  border-radius: 8px;
  outline: 0;
  color: #111827;
  caret-color: #111827;
  background: #ffffff;
  box-shadow: none !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.modal input::placeholder {
  color: #777b80;
  opacity: 1;
}

.modal input:focus,
.modal input:focus-visible,
.modal input:invalid:focus,
.modal input:user-invalid:focus {
  border-color: #dde1e3 !important;
  outline: 0;
  box-shadow: none !important;
}

.modal form > button {
  width: 100%;
  min-height: 44px;
  margin-top: 18px;
  padding: 10px 24px;
  color: #ffffff;
  background: var(--popup-button-color, #94a3b8);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.modal form > button:hover {
  filter: brightness(0.94);
}

.form-error {
  min-height: 20px;
  margin: 10px 0 -10px;
  color: #b42318;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.warning {
  padding: 32px;
  color: var(--result-text-color);
  background: var(--result-block-color);
}

.warning h2 {
  margin-top: 18px;
  color: var(--result-title-color);
  font-size: var(--result-title-size);
}

.warning p {
  margin: 13px 0 0;
  color: var(--result-text-color);
  font-size: var(--result-text-size, 15px);
  line-height: 1.5;
}

.warning .icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  color: var(--result-block-color);
  background: #ffffff;
  font-size: 24px;
  font-weight: 800;
}

.warning button {
  margin-top: 20px;
  color: var(--result-block-color);
  background: var(--result-button-color, #ffffff);
}

.final-screen {
  position: fixed;
  z-index: 60;
  inset: 0;
  overflow-y: auto;
  padding: 42px 24px 34px;
  color: var(--final-text-color, #202632);
  background: #ffffff;
  scrollbar-color: #9aabc0 #edf1f5;
  scrollbar-width: thin;
}

.final-screen[hidden] {
  display: none;
}

.final-screen:focus {
  outline: 0;
}

.final-screen-content {
  width: min(640px, 100%);
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  overflow-wrap: anywhere;
}

.final-brand-title {
  display: flex;
  justify-content: center;
  margin: 0;
  text-align: center;
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: var(--final-title-size, 58px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.final-brand-title span:first-child {
  color: var(--final-title-1-color, #0b57b7);
}

.final-brand-title span:last-child {
  color: var(--final-title-2-color, #e11d48);
}

.final-lead {
  max-width: 620px;
  margin: 44px 0 31px;
  white-space: pre-line;
  text-wrap: balance;
  color: var(--final-text-color, #202632);
  font-size: var(--final-lead-size, 30px);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.22;
}

.final-facts,
.final-code-line,
.final-guidance {
  font-size: var(--final-body-size, 18px);
  line-height: 1.55;
}

.final-facts h3 {
  margin: 0;
  color: var(--final-text-color, #202632);
  font-size: inherit;
  font-weight: 400;
}

.final-facts ul {
  display: grid;
  gap: 5px;
  margin: 22px 0 0;
  padding-left: 29px;
}

.final-facts strong,
.final-code-line strong {
  font-weight: 900;
}

.final-code-line {
  margin: 31px 0 0;
  white-space: pre-line;
}

.final-code-line strong {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.final-guidance {
  margin-top: 40px;
  text-align: center;
  color: var(--final-accent-color, #c73740);
}

.final-guidance h2,
.final-guidance h3 {
  margin: 0;
  color: inherit;
  font-size: calc(var(--final-body-size, 18px) + 1px);
  font-weight: 900;
  line-height: 1.35;
}

.final-guidance p {
  max-width: 560px;
  margin: 7px auto 13px;
  white-space: pre-line;
}

.final-guidance h3 {
  margin-top: 11px;
}

.final-phone-list {
  display: grid;
  gap: 5px;
  margin-top: 7px;
  color: var(--final-phone-color, #1b70b8);
  font-size: calc(var(--final-body-size, 18px) + 9px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1.45;
}

.final-action {
  display: grid;
  width: 100%;
  min-height: 64px;
  place-items: center;
  margin-top: 37px;
  padding: 15px 24px;
  border-radius: 10px;
  color: var(--final-button-text-color, #ffffff);
  background: var(--final-button-color, #2d99e5);
  font-size: 19px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease-out, transform 160ms ease-out;
}

.final-action:hover {
  filter: brightness(0.94);
}

.final-action:active {
  transform: translateY(1px);
}

/* Admin system */

.admin-shell-body,
.admin-login-body {
  min-height: 100vh;
  overflow: auto;
  color: var(--ink);
  background: var(--canvas);
}

.admin-shell-body {
  scrollbar-color: #a8b4c4 #e8edf3;
  scrollbar-width: thin;
}

.admin-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 256px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 26px 18px 22px;
  color: #e8eef6;
  background: var(--navy);
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-brand > span,
.login-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--cyan-strong);
  font-size: 25px;
}

.admin-brand div,
.sidebar-lock div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.admin-brand strong {
  font-size: 15px;
}

.admin-brand small,
.sidebar-lock small {
  margin-top: 4px;
  color: #93a3b7;
  font-size: 11px;
}

.admin-nav {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.admin-nav button {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 13px;
  border-radius: 10px;
  color: #aebacc;
  background: transparent;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
}

.admin-nav button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.admin-nav button.is-active {
  color: #ffffff;
  background: #18314c;
}

.admin-nav svg,
.sidebar-lock svg,
.reference-rule svg,
.open-site-link svg,
.device-switch svg,
.settings-group summary svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.admin-nav svg {
  width: 20px;
  height: 20px;
}

.admin-nav b {
  min-width: 23px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  text-align: center;
  font-size: 11px;
}

.sidebar-lock {
  display: flex;
  gap: 11px;
  margin-top: auto;
  padding: 15px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-lock svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: #65cfff;
}

.sidebar-lock strong {
  font-size: 12px;
}

.admin-workspace {
  min-width: 0;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 68px;
  align-items: center;
  gap: 14px;
  padding: 12px clamp(20px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.admin-topbar > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.admin-topbar strong {
  font-size: 14px;
}

.admin-topbar span {
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 9px;
  border-radius: 9px;
  background: #edf2f7;
}

.sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 2px 0;
  background: var(--ink);
}

.open-site-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border: 1px solid #cfd8e3;
  border-radius: 9px;
  color: var(--ink);
  background: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.open-site-link:hover {
  border-color: #8d9aad;
}

.open-site-link svg {
  width: 17px;
  height: 17px;
}

.admin-notice {
  margin: 18px clamp(20px, 3vw, 42px) 0;
  padding: 13px 16px;
  border: 1px solid #a8dbc9;
  border-radius: 10px;
  color: #0f6549;
  background: #eaf8f3;
  font-size: 13px;
  font-weight: 700;
}

.admin-panel {
  display: none;
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 34px clamp(20px, 3vw, 42px) 46px;
}

.admin-panel.is-active {
  display: block;
}

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

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.panel-heading h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(25px, 2.3vw, 34px);
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.panel-heading p {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.5;
}

.draft-state {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: #35634f;
  background: #e5f4ed;
  font-size: 11px;
  font-weight: 800;
}

.draft-state.is-dirty {
  color: #81590b;
  background: #fff0c7;
}

.builder-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(390px, 0.88fr) minmax(510px, 1.12fr);
  gap: 26px;
}

.builder-controls {
  display: grid;
  gap: 14px;
}

.builder-flow {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.builder-flow > span {
  color: #6d7c8f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.builder-flow ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.builder-flow li {
  position: relative;
  padding: 10px 8px 9px 0;
  border-top: 2px solid #dce3ec;
  color: #7a8797;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}

.builder-flow li.is-active {
  border-color: #0b8fc9;
  color: #0b6fa1;
}

.settings-stage {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.settings-stage > summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 12px;
  padding: 17px 18px;
  cursor: pointer;
  list-style: none;
}

.settings-stage > summary::-webkit-details-marker {
  display: none;
}

.settings-stage-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: #4c5d70;
  background: #edf1f6;
  font-size: 12px;
  font-weight: 900;
}

.settings-stage[open] .settings-stage-number {
  color: #ffffff;
  background: #0b8fc9;
}

.settings-stage-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.settings-stage-copy strong {
  color: var(--ink);
  font-size: 15px;
}

.settings-stage-copy small {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.4;
}

.settings-stage-state {
  color: #7b8797;
  font-size: 10px;
  font-weight: 800;
}

.settings-stage[open] .settings-stage-state {
  color: #0b7baf;
}

.settings-stage > summary > svg {
  width: 19px;
  height: 19px;
  transition: transform 160ms ease-out;
}

.settings-stage[open] > summary > svg {
  transform: rotate(180deg);
}

.settings-stage-content {
  border-top: 1px solid #e7ecf2;
}

.settings-section + .settings-section {
  border-top: 1px solid #e7ecf2;
}

.settings-section > header {
  padding: 18px 20px 0;
}

.settings-section > header strong {
  color: #263246;
  font-size: 12px;
}

.settings-section > header p {
  margin: 5px 0 0;
  color: #7c8999;
  font-size: 10px;
  line-height: 1.45;
}

.settings-section .settings-grid {
  border-top: 0;
}

.settings-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.settings-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.settings-group summary::-webkit-details-marker {
  display: none;
}

.settings-group summary > span {
  display: flex;
  flex-direction: column;
}

.settings-group summary strong {
  color: var(--ink);
  font-size: 15px;
}

.settings-group summary small {
  margin-top: 4px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.4;
}

.settings-group summary svg {
  width: 19px;
  height: 19px;
  transition: transform 160ms ease-out;
}

.settings-group[open] summary svg {
  transform: rotate(180deg);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px;
  padding: 20px;
  border-top: 1px solid #e7ecf2;
}

.builder-field {
  display: grid;
  align-content: start;
  gap: 7px;
}

.builder-field--textarea,
.builder-field--range,
.builder-field--color,
.builder-field--url,
.builder-field--toggle,
.builder-field--trigger_mode,
.builder-field--redirect_mode {
  grid-column: 1 / -1;
}

.builder-field.is-disabled {
  opacity: 0.58;
}

.builder-field.is-disabled input {
  cursor: not-allowed;
  background: #edf1f5;
}

.builder-field > span {
  color: #263246;
  font-size: 12px;
  font-weight: 800;
}

.builder-field > small {
  color: #8190a2;
  font-size: 10px;
  line-height: 1.4;
}

.builder-field input[type='text'],
.builder-field textarea,
.utm-builder input,
.row-form input,
.row-form select {
  width: 100%;
  border: 1px solid #c9d3df;
  border-radius: 9px;
  color: var(--ink);
  background: #ffffff;
}

.builder-field input[type='text'],
.utm-builder input,
.row-form input,
.row-form select {
  min-height: 42px;
  padding: 9px 11px;
}

.builder-field textarea {
  min-height: 92px;
  resize: vertical;
  padding: 11px;
  line-height: 1.45;
}

.builder-field input:hover,
.builder-field textarea:hover,
.utm-builder input:hover,
.row-form input:hover,
.row-form select:hover {
  border-color: #91a0b3;
}

.range-control,
.color-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-control input {
  width: 100%;
  accent-color: var(--cyan-strong);
}

.range-control output {
  min-width: 52px;
  color: var(--ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.color-control input[type='color'] {
  width: 44px;
  height: 42px;
  flex: 0 0 44px;
  padding: 3px;
  border: 1px solid #c9d3df;
  border-radius: 9px;
  background: #ffffff;
}

.color-control input[type='text'] {
  max-width: 150px;
  font-variant-numeric: tabular-nums;
  text-transform: uppercase;
}

.toggle-control {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 10px;
}

.toggle-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-control > span {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd4df;
  transition: background-color 160ms ease-out;
}

.toggle-control > span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(20, 42, 68, 0.22);
  content: '';
  transition: transform 160ms ease-out;
}

.toggle-control input:checked + span {
  background: #0b8fc9;
}

.toggle-control input:checked + span::after {
  transform: translateX(18px);
}

.toggle-control input:focus-visible + span {
  outline: 3px solid rgba(53, 183, 239, 0.32);
  outline-offset: 2px;
}

.toggle-control b {
  color: #667487;
  font-size: 11px;
}

.trigger-mode-control,
.redirect-mode-control {
  display: grid;
  grid-template-columns: minmax(94px, auto) 48px minmax(126px, auto);
  align-items: center;
  justify-content: start;
  gap: 10px;
  min-height: 44px;
}

.trigger-mode-switch,
.redirect-mode-switch {
  position: relative;
  display: block;
  width: 48px;
  height: 26px;
  cursor: pointer;
}

.trigger-mode-switch input,
.redirect-mode-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.trigger-mode-switch > span:last-child,
.redirect-mode-switch > span:last-child {
  position: absolute;
  inset: 0;
  border: 1px solid #b9c5d3;
  border-radius: 999px;
  background: #d7dee7;
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}

.trigger-mode-switch > span:last-child::after,
.redirect-mode-switch > span:last-child::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(20, 42, 68, 0.25);
  content: '';
  transition: transform 160ms ease-out;
}

.trigger-mode-switch input:checked + span,
.redirect-mode-switch input:checked + span {
  border-color: #0b8fc9;
  background: #0b8fc9;
}

.trigger-mode-switch input:checked + span::after,
.redirect-mode-switch input:checked + span::after {
  transform: translateX(22px);
}

.trigger-mode-switch input:focus-visible + span,
.redirect-mode-switch input:focus-visible + span {
  outline: 3px solid rgba(53, 183, 239, 0.32);
  outline-offset: 2px;
}

.trigger-mode-option,
.redirect-mode-option {
  color: #7a8798;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  transition: color 160ms ease-out;
}

.trigger-mode-option.is-active,
.redirect-mode-option.is-active {
  color: #0b6fa1;
}

.trigger-mode-option small {
  display: block;
  margin-top: 2px;
  color: inherit;
  font-size: 9px;
  font-weight: 700;
}

.trigger-mode-control > b,
.redirect-mode-control > b {
  grid-column: 1 / -1;
  color: #667487;
  font-size: 10px;
  font-weight: 700;
}

.reference-rule {
  display: flex;
  gap: 14px;
  padding: 18px;
  border: 1px solid #b9d9e7;
  border-radius: 14px;
  color: #183346;
  background: #edf8fd;
}

.reference-rule svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: #078bc7;
}

.reference-rule strong {
  font-size: 13px;
}

.reference-rule p {
  margin: 6px 0 0;
  color: #496477;
  font-size: 11px;
  line-height: 1.5;
}

.preview-column {
  position: sticky;
  top: 92px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.preview-toolbar {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid var(--line);
}

.preview-toolbar > div:first-child {
  display: flex;
  flex-direction: column;
}

.preview-toolbar strong {
  font-size: 13px;
}

.preview-toolbar span {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 10px;
}

.device-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  background: #edf1f6;
}

.device-switch button {
  display: grid;
  width: 34px;
  height: 30px;
  place-items: center;
  border-radius: 7px;
  color: #6a788b;
  background: transparent;
}

.device-switch button.is-active {
  color: #0874aa;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(20, 42, 68, 0.12);
}

.device-switch svg {
  width: 18px;
  height: 18px;
}

.preview-stage {
  display: grid;
  min-height: 470px;
  place-items: center;
  overflow: auto;
  padding: 18px;
  background: #dfe5ec;
}

.preview-frame-shell {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(20, 42, 68, 0.18);
}

.preview-frame-shell.is-mobile {
  border-radius: 14px;
}

.preview-frame-shell iframe {
  position: absolute;
  top: 0;
  left: 0;
  border: 0;
  background: #ffffff;
  transform-origin: top left;
}

.preview-stage-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 12px 18px 18px;
}

.preview-stage-switch button {
  min-height: 38px;
  padding: 9px 8px;
  border: 1px solid #cbd6e2;
  border-radius: 8px;
  color: #58677a;
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.preview-stage-switch button.is-active {
  border-color: #8ed7f4;
  color: #0874aa;
  background: #e7f7fe;
}

.builder-savebar {
  position: sticky;
  z-index: 7;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #cdd7e3;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 13px 35px rgba(25, 48, 77, 0.14);
}

.builder-savebar > div {
  display: flex;
  flex-direction: column;
}

.builder-savebar strong {
  font-size: 12px;
}

.builder-savebar span {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 10px;
}

.builder-savebar button,
.utm-builder button,
.row-form button {
  padding: 11px 16px;
  border-radius: 9px;
  color: #ffffff;
  background: #0b8fc9;
  font-size: 12px;
  font-weight: 800;
}

.builder-savebar button:hover,
.utm-builder button:hover,
.row-form button:hover {
  background: #087bb0;
}

.visit-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.sessions-disclosure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.sessions-disclosure > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 16px;
  min-height: 74px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.sessions-disclosure > summary::-webkit-details-marker {
  display: none;
}

.sessions-disclosure > summary > span:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.sessions-disclosure > summary strong {
  color: var(--ink);
  font-size: 14px;
}

.sessions-disclosure > summary small {
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sessions-summary-count {
  color: #4f6073;
  font-size: 11px;
  font-weight: 800;
}

.sessions-disclosure > summary svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 160ms ease-out;
}

.sessions-disclosure[open] > summary svg {
  transform: rotate(180deg);
}

.sessions-disclosure-content {
  padding: 18px;
  border-top: 1px solid #e7ecf2;
}

.sessions-order-note {
  margin: 0 0 10px;
  color: #6d7c8f;
  font-size: 10px;
  font-weight: 800;
}

.visit-metrics > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.visit-metrics span {
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 700;
}

.visit-metrics strong {
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.visits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.visits-table th,
.visits-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #e7ecf2;
  text-align: left;
  vertical-align: middle;
}

.visits-table th {
  color: #6d7c8f;
  background: #f8fafc;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.visits-table td > strong,
.visits-table td > small {
  display: block;
}

.visits-table td > small {
  margin-top: 4px;
  color: #8190a2;
  font-size: 10px;
}

.stage {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  color: #365069;
  background: #eaf0f6;
  font-size: 10px;
  font-weight: 800;
}

.stage--confirmed,
.stage--booked {
  color: #126145;
  background: #dff4eb;
}

.stage--closed {
  color: #6b7280;
  background: #eceff3;
}

.stage--code_shown {
  color: #81590b;
  background: #fff0c7;
}

.row-form {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(170px, 1fr) auto;
  gap: 8px;
}

.row-form button {
  white-space: nowrap;
}

.empty-table {
  padding: 32px !important;
  color: var(--ink-muted);
  text-align: center !important;
}

.utm-builder {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.utm-builder label {
  display: grid;
  gap: 7px;
  color: #263246;
  font-size: 11px;
  font-weight: 800;
}

.utm-builder button {
  min-height: 42px;
}

.link-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.link-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.5fr) minmax(260px, 1.5fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.link-item > div {
  display: flex;
  flex-direction: column;
}

.link-item strong {
  font-size: 13px;
}

.link-item span {
  margin-top: 3px;
  color: var(--ink-muted);
  font-size: 10px;
}

/* Telegram manager workspace — pinned to the supplied operations reference. */

.telegram-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 20px;
}

.telegram-leads-card,
.telegram-stats-card {
  overflow: hidden;
  border-radius: 13px;
  background: #ffffff;
  box-shadow: 0 7px 22px rgba(28, 43, 64, 0.1);
}

.telegram-card-heading {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 20px;
  border-bottom: 1px solid #e6eaf0;
}

.telegram-card-heading > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.telegram-card-heading h1,
.telegram-stats-card h2 {
  margin: 0;
  color: #111827;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.bot-connection {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7c8798;
  font-size: 10px;
  font-weight: 700;
}

.bot-connection::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aeb7c4;
  content: '';
}

.bot-connection.is-online {
  color: #148568;
}

.bot-connection.is-online::before {
  background: #20b58d;
}

.refresh-leads {
  padding: 9px 14px;
  border-radius: 7px;
  color: #ffffff;
  background: #438ce8;
  font-size: 11px;
  font-weight: 800;
}

.refresh-leads:hover {
  background: #347bd4;
}

.telegram-toolbar {
  display: grid;
  grid-template-columns: 155px minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 17px 20px;
}

.telegram-toolbar select,
.telegram-toolbar input[type='search'],
.lead-generator input,
.telegram-row-form input,
.telegram-row-form select {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #d8dee7;
  border-radius: 7px;
  color: #243147;
  background: #ffffff;
  font-size: 11px;
}

.telegram-toolbar input[type='search']::placeholder,
.lead-generator input::placeholder,
.telegram-row-form input::placeholder {
  color: #7d8796;
  opacity: 1;
}

.toolbar-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #354052;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.toolbar-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #438ce8;
}

.toolbar-check svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.lead-generator {
  border-top: 1px solid #edf0f4;
  border-bottom: 1px solid #edf0f4;
  background: #f8fafc;
}

.lead-generator summary {
  width: fit-content;
  padding: 12px 20px;
  color: #337ed8;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.lead-generator form {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(170px, 0.7fr) auto;
  align-items: end;
  gap: 12px;
  padding: 0 20px 16px;
}

.lead-generator label {
  display: grid;
  gap: 6px;
  color: #39465a;
  font-size: 10px;
  font-weight: 800;
}

.lead-generator button {
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 7px;
  color: #ffffff;
  background: #438ce8;
  font-size: 11px;
  font-weight: 800;
}

.telegram-table-shell {
  overflow: auto;
  padding: 0 20px 18px;
}

.telegram-leads-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
  border-collapse: collapse;
  color: #263246;
  font-size: 11px;
}

.telegram-leads-table th:nth-child(1) { width: 22%; }
.telegram-leads-table th:nth-child(2) { width: 15%; }
.telegram-leads-table th:nth-child(3) { width: 14%; }
.telegram-leads-table th:nth-child(4) { width: 22%; }
.telegram-leads-table th:nth-child(5) { width: 10%; }
.telegram-leads-table th:nth-child(6) { width: 17%; }

.telegram-leads-table th,
.telegram-leads-table td {
  padding: 12px 9px;
  border-bottom: 1px solid #e6eaf0;
  text-align: left;
  vertical-align: top;
}

.telegram-leads-table th {
  color: #758196;
  font-size: 9px;
  letter-spacing: 0.01em;
  font-weight: 700;
}

.telegram-leads-table td > strong,
.telegram-leads-table td > small,
.telegram-leads-table td > code {
  display: block;
}

.telegram-leads-table td > strong {
  color: #182338;
  line-height: 1.35;
}

.telegram-leads-table td > small {
  margin-top: 5px;
  color: #7c8797;
  font-size: 9px;
}

.telegram-leads-table td > code {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 5px;
  color: #263246;
  background: #eef1f5;
  font-family: Consolas, "Courier New", monospace;
  font-size: 10px;
  font-weight: 700;
}

.lead-link-copy {
  margin-top: 6px;
  padding: 0;
  color: #438ce8;
  background: transparent;
  font-size: 9px;
  font-weight: 700;
}

.lead-signals {
  display: grid;
  gap: 4px;
  margin: 0;
}

.lead-signals div {
  display: grid;
  grid-template-columns: 55px 24px;
  gap: 5px;
}

.lead-signals dt,
.lead-signals dd {
  margin: 0;
}

.lead-signals dt {
  color: #7a8492;
}

.lead-yes {
  color: #17a881;
}

.lead-no {
  color: #e04a50;
}

.telegram-row-form {
  display: grid;
  min-width: 132px;
  gap: 6px;
}

.telegram-row-form div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.telegram-row-form button {
  padding: 7px 9px;
  border-radius: 6px;
  color: #ffffff;
  background: #438ce8;
  font-size: 9px;
  font-weight: 800;
}

.telegram-row-form .deactivate-lead {
  background: #e5484d;
}

.telegram-row-form .deactivate-lead:hover {
  background: #cc383d;
}

.telegram-empty {
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 34px 20px;
  color: #738095;
  text-align: center;
  font-size: 11px;
}

.telegram-empty[hidden] {
  display: none;
}

.telegram-empty strong {
  color: #263246;
  font-size: 13px;
}

.telegram-stats-card {
  padding: 18px 20px 22px;
}

.telegram-stats-card h2 {
  padding-bottom: 15px;
  border-bottom: 1px solid #e6eaf0;
  font-size: 14px;
}

.telegram-stats-card h2 span {
  font-weight: 700;
}

.stats-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 24px 0 26px;
}

.stats-total strong {
  color: #172033;
  font-size: 31px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.stats-total span {
  color: #788497;
  font-size: 12px;
}

.funnel-stat + .funnel-stat {
  margin-top: 22px;
}

.funnel-stat > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #748094;
  font-size: 11px;
}

.funnel-stat strong {
  color: #29344a;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}

.funnel-stat b,
.funnel-stat i {
  font-style: normal;
  font-weight: 800;
}

.funnel-stat progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #edf1f5;
  accent-color: #438ce8;
}

.funnel-stat progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #edf1f5;
}

.funnel-stat progress::-webkit-progress-value {
  border-radius: 999px;
  background: #438ce8;
}

.funnel-stat.is-popup progress {
  accent-color: #8155e8;
}

.funnel-stat.is-popup progress::-webkit-progress-value {
  background: #8155e8;
}

.funnel-stat.is-confirmed progress {
  accent-color: #20b58d;
}

.funnel-stat.is-confirmed progress::-webkit-progress-value {
  background: #20b58d;
}

.stats-note {
  margin: 26px 0 0;
  padding-top: 16px;
  border-top: 1px solid #e6eaf0;
  color: #7b8798;
  font-size: 10px;
  line-height: 1.45;
}

.admin-dark {
  --canvas: #111923;
  --surface: #192431;
  --line: #2f3c4b;
  --ink: #eef3f8;
  --ink-muted: #98a7b8;
  background: #111923;
}

.admin-dark .admin-workspace,
.admin-dark .admin-panel {
  background: #111923;
}

.admin-dark .admin-topbar,
.admin-dark .telegram-leads-card,
.admin-dark .telegram-stats-card {
  color: #e7edf5;
  background: #192431;
}

.admin-dark .telegram-card-heading,
.admin-dark .telegram-stats-card h2,
.admin-dark .telegram-leads-table th,
.admin-dark .telegram-leads-table td,
.admin-dark .stats-note {
  border-color: #2f3c4b;
}

.admin-dark .telegram-card-heading h1,
.admin-dark .telegram-stats-card h2,
.admin-dark .telegram-leads-table td > strong,
.admin-dark .telegram-empty strong,
.admin-dark .stats-total strong,
.admin-dark .funnel-stat strong {
  color: #edf3f9;
}

.admin-dark .telegram-toolbar select,
.admin-dark .telegram-toolbar input,
.admin-dark .lead-generator input,
.admin-dark .telegram-row-form input,
.admin-dark .telegram-row-form select {
  border-color: #3b4a5b;
  color: #e7edf5;
  background: #111923;
}

.admin-dark .lead-generator {
  border-color: #2f3c4b;
  background: #151f2b;
}

.admin-dark .toolbar-check,
.admin-dark .lead-generator label {
  color: #c5d0dc;
}

.link-item code {
  overflow: hidden;
  color: #2f435a;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 11px/1.4 Consolas, monospace;
}

.copy-link {
  padding: 9px 12px;
  border: 1px solid #cdd7e3;
  border-radius: 8px;
  color: #334155;
  background: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.empty-state {
  padding: 34px;
  border: 1px dashed #c4cfdb;
  border-radius: 12px;
  color: var(--ink-muted);
  background: #ffffff;
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
}

.empty-state p {
  margin: 7px 0 0;
  font-size: 12px;
}

/* Login */

.admin-login-body {
  display: grid;
  place-items: center;
  padding: 24px;
  background: #0d1726;
}

.admin-login {
  width: min(420px, 100%);
}

.admin-login form {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 18px 14px;
  padding: 30px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.admin-login h1 {
  margin: 2px 0 0;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.admin-login form > div:nth-child(2) p {
  margin: 6px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.4;
}

.admin-login label,
.admin-login input,
.admin-login button,
.login-error {
  grid-column: 1 / -1;
}

.admin-login label {
  margin-bottom: -10px;
  font-size: 12px;
  font-weight: 800;
}

.admin-login input {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #b9c5d2;
  border-radius: 9px;
}

.admin-login button {
  min-height: 46px;
  border-radius: 9px;
  color: #ffffff;
  background: #0b8fc9;
  font-weight: 800;
}

.login-error {
  margin: 0;
  padding: 11px 12px;
  border-radius: 8px;
  color: #8f2018;
  background: #ffebe8;
  font-size: 12px;
  line-height: 1.4;
}

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

  .preview-column {
    position: relative;
    top: auto;
    order: -1;
  }

  .utm-builder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .utm-builder button {
    grid-column: 1 / -1;
  }

  .telegram-dashboard {
    grid-template-columns: 1fr;
  }

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

  .telegram-stats-card h2,
  .telegram-stats-card .stats-note {
    grid-column: 1 / -1;
  }

  .stats-total {
    margin: 0;
  }

  .funnel-stat + .funnel-stat {
    margin-top: 0;
  }
}

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

  .admin-sidebar {
    position: fixed;
    left: 0;
    width: 256px;
    transform: translateX(-102%);
    transition: transform 180ms ease-out;
    box-shadow: 18px 0 46px rgba(2, 12, 24, 0.3);
  }

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

  .sidebar-toggle {
    display: block;
  }

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

  .telegram-toolbar {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .public-site {
    min-height: 620px;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    height: 66px;
    padding: 0 18px;
  }

  .site-header nav {
    display: none;
  }

  .brand > span {
    width: 36px;
    height: 36px;
  }

  .header-action {
    min-width: 0;
    padding: 10px 14px;
  }

  .hero {
    height: calc(100vh - 66px);
    min-height: 554px;
    align-items: flex-end;
    padding: 0 22px 44px;
    background-position: 61% center;
  }

  .hero section {
    transform: none;
  }

  .overlay {
    background: linear-gradient(90deg, rgba(4, 17, 23, 0.79) 0%, rgba(5, 14, 20, 0.62) 65%, rgba(5, 12, 18, 0.47) 100%);
  }

  .hero h1 {
    margin: 18px 0 20px;
    font-size: clamp(30px, 10.6vw, var(--hero-title-size, 44px));
  }

  .hero-description {
    font-size: 14px;
  }

  .actions {
    gap: 12px;
    margin-top: 24px;
  }

  .actions button {
    min-width: 0;
    flex: 1;
    padding-inline: 18px;
  }

  .modal {
    padding: 28px 24px 30px;
  }

  .modal h2 {
    padding-right: 24px;
    font-size: var(--popup-title-size, 26px);
  }

  .demo-code {
    font-size: 28px;
  }

  .final-screen {
    padding: 34px 22px 26px;
  }

  .final-screen-content {
    min-height: calc(100vh - 60px);
  }

  .final-brand-title {
    font-size: min(var(--final-title-size, 58px), 46px);
  }

  .final-lead {
    margin-top: 36px;
    font-size: min(var(--final-lead-size, 30px), 28px);
  }

  .final-facts,
  .final-code-line,
  .final-guidance {
    font-size: max(var(--final-body-size, 18px), 16px);
  }

  .final-phone-list {
    font-size: 25px;
  }

  .final-action {
    min-height: 58px;
    margin-top: 30px;
    font-size: 17px;
  }

  .admin-panel {
    padding: 25px 14px 34px;
  }

  .admin-topbar {
    padding-inline: 14px;
  }

  .admin-topbar > div span {
    display: none;
  }

  .open-site-link {
    padding: 9px;
    font-size: 0;
  }

  .panel-heading {
    flex-direction: column;
  }

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

  .builder-field--textarea,
  .builder-field--range,
  .builder-field--color,
  .builder-field--url,
  .builder-field--toggle,
  .builder-field--trigger_mode,
  .builder-field--redirect_mode {
    grid-column: auto;
  }

  .builder-flow ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-stage > summary {
    grid-template-columns: 34px minmax(0, 1fr) 20px;
  }

  .settings-stage-state {
    display: none;
  }

  .settings-stage-copy small {
    font-size: 10px;
  }

  .sessions-disclosure > summary {
    grid-template-columns: minmax(0, 1fr) 20px;
  }

  .sessions-summary-count {
    display: none;
  }

  .sessions-disclosure-content {
    padding: 12px;
  }

  .preview-stage {
    min-height: 360px;
    padding: 10px;
  }

  .builder-savebar {
    align-items: stretch;
    flex-direction: column;
  }

  .visit-metrics {
    grid-template-columns: 1fr;
  }

  .visits-table thead {
    display: none;
  }

  .visits-table,
  .visits-table tbody,
  .visits-table tr,
  .visits-table td {
    display: block;
    width: 100%;
  }

  .visits-table tr {
    padding: 12px;
    border-bottom: 1px solid #dfe5ec;
  }

  .visits-table td {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    padding: 8px 3px;
    border: 0;
  }

  .visits-table td::before {
    content: attr(data-label);
    color: #7d8998;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .utm-builder,
  .link-item {
    grid-template-columns: 1fr;
  }

  .utm-builder button {
    grid-column: auto;
  }

  .telegram-card-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .telegram-card-heading > div {
    align-items: flex-start;
    flex-direction: column;
  }

  .refresh-leads {
    width: 100%;
  }

  .telegram-toolbar,
  .lead-generator form,
  .telegram-stats-card {
    grid-template-columns: 1fr;
  }

  .telegram-stats-card h2,
  .telegram-stats-card .stats-note {
    grid-column: auto;
  }

  .telegram-table-shell {
    padding-inline: 12px;
  }

  .telegram-leads-table {
    min-width: 0;
  }

  .telegram-leads-table thead {
    display: none;
  }

  .telegram-leads-table,
  .telegram-leads-table tbody,
  .telegram-leads-table tr,
  .telegram-leads-table td {
    display: block;
    width: 100%;
  }

  .telegram-leads-table tr {
    padding: 11px 0;
    border-bottom: 1px solid #dfe5ec;
  }

  .telegram-leads-table td {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 12px;
    padding: 8px 5px;
    border: 0;
  }

  .telegram-leads-table td::before {
    color: #7d8998;
    content: attr(data-label);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
  }

  .telegram-leads-table td > *,
  .telegram-row-form {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
