:root {
  /* Э2 Ч4: цвет по назначению (решение о цвете 2026-10-05). */
  --color-ink: #12294B;
  --color-text-body: #3A4A5E;
  --color-text-secondary: #5A6A7E;
  --color-accent: #3657CD;
  --color-accent-soft: #F0F4FF;
  --color-surface: #FFFFFF;
  --color-field: #F8F9FB;
  --color-subtle: #F0F2F7;
  --color-border: #E0E6EE;
  --color-hero: #0D1F3C;
  --color-hero-end: #1A3A6B;
  --color-success: #2E7D32;
  --color-success-bg: #E8F5E9;
  --color-danger: #D32F2F;
  --color-danger-bg: #FCE4EC;
  --color-danger-ink: #B71C1C;
  --color-danger-on-dark: #FF8A80;
  --color-warning: #E65100;
  --color-warning-bg: #FFF8E1;
  --color-warning-ink: #8A4B00;
  --color-info: #1565C0;
  --color-info-bg: #E3F2FD;
  --color-gold: #E8A838;
  --color-gold-end: #F0C060;
  --color-ink-rgb: 18, 41, 75;
  --color-accent-rgb: 54, 87, 205;
  --color-surface-rgb: 255, 255, 255;
  --color-success-rgb: 46, 125, 50;
  --color-danger-rgb: 211, 47, 47;
  --color-gold-rgb: 232, 168, 56;
  /* Э3: имена модалок, согласия и замороженных правил набора - прежние значения до Э3. */
  --color-white: #FFFFFF;
  --color-grey: #B5B5B5;
  --color-blue: #3657CD;
  --color-blue-dark: #12294B;
  --color-blue-dark-2: #153c76;
  --color-blue-dark-3: #4D688F;
  --color-blue-dark-4: #617189;
  --color-red: red;
  --color-white-rgb: 255, 255, 255;
  --color-blue-rgb: 54, 87, 205;
  --color-blue-dark-rgb: 18, 41, 75;
  --color-blue-083: #111827;
  --color-blue-163: #1f2937;
  --color-blue-273: #374151;
  --color-blue-309: #3a4a5e;
  --color-blue-358: #4b5563;
  --color-blue-432: #1565c0;
  --color-blue-442: #5a6a7e;
  --color-blue-479: #6b7280;
  --color-blue-617: #8a96a8;
  --color-blue-673: #9aa5b4;
  --color-blue-709: #9dafc8;
  --color-blue-790: #90caf9;
  --color-gray-000: #000000;
  --color-gray-000-rgb: 0, 0, 0;
  --color-gray-212: #333333;
  --color-gray-567: #888888;
  --color-gray-668: #9ca3af;
  --color-gray-821: #c5cdd8;
  --color-gray-832-b: #c8d0dc;
  --color-gray-858: #d0d7e5;
  --color-gray-911: #e0e6ee;
  --color-gray-947: #e3f2fd;
  --color-gray-947-b: #fdecea;
  --color-gray-953: #e8f5e9;
  --color-gray-955-c: #f0f2f7;
  --color-gray-962: #f0f4ff;
  --color-gray-964: #fef2f2;
  --color-gray-972: #f5f7fa;
  --color-gray-972-b: #f5f7fb;
  --color-gray-979-b: #f8f9fb;
  --color-gray-982: #f0fdf4;
  --color-green-394: #33691e;
  --color-green-463: #2e7d32;
  --color-green-588: #16a34a;
  --color-green-862: #c5e1a5;
  --color-green-967: #f1f8e9;
  --color-orange-375: #92400e;
  --color-orange-548: #e65100;
  --color-orange-599: #d97706;
  --color-red-236: #6b1b17;
  --color-red-395: #b71c1c;
  --color-red-438: #c62828;
  --color-red-471: #d32f2f;
  --color-red-479: #dc2626;
  --color-red-517: #e53935;
  --color-red-517-rgb: 229, 57, 53;
  --color-red-828: #f5c2c0;
  --color-red-921: #fee2e2;
  --color-red-927: #fce4ec;
  --color-yellow-343: #664d03;
  --color-yellow-343-rgb: 102, 77, 3;
  --color-yellow-348: #6d4c00;
  --color-yellow-750: #f9a825;
  --color-yellow-815: #ffc107;
  --color-yellow-899: #ffe082;
  --color-yellow-959: #fff3cd;
  --color-yellow-963: #fff3e0;
  --color-yellow-976-b: #fff8e1;
  --color-yellow-985: #fffbeb;
  /* Э2: шкала кеглей и интервалов по роли (решение о шкале 2026-10-01). */
  --font-caption: 12px;
  --font-small: 14px;
  --font-body: 16px;
  --font-title: 24px;
  --font-display: 32px;
  --font-hero: 48px;
  --lh-control: 1;
  --lh-heading: 1.25;
  --lh-ui: 1.5;
  --lh-text: 1.6;
  /* Э2 Ч2: радиус и gap по роли. */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --gap-1: 4px;
  --gap-2: 8px;
  --gap-3: 12px;
  --gap-4: 16px;
  --gap-5: 24px;
  --gap-6: 48px;

}

/* Кегль сайта; style.css (17px) остается админке. */
body {
  font-size: var(--font-body);
}

/* Замороженные зоны Э2 (модалки входа, подписания, отзыва, согласие, текст договора
   и родители цели масштаба) держат прежний кегль body: 17px из style.css. */
#sign-in-modal,
#sign-up-modal,
#pass-reset-modal,
#demo-sign-modal,
#sign-doc-modal,
#revoke-signature-modal,
#same-device-block-modal,
#resend-doc-modal,
.cflow-card,
.tpl-detail-preview,
.doc-page-text,
.approval-preview {
  font-size: 17px;
}

h1 {
  font-weight: 700;
  font-size: var(--font-hero);
}

@media(max-width:640px){
  h1 {
    font-size:var(--font-display);
  }
}

h3 {
  font-weight: 600;
  font-size: var(--font-title);
}

.color-grey {
  color: var(--color-text-secondary)
}

.color-blue-dark {
  color: var(--color-ink)
}

.color-red {
  color: var(--color-red)
}

.color-bg-grey-2 {
  background-color: var(--color-subtle);
}

.button {
  padding: 14px 34px;
  border-radius: 16px;
  font-weight: 500;
  border: 2px solid var(--color-blue-dark);
  box-shadow: 0px 4px 4px rgba(var(--color-gray-000-rgb), 0.25);
  box-sizing: border-box;
  text-align: center;
}

.button:disabled{
}

.button-dark {
  background-color: var(--color-blue-dark);
  color: var(--color-white);
}

.button-dark:disabled{
  background-color: var(--color-blue-dark-4);
}
.button-dark:disabled:hover{
  background-color: var(--color-blue-dark-4);
}

.button-dark:hover {
  background-color: var(--color-blue-dark-2);
  color: var(--color-white);
}

.button-dark:active{
  background-color: var(--color-blue-dark-3);
}

@media(max-width:640px) {
  .button {
    font-size: 14px;
    padding: 10px 34px;
  }
}

.form-block{
  display: flex;
  flex-direction: column;
  gap:var(--gap-5);
  
}

.form-field-block{
  display: flex;
  flex-direction: column;
}

.input-field {
  border-radius: 16px;
  /* padding: 12px 36px; */
  padding: 12px 12px 12px 24px;
  border-style: solid;
  box-shadow: none;
  border: 1px var(--color-gray-000) solid;
  outline-color: var(--color-gray-000);
  -webkit-box-sizing: border-box;
  /* Safari/Chrome, other WebKit */
  -moz-box-sizing: border-box;
  /* Firefox, other Gecko */
  box-sizing: border-box;
}

.input-field::placeholder {
  font-weight: bold;
  color: var(--color-grey);
}

.input-field:focus {

  outline: 1px var(--color-blue-dark-3) solid !important;
}


.block-shadow {
  mix-blend-mode: normal;
  box-shadow: 0px 0px 8px rgba(var(--color-ink-rgb), 0.25);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
}

.main-container {
  display: flex;
  flex-direction: column;
  width: 1200px;
  max-width: 95%;
  margin: 32px auto 64px auto;
  z-index: 100;
}

@media (max-width:1280px) {
  .main-container {
    width: 100%;
    /* margin: 24px auto; */

  }
}

.show-on-hover {
  visibility: hidden;
}

.hover-el {
  position: relative;
}

.hover-el:hover .show-on-hover {
  visibility: visible;
}
.hover-el:hover .tooltip-text {
  visibility: visible;
}

.custom-tooltip{
    position: absolute;
    /* top:-24px; */
    right:0;
    padding: 4px 8px;
    border: solid 1px var(--color-text-secondary);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    background-color: var(--color-subtle);
    z-index: 100;
    font-size: var(--font-small);
}

.tooltip-text {
    top: 20px;
    left: 100%;
    width: max-content;
    max-width: 220px;
    position: absolute;
    padding: 4px 8px;
    border: solid 1px var(--color-text-secondary);
    border-radius: var(--radius-sm);
    color: var(--color-ink);
    background-color: var(--color-subtle);
    z-index: 100;
    font-size: var(--font-small);
    opacity: 1 !important;
    visibility: hidden;
}

.cursor-pointer {
  cursor: pointer;
}

.field-invalid {
  border-color: var(--color-danger);
}

.input-error {
  border-color: var(--color-danger);
}

.error-msg {
  color: var(--color-danger);
  justify-self: center;
  visibility: hidden;
}

.error {
  color: var(--color-red);
  font-size:.8rem;
}

.no-decor-link {
  text-decoration: none;
  color: unset;
}

.no-decor-link:hover {
  cursor: pointer;
  color: var(--color-accent)
}
.no-decor {
  text-decoration: none;
}
.no-decor:hover {
  cursor: pointer;
  text-decoration: none;
}

.light-blue-link {
  color: var(--color-accent);
}

.sortable-table-header:hover {
  cursor: pointer;
  text-decoration: underline;
}

@media (max-width:800px) {
  .doc-table {
    table-layout: fixed;
    word-break: break-all;
    font-size: .9rem;
  }
}


.custom-table {
  border: 3px solid var(--color-subtle);
  padding: 12px !important;
}

.custom-table th {
  background-color: var(--color-subtle);
  padding: 0 24px;
  font-weight: 400;
  font-size: var(--font-caption);
}


.custom-table > tbody > tr > td {
  padding: 0 24px;
  height: 100px;
  font-size: var(--font-body);
  
}

.custom-table tr {
  border-bottom: 3px solid var(--color-subtle);
  /* padding: 0 36px; */
}

.custom-table thead {
  border: 0;
  height: 56px;
}

.modal-backdrop{
  z-index: 510 !important;
}

.modal-content{
  padding: 24px 18px;
}

input[type='checkbox']{
  height: 18px !important;
  width: 18px !important;
  flex-shrink: 0;
}

input[type='checkbox']:focus{
  border-color: none;
  box-shadow: none;
  outline: 0 none;
}

input[type="checkbox"]:checked{
  background-color: var(--color-blue-dark);
}

.form-check-label{
  margin-left: 16px;
}

@media(min-width: 640px){
  .modal-content{
    border-radius: 32px;
  }
}

@media(max-width: 640px){
  .modal-content{
    padding: 42px 24px;
  }
}


.sidebar-slider{
  display: flex;
  flex-direction: column;
  position: relative;
  border:1px solid var(--color-subtle);
  /* box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); */
  width:480px;
  padding: 0.5rem;
  height: fit-content;
  min-height: 420px;
}

.template-text{
  max-width: 66%;
  border: 1px solid var(--color-subtle);
  padding: .5rem
}
@media(max-width: 600px){
  .template-text-hide-mobile{
    display: none;
  }
}

@media(max-width:1280px){
  .sidebar-slider{
    background-color: var(--color-surface);
    min-width: 420px;
    border: 1px solid var(--color-subtle);
    border-radius: var(--radius-sm);
    margin: 0 0 0 64px;
    
  }
  .sidebar-arrow{
    background-image: url("../images/left_arrow.178f4e1dbebf.png");
    background-position: center;
    background-repeat: no-repeat;
    display: block;
    position:absolute;
    height:256px;
    width: 48px;
    left:-48px;
    top: 120px;
    border: 1px solid var(--color-subtle);
    box-shadow: 0px 4px 0 rgba(var(--color-ink-rgb), 0.25);
    border-right: none;
    background-color: var(--color-surface);
    border-top-left-radius: var(--radius-sm);
    border-bottom-left-radius: var(--radius-sm);
    pointer-events:all;
  }
  .sidebar-slider-active{
    position: absolute;
    right:16px;
  }
  .sidebar-slider-active .sidebar-arrow{
    background-image: url("../images/right_arrow.3cd58b5d99e1.png");
  }
  .template-text{
    min-width: 800px;
    max-width: 80%;
  }
}

@media(max-width:1000px){
  .template-text{
    min-width:600px;
    max-width: 66%;
  };
}
@media(max-width:800px){
  .template-text{
    min-width:500px;
    max-width: 66%;
  };
}

@media(max-width:640px){
  
  .sidebar-arrow{
    display: none;
  }
  .sidebar-slider{
    box-shadow: none;
    border: none;
    margin: auto;
    width: unset;
    min-width: unset;
    max-width: 95%;
    padding: unset;
  }
  .template-text{
    width: 95%;
    max-width: unset;
    min-width: unset;
  }
}

#cookie-message {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  width: 100%;
  background-color: var(--color-surface);
  padding: 12px;
  z-index: 9999; 
  display: flex;
  gap: var(--gap-3);
  justify-content: center;
  align-items: center;
}

.cookie-link {
  color: inherit;
  text-decoration: underline;
}

.cookie-accept-btn {
  margin-left: 8px;
}

.cookie-close-btn {
  background: none;
  border: none;
  color: var(--color-danger);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

/* Э2 Ч2: цель касания 44×44 на телефоне (решение о шкале, «Контролы»). */
@media (max-width: 640px) {
  #cookie-message .cookie-close-btn {
    min-width: 44px;
    min-height: 44px;
    margin: -9px;
  }
}
.cookie-close-btn:hover {
  background: rgba(var(--color-danger-rgb), 0.08);
}


.clipboard-tooltip {
  position: absolute;
  background-color: var(--color-ink);
  color: var(--color-surface);
  padding: 4px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
  font-size: var(--font-caption);
}

.clipboard-tooltip.visible {
  opacity: 1;
}




.circle {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}


.template-badge-parent {
  border: 1px solid var(--color-info-bg);
  border-radius: var(--radius-md);
  background-color: var(--color-info-bg);
  padding: 0 8px;
  font-size:var(--font-caption);
  color: var(--color-accent);
  height: max-content;
  white-space: nowrap;
}

.template-badge-child {
  border: 1px solid var(--color-text-secondary);
  border-radius: var(--radius-md);
  background-color: var(--color-border);
  padding: 0 8px;
  font-size:var(--font-caption);
  color: var(--color-text-body);
  height: max-content;
  white-space: nowrap;
}


/* ===== Global toast ===== */
.ond-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: var(--font-small);
    font-weight: 400;
    color: var(--color-surface);
    background: var(--color-ink);
    box-shadow: 0 6px 24px rgba(var(--color-ink-rgb), 0.25);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    max-width: 90vw;
    text-align: center;
}

.ond-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.ond-toast--success { background: var(--color-success); }
.ond-toast--error { background: var(--color-danger-ink); }
.ond-toast--info { background: var(--color-ink); }