/* Asset version: 80 */
/* MKTU changer page styles (v1) */
.tool-shell {
  overflow-anchor: none;
  --tool-accent: #0f766e;
  --tool-accent-strong: #0d5f59;
  --tool-accent-soft: #ccfbf1;
  --tool-border: rgba(15, 118, 110, 0.22);
  --tool-danger: #991b1b;
  --tool-warning: #9a3412;
}

.tool-hero {
  position: relative;
  overflow: hidden;
}

.tool-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 82% 22%, rgba(20, 184, 166, 0.22), transparent 55%);
  pointer-events: none;
}

.tool-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 960px) {
  .tool-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .tool-card--full {
    grid-column: 1 / -1;
  }
}

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

.tool-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.tool-card-title {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.25;
  font-weight: 600;
  color: #0f172a;
}

.tool-list-title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 700;
  color: #334155;
}

.tool-meta {
  margin: 0.45rem 0 0;
  color: #64748b;
  font-size: 0.86rem;
  line-height: 1.45;
}

.ignored-errors-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.8rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid rgba(180, 83, 9, 0.28);
  border-radius: 0.65rem;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.92rem;
  line-height: 1.35;
}

.ignored-errors-notice__button {
  flex: 0 0 auto;
  border: 0;
  padding: 0.2rem 0.35rem;
  background: transparent;
  color: #0f766e;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.ignored-errors-notice__button:hover,
.ignored-errors-notice__button:focus-visible {
  color: #0d5f59;
}

.full-removal-confirmation {
  margin-top: 0.9rem;
  padding: 1rem;
  border: 2px solid rgba(180, 83, 9, 0.45);
  border-radius: 0.8rem;
  background: #fffbeb;
  color: #78350f;
}

.full-removal-confirmation:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 3px;
}

.full-removal-confirmation__classes {
  margin: 0.65rem 0 0;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 700;
  color: #92400e;
}

.full-removal-confirmation .tool-actions {
  margin-top: 0.85rem;
}

@media (max-width: 520px) {
  .ignored-errors-notice {
    align-items: flex-start;
    flex-direction: column;
  }
}

.tool-label {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 600;
}

.registry-row {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

#openRegistryBtn {
  width: fit-content;
  justify-self: start;
  white-space: nowrap;
}

@media (min-width: 720px) {
  .registry-row {
    grid-template-columns: minmax(12rem, 20rem) auto;
    align-items: end;
  }
}

.tool-input,
.tool-output,
.tool-input-line {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.42);
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.tool-input,
.tool-output {
  min-height: 12rem;
  resize: vertical;
  border-radius: 0.9rem;
  padding: 0.95rem 1rem;
  line-height: 1.45;
}

.source-input-shell {
  position: relative;
  margin-top: 1rem;
}

.tool-input--source {
  min-height: 17rem;
  margin-top: 0;
  position: relative;
  z-index: 2;
}

.source-terms-list {
  display: grid;
  gap: 1.15rem;
  margin-top: 0.8rem;
  overflow-anchor: none;
}

.source-class-group {
  border: 2px solid #94a3b8;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.09);
  padding: 0.8rem 0.9rem;
  content-visibility: auto;
  contain-intrinsic-size: auto 18rem;
}

.source-class-sticky-head {
  position: sticky;
  /* Шапка закрепляется при обычной прокрутке страницы и освобождает место,
     когда до верхней границы доходит следующий класс. */
  top: 0;
  z-index: 2;
  margin: -0.8rem -0.9rem 0;
  padding: 0.8rem 0.9rem 0.35rem;
  background: #ffffff;
}

.source-class-group--selected {
  border-color: #65a30d;
  background: #f0fdf4;
  box-shadow: 0 3px 10px rgba(21, 128, 61, 0.12);
}

.source-class-group--selected .source-class-sticky-head {
  background: #f0fdf4;
}

.source-class-group--removed {
  border-color: #94a3b8;
  background: #f8fafc;
}

.source-class-group--removed .source-class-sticky-head {
  background: #f8fafc;
}

.source-class-hint {
  margin: 0 0 0.55rem;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.4;
}

.source-duplicate-notice {
  color: #b45309;
  font-weight: 800;
}

.source-term-btn.source-term-btn--duplicate {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22);
}

.source-term-btn.source-term-btn--duplicate[aria-pressed="true"] {
  border-color: #d97706;
  background: #fde68a;
  color: #78350f;
}

.source-preview-duplicate-word {
  border-radius: 0.2rem;
  background: #fef3c7;
  color: #92400e;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35);
}

.source-class-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.source-class-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
  margin-top: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
}

.source-class-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: nowrap;
  margin-left: auto;
}

.source-class-actions .source-class-save-all,
.source-class-actions .tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 1.8rem;
  padding: 0.28rem 0.55rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
}

.source-class-title {
  margin: 0;
  color: #334155;
  font-size: 0.86rem;
  font-weight: 800;
}

.source-class-selection-summary {
  margin-left: 0.45rem;
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
}

.source-class-group--selected .source-class-selection-summary {
  color: #166534;
}

.source-class-group--removed .source-class-selection-summary {
  color: #64748b;
}

.source-class-number {
  display: inline-block;
  border-radius: 0.2rem;
  background: rgba(16, 185, 129, 0.18);
  color: #065f46;
  padding: 0 0.16rem;
}

.source-color-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  box-sizing: border-box;
  border: 1px solid transparent;
  border-radius: 0.9rem;
  padding: 0.95rem 1rem;
  overflow: hidden;
  pointer-events: none;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  font: inherit;
  line-height: 1.45;
  color: #334155;
  background: #ffffff;
}

.source-input-shell--highlighted .tool-input--source {
  color: transparent;
  caret-color: #0f172a;
  background: transparent;
}

/* При редактировании и выделении показываем настоящий текст textarea,
   чтобы Ctrl+A и выделение мышью были видимыми. */
.source-input-shell--highlighted:not(.source-input-shell--diagnostic-focus):focus-within .tool-input--source {
  color: #0f172a;
  background: #ffffff;
}
.source-input-shell--highlighted:not(.source-input-shell--diagnostic-focus):focus-within .source-color-preview {
  visibility: hidden;
}

.source-input-shell--highlighted.source-input-shell--diagnostic-focus .tool-input--source {
  color: transparent;
  background: transparent;
}

.source-input-shell--highlighted.source-input-shell--diagnostic-focus .source-color-preview {
  visibility: visible;
}

.source-preview-line + .source-preview-line { margin-top: 0.2rem; }
.source-preview-class-number {
  border-radius: 0.2rem;
  background: rgba(16, 185, 129, 0.18);
  color: #065f46;
  /* Не меняем ширину текста под overlay, иначе он расходится с textarea. */
  padding: 0;
  font-weight: 800;
}
.source-preview-term-number {
  border-radius: 0.2rem;
  background: rgba(248, 113, 113, 0.18);
  color: #991b1b;
  padding: 0;
  font-weight: 800;
}

.source-preview-latin-letter {
  border-radius: 0.15rem;
  background: rgba(220, 38, 38, 0.2);
  color: #b91c1c;
  padding: 0;
  font-weight: 800;
}

.source-preview-diagnostic-word {
  border-radius: 0.2rem;
  background: #fde68a;
  color: #7f1d1d;
  box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.18);
}

.source-preview-diagnostic-word--animating {
  animation: diagnostic-pulse 720ms ease-in-out 2;
}

@keyframes diagnostic-pulse {
  0%, 100% { background-color: #fde68a; box-shadow: 0 0 0 1px rgba(180, 83, 9, 0.18); }
  50% { background-color: #fb923c; box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.32); }
}

.source-class-hint {
  margin: 0.65rem 0 0.45rem;
  color: #64748b;
  font-size: 0.78rem;
  line-height: 1.4;
}

.source-class-mode {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 100%;
}

.source-class-mode-btn {
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #475569;
  padding: 0.34rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.source-class-mode-btn:hover,
.source-class-mode-btn:focus-visible {
  border-color: var(--tool-accent);
  color: var(--tool-accent-strong);
}

.source-class-mode-btn[aria-pressed="true"] {
  border-color: var(--tool-accent);
  background: var(--tool-accent-soft);
  color: var(--tool-accent-strong);
}

.source-class-delimiter {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: 0.35rem;
}

.source-class-delimiter-label {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
}

.source-class-delimiter-btn {
  min-width: 1.8rem;
  min-height: 1.8rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 0.45rem;
  background: rgba(255, 255, 255, 0.86);
  color: #475569;
  font-weight: 800;
  cursor: pointer;
}

.source-class-delimiter-btn[aria-pressed="true"] {
  border-color: var(--tool-accent);
  background: var(--tool-accent-soft);
  color: var(--tool-accent-strong);
}

.source-class-save-all {
  min-height: 1.8rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.86);
  color: #475569;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.source-class-save-all:hover,
.source-class-save-all:focus-visible {
  border-color: #16a34a;
  background: #dcfce7;
}

.source-class-save-all[aria-pressed="true"] {
  border-color: var(--tool-accent);
  background: var(--tool-accent-soft);
  color: var(--tool-accent-strong);
}

.source-term-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.source-term-buttons--stacked {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.source-term-btn {
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #e2e8f0;
  color: #475569;
  padding: 0.4rem 0.55rem;
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.35;
  cursor: pointer;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.source-term-btn:hover,
.source-term-btn:focus-visible {
  border-color: #16a34a;
  background: #dcfce7;
}

.source-term-btn[aria-pressed="true"] {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
  cursor: pointer;
}

.source-term-join-btn,
.source-term-split-btn {
  align-self: center;
  width: 4.75rem;
  min-width: 4.75rem;
  min-height: 2rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid rgba(13, 148, 136, 0.42);
  border-radius: 0.5rem;
  background: rgba(240, 253, 250, 0.9);
  color: var(--tool-accent-strong);
  font-weight: 800;
  cursor: pointer;
}

.source-term-join-btn {
  font-size: 1.1rem;
  line-height: 1.2;
}

.source-term-split-btn {
  font-size: 0.75rem;
}

.source-term-join-btn:hover,
.source-term-join-btn:focus-visible,
.source-term-split-btn:hover,
.source-term-split-btn:focus-visible {
  border-color: #0f766e;
  background: #ccfbf1;
}

.source-term-buttons--stacked .source-term-tooltip {
  display: block;
}

.source-term-buttons--stacked .source-term-btn {
  width: 100%;
}

.source-term-buttons--stacked .source-term-join-btn,
.source-term-buttons--stacked .source-term-split-btn {
  justify-self: center;
  width: 4.75rem;
  min-width: 4.75rem;
  min-height: 2rem;
}

.source-term-tooltip {
  max-width: 100%;
}

.tool-output {
  min-height: 33rem;
  margin-top: 0.75rem;
  font-family: Consolas, Menlo, Monaco, monospace;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.tool-output--rich {
  overflow: auto;
  font-family: Consolas, Menlo, Monaco, monospace;
}

.source-replace-confirmation {
  margin-top: 0.75rem;
}

.source-replace-confirmation__remember {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
  color: #475569;
  font-size: 0.86rem;
}

.tool-output--rich .tool-output__heading {
  color: #0f172a;
  font-weight: 800;
}

.tool-input-line {
  min-height: 2.7rem;
  border-radius: 0.75rem;
  padding: 0.65rem 0.8rem;
}

.tool-input:focus,
.tool-output:focus,
.tool-input-line:focus {
  border-color: var(--tool-accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.tool-input-line[aria-invalid="true"] {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.source-toolbar {
  display: flex;
  margin: 1rem 0 0;
  max-width: 100%;
  gap: 0.75rem 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.source-toolbar .tool-actions {
  margin-top: 0;
  flex: 0 0 auto;
}

.delimiter-group {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  border: 0;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  flex: 0 0 auto;
}

.delimiter-group legend {
  align-self: center;
  margin: 0;
  flex: 0 0 auto;
}

.delimiter-group__title {
  align-self: center;
  flex: 0 0 auto;
  white-space: nowrap;
}

.segmented-option small {
  font-size: inherit;
}

.segmented-option {
  display: inline-flex;
  min-height: 2.45rem;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.72);
  padding: 0.5rem 0.75rem;
  color: #0f172a;
  font-size: 0.9rem;
  cursor: pointer;
}

.delimiter-group .segmented-option {
  min-width: 2.45rem;
  justify-content: center;
  padding-left: 0.6rem;
  padding-right: 0.6rem;
}

.source-toolbar .segmented-option {
  min-height: 1.9rem;
  padding: 0.22rem 0.48rem;
  font-size: 0.92rem;
  font-weight: 700;
}

.source-toolbar .source-class-delimiter-label {
  font-size: 0.92rem;
  font-weight: 700;
}

.source-toolbar .delimiter-group .segmented-option {
  min-width: 1.9rem;
  padding-left: 0.42rem;
  padding-right: 0.42rem;
}

/* В компактном переключателе оставляем радиокнопки доступными для клавиатуры,
   но показываем только визуальный сегмент, как в переключателях классов. */
.source-toolbar .segmented-option {
  position: relative;
}

.source-toolbar .segmented-option input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.source-toolbar .segmented-option:has(input:focus-visible) {
  outline: 2px solid var(--tool-accent);
  outline-offset: 2px;
}

.segmented-option:has(input:checked) {
  border-color: var(--tool-accent);
  background: rgba(204, 251, 241, 0.6);
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.professional-mode {
  margin-top: 1rem;
  border: 1px solid var(--tool-border);
  border-radius: 0.9rem;
  background: rgba(240, 253, 250, 0.5);
  padding: 1rem;
}

.professional-mode__entry {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

@media (min-width: 720px) {
  .professional-mode__entry {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

.tool-btn {
  border: 0;
  border-radius: 0.75rem;
  padding: 0.64rem 0.95rem;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.tool-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.tool-btn--primary {
  background: linear-gradient(145deg, var(--tool-accent), #0d9488);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(13, 148, 136, 0.26);
}

.tool-btn--ghost {
  background: rgba(255, 255, 255, 0.76);
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.38);
}

.tool-btn--small {
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
}

.tool-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 999px;
  padding: 0.32rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tool-status--idle {
  background: #e2e8f0;
  color: #334155;
}

.tool-status--loading {
  background: #dbeafe;
  color: #1e40af;
}

.tool-status--ok {
  background: #dcfce7;
  color: #166534;
}

.tool-status--error {
  background: #fee2e2;
  color: var(--tool-danger);
}

.tool-error-text,
.tool-warning-text {
  margin: 0.55rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.tool-error-text {
  color: var(--tool-danger);
}

.tool-warning-text {
  color: var(--tool-warning);
}

.tool-tooltip {
  position: relative;
  display: inline-flex;
}

.tool-tooltip[data-tooltip=""]::after {
  display: none;
}

.tool-tooltip:not([data-tooltip=""]):hover::after,
.tool-tooltip:not([data-tooltip=""]):focus-visible::after {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.45rem);
  left: 0;
  width: max-content;
  max-width: min(20rem, calc(100vw - 2rem));
  border-radius: 0.75rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.45rem 0.65rem;
  content: attr(data-tooltip);
  font-size: 0.78rem;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
}

.result-top-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.result-top-grid .result-summary-column {
  display: grid;
  gap: 0.75rem;
  order: 1;
  min-width: 0;
}

.result-top-grid .fee-column {
  display: grid;
  gap: 1rem;
  order: 2;
  min-width: 0;
}

@media (min-width: 900px) {
  .result-top-grid {
    grid-template-columns: minmax(16rem, 0.72fr) minmax(24rem, 1.65fr);
    align-items: stretch;
  }

  .result-top-grid .result-summary-column {
    align-self: stretch;
  }

  .result-top-grid .fee-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .result-top-grid .fee-panel {
    height: 100%;
  }

  .result-top-grid .summary-panel {
    height: 100%;
  }
}

.summary-panel {
  min-width: 0;
  border: 1px solid var(--tool-border);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.52), rgba(255, 255, 255, 0.94));
  padding: 1rem;
}

.summary-grid {
  display: grid;
  gap: 0.2rem;
  margin: 0.75rem 0 0;
}

.summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.22rem 0;
  border-radius: 0.65rem;
  background: rgba(248, 250, 252, 0.82);
}

.summary-row dt,
.summary-row dd {
  margin: 0;
}

.summary-row dt {
  min-width: 0;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.2;
}

.summary-row dd {
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
}

.summary-row--class-list {
  align-items: start;
}

.class-number-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
  margin: 0.45rem 0 0;
}

.class-number-chip {
  display: inline-flex;
  min-width: 2.4rem;
  justify-content: center;
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-radius: 0.65rem;
  background: #fee2e2;
  color: #991b1b;
  padding: 0.28rem 0.52rem;
  font-weight: 800;
  line-height: 1.1;
}

.class-number-chip--saved {
  border-color: rgba(22, 163, 74, 0.3);
  background: #dcfce7;
  color: #166534;
}

.class-number-empty {
  color: #64748b;
}

.diagnostic-number {
  border-radius: 0.2rem;
  background: rgba(248, 113, 113, 0.18);
  color: #b91c1c;
  padding: 0 0.15rem;
  font-weight: 800;
}

.diagnostic-latin {
  border-radius: 0.2rem;
  background: #fef3c7;
  color: #92400e;
  padding: 0 0.15rem;
  font-weight: 800;
}

.diagnostic-ignore-btn {
  margin-left: 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: 0.45rem;
  background: #fff;
  color: #475569;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.diagnostic-ignore-btn:hover,
.diagnostic-ignore-btn:focus-visible {
  border-color: var(--tool-accent);
  color: var(--tool-accent-strong);
}

.diagnostic-item--ignored {
  opacity: 0.78;
}

.diagnostic-show-btn {
  margin-left: 0.35rem;
  border: 1px solid rgba(15, 118, 110, 0.45);
  border-radius: 0.45rem;
  background: #ecfeff;
  color: #0f766e;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  cursor: pointer;
}

.diagnostic-show-btn:hover,
.diagnostic-show-btn:focus-visible {
  border-color: #0f766e;
  background: #ccfbf1;
}

.tool-input--source::selection {
  background: #fde68a;
  color: #7f1d1d;
}

.tool-input--source {
  user-select: text;
  -webkit-user-select: text;
}

/* При диагностическом переходе слово рисует overlay; нативное выделение
   textarea оставляем прозрачным, чтобы два слоя не накладывались. */
.source-input-shell--diagnostic-focus .tool-input--source::selection {
  background: transparent;
  color: transparent;
}

.result-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.result-lifehacks {
  margin-top: 1rem;
  border: 1px solid rgba(15, 118, 110, 0.3);
  border-radius: 0.9rem;
  background: rgba(236, 254, 255, 0.66);
  padding: 1rem;
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.45;
}

.result-lifehacks p {
  margin: 0.5rem 0 0;
}

.result-lifehacks__content--collapsed {
  max-height: calc(1.45em * 3 + 0.5rem);
  overflow: hidden;
  position: relative;
}

.result-lifehacks__content--collapsed::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2rem;
  background: linear-gradient(to bottom, rgba(236, 254, 255, 0), rgba(236, 254, 255, 1));
  pointer-events: none;
}

.result-lifehacks__toggle {
  margin-top: 0.65rem;
  font-size: 0.8rem;
}

.result-lifehacks__list {
  display: grid;
  gap: 0.55rem;
  margin: 0.7rem 0 0;
  padding-left: 1.35rem;
}

.result-lifehacks__list ul {
  display: grid;
  gap: 0.35rem;
  margin: 0.45rem 0 0;
  padding-left: 1.15rem;
}

.result-lifehacks a.external-link {
  white-space: nowrap;
}

.result-lifehacks a.external-link .external-arrow {
  margin-left: 0.25em;
  font-size: 0.85em;
  line-height: 1.2;
}

@media (min-width: 980px) {
  .result-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.result-panel {
  min-width: 0;
  border: 1px solid var(--tool-border);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.55), rgba(255, 255, 255, 0.92));
  padding: 1rem;
}

.result-panel > .tool-card-head {
  align-items: center;
}

.diagnostics-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

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

@media (min-width: 840px) {
  .diagnostics-grid--result {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fee-panel {
  min-width: 0;
  border: 1px solid var(--tool-border);
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.52), rgba(255, 255, 255, 0.94));
  padding: 1rem;
}

.fee-grid {
  display: grid;
  gap: 0.2rem;
  margin: 0.75rem 0 0;
}

.fee-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.22rem 0;
  border-radius: 0.65rem;
  background: rgba(248, 250, 252, 0.82);
}

.fee-row dt,
.fee-row dd {
  margin: 0;
}

.fee-row dt {
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.2;
}

.fee-row dd {
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: right;
}

.fee-row--total {
  background: rgba(204, 251, 241, 0.72);
}

.fee-row--total dd {
  font-size: 0.92rem;
}

.fee-reference {
  margin-top: 0;
  padding-top: 1rem;
}

.fee-reference__title {
  margin: 0;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.35;
}

.fee-reference__case {
  margin-top: 0.7rem;
  border-left: 3px solid rgba(15, 118, 110, 0.45);
  border-radius: 0.35rem;
  background: rgba(248, 250, 252, 0.82);
  padding: 0.65rem 0.75rem;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.45;
}

.fee-reference__case p {
  margin: 0;
}

.fee-reference__case p + p {
  margin-top: 0.55rem;
}

.fee-reference__condition {
  color: #0f172a;
  font-weight: 800;
}

.fee-reference__amount {
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
}

.tool-list {
  margin: 0.55rem 0 0;
  padding-left: 0;
  list-style: none;
  color: #0f172a;
  font-size: 0.88rem;
  line-height: 1.45;
}

.result-errors-list:not([hidden]) {
  margin-top: 0.65rem;
  border: 1px solid rgba(220, 38, 38, 0.3);
  border-radius: 0.65rem;
  background: rgba(254, 226, 226, 0.7);
  padding: 0.65rem 0.75rem;
}

.tool-list:empty {
  margin-top: 0;
}

.tool-list--error {
  color: var(--tool-danger);
}

.tool-list--warning {
  color: var(--tool-warning);
}

.term-preview {
  margin: 0.28rem 0 0;
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  main.relative,
  header.relative,
  footer.relative {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .tool-card-head {
    display: grid;
  }

  .tool-btn {
    width: 100%;
  }

  .tool-btn--small {
    width: auto;
  }

  .segmented-option {
    width: 100%;
  }

  .source-toolbar {
    align-items: stretch;
  }

  .source-toolbar .tool-actions,
  .source-toolbar .delimiter-group {
    margin-left: 0;
  }

  .source-toolbar .delimiter-group {
    width: 100%;
  }

  .source-class-mode {
    width: 100%;
    margin-left: 0;
  }

  .source-class-mode-btn {
    flex: 1 1 auto;
  }

  .source-class-actions {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .source-class-controls {
    align-items: flex-start;
  }

  .source-class-actions .tool-btn {
    width: auto;
  }
}

/* Единая семантика кнопок сервиса:
   белая — доступна, фиолетовая — выбрана/нажата, серая — недоступна. */
.tool-shell {
  --ui-action: #7657ff;
  --ui-action-strong: #5b3fd1;
  --ui-action-soft: #f0edff;
  --ui-action-border: #c9c0ff;
  --ui-disabled-bg: #f1f3f7;
  --ui-disabled-border: #d9dee8;
  --ui-disabled-text: #98a1b2;
}

.tool-shell .tool-btn,
.tool-shell .source-class-mode-btn,
.tool-shell .source-class-delimiter-btn,
.tool-shell .source-class-save-all,
.tool-shell .source-term-btn,
.tool-shell .source-term-join-btn,
.tool-shell .source-term-split-btn,
.tool-shell .segmented-option {
  border-color: #d1d7e2;
  background: #ffffff;
  color: #334155;
}

.tool-shell .tool-btn:hover,
.tool-shell .tool-btn:focus-visible,
.tool-shell .source-class-mode-btn:hover,
.tool-shell .source-class-mode-btn:focus-visible,
.tool-shell .source-class-delimiter-btn:hover,
.tool-shell .source-class-delimiter-btn:focus-visible,
.tool-shell .source-class-save-all:hover,
.tool-shell .source-class-save-all:focus-visible,
.tool-shell .source-term-btn:hover,
.tool-shell .source-term-btn:focus-visible,
.tool-shell .source-term-join-btn:hover,
.tool-shell .source-term-join-btn:focus-visible,
.tool-shell .source-term-split-btn:hover,
.tool-shell .source-term-split-btn:focus-visible,
.tool-shell .segmented-option:hover {
  border-color: var(--ui-action-border);
  background: var(--ui-action-soft);
  color: var(--ui-action-strong);
}

.tool-shell .tool-btn--primary,
.tool-shell .source-class-mode-btn[aria-pressed="true"],
.tool-shell .source-class-delimiter-btn[aria-pressed="true"],
.tool-shell .source-class-save-all[aria-pressed="true"],
.tool-shell .source-term-btn[aria-pressed="true"],
.tool-shell .segmented-option:has(input:checked) {
  border-color: var(--ui-action);
  background: var(--ui-action);
  color: #ffffff;
  box-shadow: 0 5px 14px rgba(118, 87, 255, 0.2);
}

.tool-shell .tool-btn--primary:hover,
.tool-shell .tool-btn--primary:focus-visible,
.tool-shell .source-class-mode-btn[aria-pressed="true"]:hover,
.tool-shell .source-class-delimiter-btn[aria-pressed="true"]:hover,
.tool-shell .source-class-save-all[aria-pressed="true"]:hover,
.tool-shell .source-term-btn[aria-pressed="true"]:hover,
.tool-shell .segmented-option:has(input:checked):hover {
  border-color: var(--ui-action-strong);
  background: var(--ui-action-strong);
  color: #ffffff;
}

.tool-shell .tool-btn:disabled,
.tool-shell .source-class-mode-btn:disabled,
.tool-shell .source-class-delimiter-btn:disabled,
.tool-shell .source-class-save-all:disabled,
.tool-shell .source-term-btn:disabled,
.tool-shell .source-term-join-btn:disabled,
.tool-shell .source-term-split-btn:disabled,
.tool-shell .segmented-option:has(input:disabled) {
  border-color: var(--ui-disabled-border);
  background: var(--ui-disabled-bg);
  color: var(--ui-disabled-text);
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}

.tool-shell .source-term-btn.source-term-btn--duplicate,
.tool-shell .source-term-btn.source-term-btn--duplicate[aria-pressed="true"] {
  border-color: #e5b85c;
  background: #fff8e6;
  color: #8a5a00;
}
.tool-shell .source-term-btn[aria-pressed="false"] {
  border-color: #d1d7e2;
  background: #ffffff;
  color: #334155;
  box-shadow: none;
}
/* Окончательно фиксируем нейтральное состояние поверх общих стилей сервисов. */
.tool-shell .tool-btn:not(.tool-btn--primary),
.tool-shell .source-class-mode-btn,
.tool-shell .source-class-delimiter-btn,
.tool-shell .source-class-save-all,
.tool-shell .source-term-btn[aria-pressed="false"],
.tool-shell .source-term-join-btn,
.tool-shell .source-term-split-btn,
.tool-shell .segmented-option {
  background: #ffffff;
  color: #334155;
}
.tool-shell button.tool-btn--ghost,
.tool-shell button.tool-btn--ghost:hover,
.tool-shell button.tool-btn--ghost:focus-visible {
  background: #ffffff;
  color: #334155;
  border-color: #d1d7e2;
}

/* WordPress service-shell: those controls inherit the shared violet button base. */
.vau-service-shell .tool-btn:not(.tool-btn--primary),
.vau-service-shell .source-class-mode-btn,
.vau-service-shell .source-class-delimiter-btn,
.vau-service-shell .source-class-save-all,
.vau-service-shell .source-term-btn[aria-pressed="false"],
.vau-service-shell .source-term-join-btn,
.vau-service-shell .source-term-split-btn,
.vau-service-shell .segmented-option {
  background: #fff;
  border-color: #d1d7e2;
  color: #334155;
}
.vau-service-shell .tool-btn:not(.tool-btn--primary):hover,
.vau-service-shell .tool-btn:not(.tool-btn--primary):focus-visible,
.vau-service-shell .source-class-mode-btn:hover,
.vau-service-shell .source-class-delimiter-btn:hover,
.vau-service-shell .source-class-save-all:hover,
.vau-service-shell .source-term-btn[aria-pressed="false"]:hover,
.vau-service-shell .source-term-join-btn:hover,
.vau-service-shell .source-term-split-btn:hover,
.vau-service-shell .segmented-option:hover {
  background: #f0edff;
  border-color: #c9c0ff;
  color: #5b3fd1;
}
.vau-service-shell .tool-btn--primary,
.vau-service-shell .source-class-mode-btn[aria-pressed="true"],
.vau-service-shell .source-class-delimiter-btn[aria-pressed="true"],
.vau-service-shell .source-class-save-all[aria-pressed="true"],
.vau-service-shell .source-term-btn[aria-pressed="true"],
.vau-service-shell .segmented-option:has(input:checked) {
  background: #7657ff;
  border-color: #7657ff;
  color: #fff;
  box-shadow: 0 5px 14px rgba(118, 87, 255, .2);
}
.vau-service-shell .tool-btn:disabled,
.vau-service-shell .source-class-mode-btn:disabled,
.vau-service-shell .source-class-delimiter-btn:disabled,
.vau-service-shell .source-class-save-all:disabled,
.vau-service-shell .source-term-btn:disabled,
.vau-service-shell .source-term-join-btn:disabled,
.vau-service-shell .source-term-split-btn:disabled,
.vau-service-shell .segmented-option:has(input:disabled) {
  background: #f1f3f7;
  border-color: #d9dee8;
  color: #98a1b2;
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
}
.vau-service-shell .source-term-btn[aria-pressed="true"],
.vau-service-shell .source-term-btn[aria-pressed="true"]:hover,
.vau-service-shell .source-term-btn[aria-pressed="true"]:focus-visible {
  background: #7657ff;
  border-color: #7657ff;
  color: #fff;
}
/* Компактная кнопка склейки: знак «+» не должен занимать ширину текстовой кнопки. */
.vau-service-shell .source-term-join-btn {
  width: 2.55rem;
  min-width: 2.55rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}
.vau-service-shell .source-term-join-btn {
  width: 2rem;
  min-width: 2rem;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}
/* Перебиваем общий размер сервисных кнопок для компактного «+». */
.vau-service-shell .source-term-buttons .source-term-join-btn,
.vau-service-shell .source-term-buttons--stacked .source-term-join-btn {
  width: 2rem;
  min-width: 2rem;
  max-width: 2rem;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
}
/* Заголовок класса: номер и счётчик терминов оформлены единообразно. */
.vau-service-shell .source-class-title,
.vau-service-shell .source-class-number,
.vau-service-shell .source-class-selection-summary {
  font-size: 0.86rem;
  line-height: 1.35;
}

.vau-service-shell .source-class-number {
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}
/* Явное состояние переключателя режима: активная кнопка видна без наведения. */
.vau-service-shell .source-class-mode-btn {
  position: relative;
  min-width: 6.2rem;
  justify-content: center;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 70ms ease;
}

.vau-service-shell .source-class-mode-btn[aria-pressed="true"] {
  background: #7657ff;
  border-color: #5b3fd1;
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(34, 20, 108, 0.35), 0 5px 14px rgba(118, 87, 255, 0.22);
  font-weight: 800;
}

.vau-service-shell .source-class-mode-btn[aria-pressed="true"]::after {
  content: "✓";
  margin-left: 0.35rem;
  font-size: 0.8em;
  line-height: 1.2;
}

.vau-service-shell .source-class-mode-btn[aria-pressed="false"] {
  background: #fff;
  border-color: #d1d7e2;
  color: #475569;
  box-shadow: none;
  font-weight: 700;
}
/* Активный режим фиксируем отдельным классом и контрастной подписью. */
.vau-service-shell .source-class-mode-btn.is-active,
.vau-service-shell .source-class-mode-btn.is-active:hover,
.vau-service-shell .source-class-mode-btn.is-active:focus-visible {
  background: #7657ff;
  border: 2px solid #4f35c2;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(118, 87, 255, 0.22), 0 6px 16px rgba(118, 87, 255, 0.28);
  font-weight: 800;
}
.vau-service-shell .source-class-mode-btn.is-active::after {
  content: none;
}
/* После вставки данных кнопка анализа мягко привлекает внимание. */
.vau-service-shell #parseSourceBtn.needs-attention {
  border: 2px solid transparent;
  padding: calc(0.64rem - 1px) calc(0.95rem - 1px);
  background-image:
    linear-gradient(#7657ff, #7657ff),
    linear-gradient(110deg, rgba(255,255,255,.25), rgba(255,255,255,.95), rgba(255,255,255,.25));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  background-size: 100% 100%, 260% 100%;
  background-position: 0 0, 0% 0;
  animation: parseSourceAttention 3.1s ease-in-out infinite;
  box-shadow: 0 0 0 3px rgba(118,87,255,.18), 0 8px 22px rgba(118,87,255,.28);
}

@keyframes parseSourceAttention {
  0%, 100% { background-position: 0 0, 0% 0; }
  50% { background-position: 0 0, 100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .vau-service-shell #parseSourceBtn.needs-attention {
    animation: none;
    background-position: 0 0, 50% 0;
  }
}
.vau-service-shell #parseSourceBtn.needs-attention {
  animation: parseSourcePulse 1.55s ease-in-out infinite;
}

@keyframes parseSourcePulse {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(118, 87, 255, 0.05), 0 8px 22px rgba(118, 87, 255, 0.22);
  }
  50% {
    transform: translateY(-2px);
    box-shadow: 0 0 0 7px rgba(118, 87, 255, 0.22), 0 12px 28px rgba(118, 87, 255, 0.38);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vau-service-shell #parseSourceBtn.needs-attention {
    animation: none;
  }
}

/* Separate recommendations and highlight the notice in lifehacks. */
.tool-shell #department42-notes { margin-top: 2.25rem; position: relative; }
.result-lifehacks .department42-notes__notice { border-left: 3px solid #7657ff; background: #ede9fe; color: #5b21b6; font-weight: 600; padding: .55rem .75rem; }

.return-to-classes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.return-to-classes__label {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
  margin-right: 0.1rem;
}

.return-to-classes__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  padding: 0.64rem 0.95rem;
  border: 1px solid #7657ff;
  border-radius: 0.75rem;
  background: #7657ff;
  color: #fff;
  box-shadow: 0 5px 14px rgba(118, 87, 255, 0.2);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.return-to-classes__link:hover,
.return-to-classes__link:focus-visible {
  border-color: #5b43d6;
  background: #5b43d6;
  color: #fff;
}

/* Return links stay readable in both the selection and result states. */
.vau-service-shell .return-to-classes__label {
  color: #334155;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

.vau-service-shell .return-to-classes__link,
.vau-service-shell .return-to-classes__link:hover,
.vau-service-shell .return-to-classes__link:focus-visible {
  background: #7657ff;
  border-color: #7657ff;
  color: #ffffff;
}

.tool-shell .return-to-classes__label { color: #334155; font-size: 0.92rem; font-weight: 700; }
.tool-shell .return-to-classes__link,
.tool-shell .return-to-classes__link:hover,
.tool-shell .return-to-classes__link:focus-visible { background: #7657ff; border-color: #7657ff; color: #ffffff; }

.full-removal-actions {
  align-items: center;
}

.full-removal-actions .return-to-classes {
  margin-top: 0;
}

.full-removal-confirmation h4 .full-removal-confirmation__classes {
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.department42-notes__content--collapsed {
  max-height: calc(1.45em * 5 + 0.75rem);
  overflow: hidden;
  position: relative;
}

.department42-notes__content--collapsed::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2.25rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff);
  pointer-events: none;
}

.department42-notes__toggle {
  margin-top: 0.75rem;
}

#department42-notes {
  margin-top: 1rem;
}

.mktu-instructions h3 { margin: 0 0 .5rem; font-size: 1rem; font-weight: 700; }
.mktu-instructions ol { list-style: decimal; margin: 0; padding-left: 1.4rem; color: #475569; line-height: 1.5; }
.mktu-instructions li + li { margin-top: .25rem; }

/* Shared typography, spacing and emphasis for both guidance cards. */
.vau-service-shell .result-lifehacks,
.vau-service-shell #department42-notes {
  padding: 1rem;
  border: 1px solid rgba(15, 118, 110, .3);
  border-radius: .9rem;
  background: rgba(236, 254, 255, .66);
  color: #334155;
  font-size: .88rem;
  line-height: 1.45;
  box-shadow: none;
}
.vau-service-shell #lifehacksTitle,
.vau-service-shell #department42-notes-title {
  margin: 0 0 .5rem;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.35;
  color: #334155;
}
.vau-service-shell #lifehacksContent p,
.vau-service-shell #department42Content p {
  margin: .5rem 0 0;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}
.vau-service-shell #lifehacksContent strong,
.vau-service-shell #department42Content strong { font-weight: 700; }
.vau-service-shell #department42Content h4 {
  margin: .85rem 0 .35rem;
  font-size: .88rem;
  line-height: 1.45;
  font-weight: 700;
  color: #334155;
}
.vau-service-shell #department42Content ul {
  margin: .45rem 0 0;
  padding-left: 1.35rem;
  list-style: disc;
}
.vau-service-shell #department42Content li { margin: .35rem 0 0; }
.vau-service-shell #lifehacksContent .department42-notes__notice,
.vau-service-shell #department42Content .warning {
  margin-top: .5rem;
  padding: .55rem .75rem;
  border-left: 3px solid #7657ff;
  background: #ede9fe;
  color: #5b21b6;
  font-weight: 700;
}
.vau-service-shell #toggleLifehacksBtn,
.vau-service-shell #toggleDepartment42Btn { margin-top: .65rem; font-size: .8rem; }
.vau-service-shell .department42-notes__content--collapsed {
  max-height: calc(1.45em * 3 + .5rem);
}
.vau-service-shell .department42-notes__content--collapsed::after {
  height: 2rem;
  background: linear-gradient(to bottom, rgba(236,254,255,0), rgba(236,254,255,1));
}
