:root {
  --tckb-bg: #f4f7fb;
  --tckb-surface: #ffffff;
  --tckb-surface-soft: #f8fafc;
  --tckb-text: #172033;
  --tckb-muted: #64748b;
  --tckb-border: #e2e8f0;
  --tckb-accent: #2f7df6;
  --tckb-accent-dark: #1458c8;
  --tckb-green: #15a46e;
  --tckb-red: #e34b4b;
  --tckb-yellow-bg: #fff8e6;
  --tckb-yellow-border: #f2c94c;
  --tckb-radius: 18px;
  --tckb-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
}

.tckb-app-body {
  margin: 0;
  background: var(--tckb-bg);
}

.tckb,
.tckb * {
  box-sizing: border-box;
}

.tckb {
  color: var(--tckb-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
  background: var(--tckb-bg);
  padding: 24px;
  border-radius: 20px;
}

.tckb--app {
  min-height: 100vh;
  border-radius: 0;
}

.tckb h1,
.tckb h2,
.tckb h3 {
  margin-top: 0;
  line-height: 1.2;
}

.tckb-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  gap: 24px;
  align-items: stretch;
  background: linear-gradient(135deg, #0f2d52, #2867db);
  color: #fff;
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--tckb-shadow);
}

.tckb-kicker {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  font-size: 13px;
  margin-bottom: 12px;
}

.tckb-hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  margin-bottom: 12px;
}

.tckb-hero p {
  margin: 0;
  max-width: 820px;
  color: rgba(255,255,255,.86);
  font-size: 17px;
}

.tckb-hero__schema {
  display: grid;
  gap: 9px;
  align-content: center;
}

.tckb-hero__schema span {
  display: block;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
}

.tckb-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin: 22px 0;
}

.tckb-search input {
  width: 100%;
  border: 1px solid var(--tckb-border);
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  background: #fff;
  box-shadow: 0 6px 22px rgba(15,23,42,.05);
}

.tckb-filters,
.tckb-sidebar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tckb-filters button,
.tckb-sidebar button,
.tckb-role-card,
.tckb-card button,
.tckb-back {
  cursor: pointer;
  border: 1px solid var(--tckb-border);
  background: #fff;
  color: var(--tckb-text);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, color .12s ease;
}

.tckb-filters button:hover,
.tckb-sidebar button:hover,
.tckb-card button:hover,
.tckb-back:hover {
  transform: translateY(-1px);
  border-color: var(--tckb-accent);
}

.tckb-filters button.is-active,
.tckb-sidebar button.is-active {
  background: var(--tckb-accent);
  border-color: var(--tckb-accent);
  color: #fff;
}

.tckb-role-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.tckb-role-card {
  text-align: left;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
}

.tckb-role-card strong {
  display: block;
  font-size: 20px;
  margin-bottom: 6px;
}

.tckb-role-card span {
  display: block;
  color: var(--tckb-muted);
}

.tckb-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
}

.tckb-sidebar {
  align-content: flex-start;
  align-self: start;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--tckb-border);
  border-radius: var(--tckb-radius);
  padding: 18px;
  box-shadow: var(--tckb-shadow);
}

.tckb-sidebar h2 {
  font-size: 18px;
  margin-bottom: 10px;
}

.tckb-sidebar button {
  width: 100%;
  text-align: left;
  border-radius: 12px;
}

.tckb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.tckb-card {
  background: var(--tckb-surface);
  border: 1px solid var(--tckb-border);
  border-radius: var(--tckb-radius);
  padding: 20px;
  box-shadow: 0 10px 28px rgba(15,23,42,.06);
}

.tckb-card--featured {
  border-color: rgba(47,125,246,.35);
  box-shadow: 0 16px 36px rgba(47,125,246,.12);
}

.tckb-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tckb-card__tags span {
  display: inline-flex;
  padding: 4px 8px;
  background: #eef4ff;
  color: #1e5bc7;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tckb-card h3 {
  font-size: 21px;
  margin-bottom: 8px;
}

.tckb-card p {
  color: var(--tckb-muted);
  margin-bottom: 16px;
}

.tckb-card button {
  background: var(--tckb-accent);
  color: #fff;
  border-color: var(--tckb-accent);
  font-weight: 700;
}

.tckb-detail {
  background: #fff;
  border: 1px solid var(--tckb-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--tckb-shadow);
}

.tckb-back {
  margin-bottom: 18px;
}

.tckb-instruction__header {
  border-bottom: 1px solid var(--tckb-border);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.tckb-instruction__header h2 {
  font-size: clamp(26px, 3vw, 38px);
  margin-bottom: 8px;
}

.tckb-instruction__header p {
  margin: 0;
  color: var(--tckb-muted);
  font-size: 17px;
}

.tckb-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.tckb-meta-box {
  background: var(--tckb-surface-soft);
  border: 1px solid var(--tckb-border);
  border-radius: 16px;
  padding: 16px;
}

.tckb-meta-box h3 {
  font-size: 15px;
  color: var(--tckb-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}

.tckb-meta-box p:last-child {
  margin-bottom: 0;
}

.tckb-meta-box--important {
  background: var(--tckb-yellow-bg);
  border-color: var(--tckb-yellow-border);
}

.tckb-entry {
  font-size: 17px;
}

.tckb-entry h2 {
  font-size: 26px;
  margin-top: 30px;
  margin-bottom: 10px;
}

.tckb-entry table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  background: #fff;
  overflow: hidden;
  border-radius: 14px;
}

.tckb-entry th,
.tckb-entry td {
  border: 1px solid var(--tckb-border);
  padding: 12px;
  vertical-align: top;
}

.tckb-entry th {
  background: #f1f5f9;
  text-align: left;
}

.tckb-entry img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--tckb-border);
}

.tckb-notice {
  padding: 16px;
  border-radius: 16px;
  margin: 18px 0;
}

.tckb-notice-warning {
  background: var(--tckb-yellow-bg);
  border: 1px solid var(--tckb-yellow-border);
}

.tckb-screenshot-placeholder {
  border: 2px dashed #b6c7e1;
  background: #f8fbff;
  color: #506784;
  border-radius: 16px;
  padding: 22px;
  margin: 18px 0;
  font-weight: 700;
}

.tckb-empty {
  background: #fff;
  border: 1px dashed var(--tckb-border);
  border-radius: 18px;
  padding: 24px;
  text-align: center;
  color: var(--tckb-muted);
}

@media (max-width: 1100px) {
  .tckb-hero,
  .tckb-layout,
  .tckb-toolbar {
    grid-template-columns: 1fr;
  }
  .tckb-sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .tckb {
    padding: 14px;
  }
  .tckb-hero {
    padding: 22px;
    border-radius: 22px;
  }
  .tckb-role-cards,
  .tckb-grid,
  .tckb-meta-grid {
    grid-template-columns: 1fr;
  }
  .tckb-filters {
    overflow: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .tckb-filters button {
    white-space: nowrap;
  }
}

/* Real DOCX import styles */
.tckb-entry .tckb-doc-figure {
  margin: 20px 0 26px;
  padding: 12px;
  border: 1px solid var(--tckb-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15,23,42,.06);
}

.tckb-entry .tckb-doc-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #edf2f7;
  background: #fff;
}

.tckb-entry .tckb-doc-figure figcaption {
  margin-top: 8px;
  color: var(--tckb-muted);
  font-size: 13px;
}

.tckb-entry .tckb-source-list {
  position: relative;
  margin: 7px 0 7px 0;
  padding-left: 28px;
}

.tckb-entry .tckb-source-list--level-1 { margin-left: 22px; }
.tckb-entry .tckb-source-list--level-2 { margin-left: 44px; }
.tckb-entry .tckb-source-list--level-3 { margin-left: 66px; }

.tckb-entry .tckb-source-bullet {
  position: absolute;
  left: 8px;
  top: 0;
  color: var(--tckb-accent);
  font-weight: 800;
}

.tckb-entry .tckb-source-important {
  padding: 12px 14px;
  border-left: 4px solid var(--tckb-red);
  background: #fff5f5;
  border-radius: 12px;
}

.tckb-process-map {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.tckb-process-map span {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 999px;
  background: #eef5ff;
  border: 1px solid #cfe1ff;
  color: #154f9c;
  font-weight: 700;
}

.tckb-process-map span:not(:last-child)::after {
  content: '→';
  margin-left: 10px;
  color: var(--tckb-accent);
}

.tckb-entry .tckb-source-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

.tckb-entry .tckb-source-table td,
.tckb-entry .tckb-source-table th {
  border: 1px solid var(--tckb-border);
  padding: 10px;
  vertical-align: top;
}


/* UI fixes: role cards wrapping and screenshot lightbox */
.tckb-role-cards {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}

.tckb-role-card {
  width: 100%;
  min-width: 0;
  white-space: normal;
  overflow: hidden;
  text-align: center;
}

.tckb-role-card strong,
.tckb-role-card span {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.tckb-role-card span {
  line-height: 1.35;
}

.tckb-entry img,
.tckb-featured-image img {
  cursor: zoom-in;
}

.tckb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(15, 23, 42, .82);
}

.tckb-lightbox.is-open {
  display: flex;
}

.tckb-lightbox__dialog {
  position: relative;
  max-width: min(1200px, 96vw);
  max-height: 92vh;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  padding: 14px;
}

.tckb-lightbox__img {
  display: block;
  max-width: calc(96vw - 28px);
  max-height: calc(92vh - 28px);
  width: auto;
  height: auto;
  border-radius: 12px;
}

.tckb-lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #172033;
  font-size: 26px;
  line-height: 38px;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(0,0,0,.25);
}

@media (max-width: 760px) {
  .tckb-role-cards {
    grid-template-columns: 1fr;
  }
  .tckb-lightbox {
    padding: 12px;
  }
  .tckb-lightbox__dialog {
    max-width: 98vw;
    padding: 8px;
  }
  .tckb-lightbox__img {
    max-width: calc(98vw - 16px);
    max-height: calc(94vh - 16px);
  }
}


/* v0.2.2 hard fixes: wrapping role cards in iframe and robust image enlargement */
.tckb .tckb-role-cards {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
  gap: 16px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.tckb .tckb-role-card,
.tckb button.tckb-role-card {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 86px !important;
  padding: 16px 18px !important;
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  text-align: center !important;
  line-height: 1.35 !important;
}

.tckb .tckb-role-card *,
.tckb .tckb-role-card strong,
.tckb .tckb-role-card span {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.35 !important;
}

.tckb .tckb-role-card strong {
  margin-bottom: 7px !important;
}

.tckb .tckb-role-card span {
  font-size: 14px !important;
}

.tckb .tckb-entry img,
.tckb .tckb-featured-image img,
.tckb .tckb-doc-figure img {
  cursor: zoom-in !important;
}

.tckb-lightbox {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 28px !important;
  background: rgba(15, 23, 42, .84) !important;
}

.tckb-lightbox.is-open {
  display: flex !important;
}

.tckb-lightbox__dialog {
  position: relative !important;
  max-width: min(1300px, 96vw) !important;
  max-height: 92vh !important;
  background: #fff !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 80px rgba(0,0,0,.38) !important;
  padding: 14px !important;
}

.tckb-lightbox__img {
  display: block !important;
  max-width: calc(96vw - 28px) !important;
  max-height: calc(92vh - 28px) !important;
  width: auto !important;
  height: auto !important;
  border-radius: 12px !important;
}

.tckb-lightbox__close {
  position: absolute !important;
  top: -14px !important;
  right: -14px !important;
  width: 38px !important;
  height: 38px !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #172033 !important;
  font-size: 28px !important;
  line-height: 38px !important;
  cursor: pointer !important;
  box-shadow: 0 8px 26px rgba(0,0,0,.25) !important;
}


/* v0.2.3 lightbox containment fix: screenshots never exceed viewport/modal */
.tckb-lightbox.is-open {
  display: flex !important;
}

.tckb-lightbox {
  overflow: hidden !important;
  padding: 22px !important;
}

.tckb-lightbox__dialog {
  width: calc(100vw - 44px) !important;
  height: calc(100vh - 44px) !important;
  max-width: 1500px !important;
  max-height: calc(100vh - 44px) !important;
  padding: 14px !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.tckb-lightbox__img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 12px !important;
}

.tckb-lightbox__close {
  z-index: 2 !important;
}

@media (max-width: 760px) {
  .tckb-lightbox {
    padding: 10px !important;
  }
  .tckb-lightbox__dialog {
    width: calc(100vw - 20px) !important;
    height: calc(100vh - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    padding: 8px !important;
  }
}

/* v0.2.4 lightbox fix: modal follows screenshot proportions, no oversized white canvas */
.tckb-lightbox {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  overflow: hidden !important;
  background: rgba(15, 23, 42, .84) !important;
}

.tckb-lightbox.is-open {
  display: flex !important;
}

.tckb-lightbox__dialog {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: calc(100vw - 64px) !important;
  max-height: calc(100vh - 64px) !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

.tckb-lightbox__img {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: calc(100vw - 64px) !important;
  max-height: calc(100vh - 64px) !important;
  object-fit: contain !important;
  object-position: center center !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 24px 80px rgba(0,0,0,.38) !important;
}

.tckb-lightbox__close {
  position: fixed !important;
  top: 16px !important;
  right: 16px !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #172033 !important;
  font-size: 28px !important;
  line-height: 1 !important;
  font-weight: 400 !important;
  cursor: pointer !important;
  box-shadow: 0 8px 26px rgba(0,0,0,.28) !important;
  z-index: 2147483647 !important;
}

@media (max-width: 760px) {
  .tckb-lightbox {
    padding: 10px !important;
  }
  .tckb-lightbox__dialog,
  .tckb-lightbox__img {
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 24px) !important;
  }
  .tckb-lightbox__close {
    top: 10px !important;
    right: 10px !important;
  }
}

/* v0.3.0 visual process map */
.tckb-hero__actions {
  margin-top: 18px;
}

.tckb-hero__button {
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.14);
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.tckb-hero__button:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.2);
  border-color: rgba(255,255,255,.4);
}

.tckb-map-view {
  background: #fff;
  border: 1px solid var(--tckb-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--tckb-shadow);
}

.tckb-map-page__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.tckb-map-page__header h2 {
  font-size: clamp(24px, 3vw, 38px);
  margin-bottom: 10px;
}

.tckb-map-page__header p {
  margin: 0;
  color: var(--tckb-muted);
  max-width: 900px;
}

.tckb-map-page__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: center;
  justify-content: flex-end;
}

.tckb-map-legend__item {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--tckb-border);
  background: #f8fafc;
  color: var(--tckb-text);
}

.tckb-map-legend__item.is-main { background: #e9f2ff; color: #154f9c; border-color: #bfd8ff; }
.tckb-map-legend__item.is-sub { background: #eefbf5; color: #0f7a52; border-color: #bee8d2; }
.tckb-map-legend__item.is-ref { background: #fff6ea; color: #9a5a0f; border-color: #f7d7a6; }

.tckb-map-group {
  border: 1px solid var(--tckb-border);
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.tckb-map-group__header {
  margin-bottom: 14px;
}

.tckb-map-group__header h3 {
  margin-bottom: 6px;
  font-size: 21px;
}

.tckb-map-group__header p {
  margin: 0;
  color: var(--tckb-muted);
}

.tckb-map-lines {
  display: grid;
  gap: 14px;
}

.tckb-map-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tckb-map-arrow {
  flex: 0 0 auto;
  color: var(--tckb-accent);
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
}

.tckb-map-node {
  flex: 1 1 220px;
  min-width: 220px;
  border: 1px solid var(--tckb-border);
  border-radius: 18px;
  background: #fff;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  box-shadow: 0 10px 24px rgba(15,23,42,.05);
}

.tckb-map-node:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15,23,42,.08);
}

.tckb-map-node--main {
  border-color: #bfd8ff;
  background: linear-gradient(180deg, #eef5ff 0%, #ffffff 100%);
}

.tckb-map-node--sub,
.tckb-map-node--result {
  border-color: #bee8d2;
  background: linear-gradient(180deg, #f2fcf6 0%, #ffffff 100%);
}

.tckb-map-group:last-child .tckb-map-node,
.tckb-map-node[data-tckb-open-slug*='chatbot'],
.tckb-map-node[data-tckb-open-slug*='card'],
.tckb-map-node[data-tckb-open-slug*='access'],
.tckb-map-node[data-tckb-open-slug*='entity'] {
  border-color: #f5d5a8;
  background: linear-gradient(180deg, #fff8ef 0%, #ffffff 100%);
}

.tckb-map-node__title {
  display: block;
  font-weight: 800;
  line-height: 1.3;
}

.tckb-map-node__meta {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--tckb-muted);
}

@media (max-width: 1100px) {
  .tckb-map-page__header {
    grid-template-columns: 1fr;
  }
  .tckb-map-page__legend {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .tckb-map-view {
    padding: 16px;
    border-radius: 18px;
  }
  .tckb-map-line {
    flex-direction: column;
    align-items: stretch;
  }
  .tckb-map-arrow {
    transform: rotate(90deg);
    align-self: center;
  }
  .tckb-map-node {
    min-width: 0;
    width: 100%;
  }
}

/* v0.4.0 enhanced visual map */
.tckb-svg-overview-wrap {
  margin-bottom: 22px;
  padding: 18px;
  border: 1px solid var(--tckb-border);
  border-radius: 24px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.tckb-svg-overview-header {
  margin-bottom: 14px;
}

.tckb-svg-overview-header h3 {
  font-size: 22px;
  margin-bottom: 6px;
}

.tckb-svg-overview-header p {
  margin: 0;
  color: var(--tckb-muted);
}

.tckb-svg-overview {
  width: 100%;
  height: auto;
  display: block;
}

.tckb-svg-link {
  stroke: #9bb4d6;
  stroke-width: 4;
  stroke-linecap: round;
}

.tckb-svg-node {
  cursor: pointer;
  transition: transform .12s ease;
  transform-origin: center center;
}

.tckb-svg-node:hover,
.tckb-svg-node:focus {
  transform: translateY(-2px);
  outline: none;
}

.tckb-svg-node rect {
  stroke-width: 2;
}

.tckb-svg-node text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 22px;
  font-weight: 800;
  dominant-baseline: middle;
  fill: #17324f;
}

.tckb-svg-node--main rect {
  fill: #e9f2ff;
  stroke: #8fb8ff;
}

.tckb-svg-node--sub rect {
  fill: #eefbf5;
  stroke: #7fd0a1;
}

.tckb-svg-node--ref rect {
  fill: #fff4e7;
  stroke: #f1c17c;
}

.tckb-map-node {
  position: relative;
}

.tckb-map-node--main {
  border-color: #8fb8ff;
  background: linear-gradient(180deg, #e9f2ff 0%, #ffffff 100%);
}

.tckb-map-node--sub,
.tckb-map-node--result {
  border-color: #7fd0a1;
  background: linear-gradient(180deg, #eefbf5 0%, #ffffff 100%);
}

.tckb-map-node--ref {
  border-color: #f1c17c;
  background: linear-gradient(180deg, #fff4e7 0%, #ffffff 100%);
}

.tckb-map-node[data-tooltip]:hover::after,
.tckb-map-node[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  width: min(320px, 80vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(23, 32, 51, 0.96);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(15,23,42,.22);
  z-index: 20;
  text-align: left;
  pointer-events: none;
}

.tckb-map-node[data-tooltip]:hover::before,
.tckb-map-node[data-tooltip]:focus-visible::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border-width: 8px 8px 0 8px;
  border-style: solid;
  border-color: rgba(23, 32, 51, 0.96) transparent transparent transparent;
  z-index: 20;
  pointer-events: none;
}

@media (max-width: 900px) {
  .tckb-svg-overview-wrap {
    padding: 14px;
  }
  .tckb-svg-node text {
    font-size: 18px;
  }
}

@media (max-width: 640px) {
  .tckb-svg-overview {
    min-height: 420px;
  }
  .tckb-map-node[data-tooltip]:hover::after,
  .tckb-map-node[data-tooltip]:focus-visible::after,
  .tckb-map-node[data-tooltip]:hover::before,
  .tckb-map-node[data-tooltip]:focus-visible::before {
    display: none;
  }
}

/* v0.4.1 process-map polish: calmer visuals, no overflow, better wrapping */
.tckb-map-group {
  padding: 22px;
  border-radius: 26px;
  background: #fff;
  border: 1px solid #e7edf5;
  box-shadow: 0 12px 28px rgba(15,23,42,.05);
}

.tckb-map-group__header h3 {
  font-size: 18px;
  color: #22324a;
  margin-bottom: 4px;
}

.tckb-map-group__header p {
  font-size: 14px;
}

.tckb-map-lines {
  gap: 12px;
}

.tckb-map-line {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: stretch;
}

.tckb-map-arrow {
  display: none;
}

.tckb-map-node {
  min-width: 0;
  width: 100%;
  padding: 16px 18px 14px;
  border-radius: 18px;
  border: 1px solid #d9e3ef;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15,23,42,.04);
  overflow: hidden;
}

.tckb-map-node::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 18px 0 0 18px;
  background: #8fb8ff;
}

.tckb-map-node--sub::after,
.tckb-map-node--result::after {
  background: #7fd0a1;
}

.tckb-map-node--ref::after {
  background: #f1c17c;
}

.tckb-map-node--main {
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  border-color: #cfe0f7;
}

.tckb-map-node--sub,
.tckb-map-node--result {
  background: linear-gradient(180deg, #f7fcf9 0%, #ffffff 100%);
  border-color: #cfe7d8;
}

.tckb-map-node--ref {
  background: linear-gradient(180deg, #fffaf3 0%, #ffffff 100%);
  border-color: #f0dcc0;
}

.tckb-map-node__step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2a65c7;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .03em;
}

.tckb-map-node--sub .tckb-map-node__step,
.tckb-map-node--result .tckb-map-node__step {
  background: #ecf9f1;
  color: #1b8b5c;
}

.tckb-map-node--ref .tckb-map-node__step {
  background: #fff3df;
  color: #b1701d;
}

.tckb-map-node__title {
  display: block;
  font-size: 18px;
  line-height: 1.28;
  color: #21324a;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: balance;
}

.tckb-map-node__meta {
  display: inline-flex;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(100,116,139,.08);
  color: #5b6b80;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tckb-map-node[data-tooltip]:hover::after,
.tckb-map-node[data-tooltip]:focus-visible::after {
  width: auto;
  inset: auto;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  max-width: min(320px, 80vw);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(23, 32, 51, 0.96);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(15,23,42,.22);
  z-index: 20;
  text-align: left;
  pointer-events: none;
}

.tckb-map-node[data-tooltip]:hover::before,
.tckb-map-node[data-tooltip]:focus-visible::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  border-width: 8px 8px 0 8px;
  border-style: solid;
  border-color: rgba(23, 32, 51, 0.96) transparent transparent transparent;
  z-index: 20;
  pointer-events: none;
}

.tckb-svg-overview-wrap {
  background: #fff;
  border: 1px solid #e7edf5;
  box-shadow: 0 12px 28px rgba(15,23,42,.05);
}

.tckb-svg-node text {
  fill: #203149;
}

@media (max-width: 960px) {
  .tckb-map-line {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .tckb-map-group {
    padding: 16px;
    border-radius: 20px;
  }
  .tckb-map-node {
    padding: 14px 15px 13px;
  }
  .tckb-map-node__title {
    font-size: 16px;
  }
}


/* v0.4.2 detailed map restyle: softer, cleaner, closer to SVG blocks */
.tckb-map-lines {
  gap: 10px;
}

.tckb-map-line {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.tckb-map-node {
  min-width: 0 !important;
  padding: 14px 16px 13px !important;
  border-radius: 16px !important;
  border: 1px solid #d8e4f3 !important;
  background: #f9fbfe !important;
  box-shadow: 0 6px 14px rgba(15,23,42,.04) !important;
  text-align: center !important;
}

.tckb-map-node::after {
  width: 0 !important;
  display: none !important;
}

.tckb-map-node--main {
  background: linear-gradient(180deg, #f3f8ff 0%, #fbfdff 100%) !important;
  border-color: #bfd5f3 !important;
}

.tckb-map-node--sub,
.tckb-map-node--result {
  background: linear-gradient(180deg, #f4fbf7 0%, #fbfefc 100%) !important;
  border-color: #b8ddc7 !important;
}

.tckb-map-node--ref {
  background: linear-gradient(180deg, #fff8ee 0%, #fffdf8 100%) !important;
  border-color: #ead0a2 !important;
}

.tckb-map-node__step {
  min-width: 28px !important;
  height: 28px !important;
  padding: 0 8px !important;
  margin: 0 auto 10px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.6) !important;
}

.tckb-map-node__title {
  font-size: 15px !important;
  line-height: 1.3 !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  color: #24364d !important;
  max-width: 100% !important;
}

.tckb-map-node__meta {
  display: inline-flex !important;
  justify-content: center !important;
  margin-top: 10px !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  background: rgba(148,163,184,.10) !important;
  color: #6b7a8f !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
}

.tckb-map-node:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 10px 18px rgba(15,23,42,.06) !important;
}

.tckb-map-group {
  padding: 20px !important;
}

@media (max-width: 960px) {
  .tckb-map-line {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 760px) {
  .tckb-map-group {
    padding: 14px !important;
  }
  .tckb-map-node {
    padding: 13px 14px 12px !important;
  }
  .tckb-map-node__title {
    font-size: 14px !important;
  }
}


/* v0.5.0 Bitrix24 app mode tweaks */
.tckb--app {
  padding: 18px;
}

.tckb--app .tckb-hero {
  border-radius: 22px;
}

.tckb--app .tckb-map-view {
  border-radius: 20px;
}

@media (max-width: 760px) {
  .tckb--app {
    padding: 10px;
  }
}


/* v0.5.1 Bitrix24 fallback: map can be visible without JavaScript */
.tckb [hidden] {
  display: none !important;
}


/* v0.5.3 cleanup, next button and hero button color */
.tckb-hero__button {
  background: #ffffff !important;
  color: #174076 !important;
  border-color: rgba(255,255,255,.92) !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.12) !important;
}

.tckb-hero__button:hover {
  background: #f4f8ff !important;
  color: #0f2d52 !important;
  border-color: #ffffff !important;
}

.tckb-next {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--tckb-border);
  display: flex;
  justify-content: flex-end;
}

.tckb-next__button {
  cursor: pointer;
  border: 1px solid #cfe0f7;
  background: linear-gradient(180deg, #f3f8ff 0%, #ffffff 100%);
  color: #21324a;
  border-radius: 18px;
  padding: 14px 18px;
  min-width: min(420px, 100%);
  text-align: left;
  box-shadow: 0 8px 18px rgba(15,23,42,.05);
  transition: transform .12s ease, box-shadow .12s ease;
}

.tckb-next__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15,23,42,.08);
}

.tckb-next__button span {
  display: block;
  margin-bottom: 5px;
  color: #2f7df6;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tckb-next__button strong {
  display: block;
  font-size: 17px;
  line-height: 1.3;
}


/* v0.5.4 cleanup phrases and stable next-button colors */
.tckb-next__button,
.tckb-next__button:visited,
.tckb-next__button:hover,
.tckb-next__button:focus,
.tckb-next__button:active {
  background: linear-gradient(180deg, #f3f8ff 0%, #ffffff 100%) !important;
  color: #21324a !important;
  border-color: #cfe0f7 !important;
}

.tckb-next__button:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 12px 24px rgba(15,23,42,.08) !important;
}

.tckb-next__button span,
.tckb-next__button:hover span,
.tckb-next__button:focus span,
.tckb-next__button:active span {
  color: #2f7df6 !important;
}

.tckb-next__button strong,
.tckb-next__button:hover strong,
.tckb-next__button:focus strong,
.tckb-next__button:active strong {
  color: #21324a !important;
}

/* v0.6.0 training mode */
.tckb-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tckb-hero__button--learn {
  background: #fff !important;
  color: #1554bd !important;
  border-color: #fff !important;
  box-shadow: 0 8px 24px rgba(15,23,42,.16);
}

.tckb-hero__button--learn:hover,
.tckb-hero__button--learn:focus {
  background: #f7fbff !important;
  color: #0f3f91 !important;
  border-color: #f7fbff !important;
}

.tckb-training-view {
  background: #fff;
  border: 1px solid var(--tckb-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--tckb-shadow);
}

.tckb-training__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.tckb-training__header h2 {
  font-size: clamp(25px, 3vw, 38px);
  margin-bottom: 8px;
}

.tckb-training__header p {
  margin: 0;
  color: var(--tckb-muted);
}

.tckb-training__progress {
  background: #f7faff;
  border: 1px solid #dce8f7;
  border-radius: 18px;
  padding: 16px;
}

.tckb-training__progress span {
  display: block;
  font-weight: 800;
  margin-bottom: 10px;
  color: #24364d;
}

.tckb-training__bar {
  height: 10px;
  background: #e9eef6;
  border-radius: 999px;
  overflow: hidden;
}

.tckb-training__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #2f7df6, #15a46e);
  border-radius: 999px;
  transition: width .25s ease;
}

.tckb-training-plan {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.tckb-training-plan__item {
  position: relative;
  text-align: left;
  border: 1px solid #dde7f3;
  background: #fbfdff;
  border-radius: 18px;
  padding: 16px;
  cursor: pointer;
  min-height: 128px;
  box-shadow: 0 8px 18px rgba(15,23,42,.04);
}

.tckb-training-plan__item strong {
  display: block;
  color: #24364d;
  font-size: 16px;
  line-height: 1.25;
  margin: 0 34px 8px 0;
}

.tckb-training-plan__item em {
  display: block;
  font-style: normal;
  color: var(--tckb-muted);
  font-size: 13px;
  line-height: 1.35;
}

.tckb-training-plan__check {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #edf2f7;
  color: transparent;
  font-weight: 900;
}

.tckb-training-plan__item.is-active {
  border-color: #8fb8ff;
  background: #f3f8ff;
}

.tckb-training-plan__item.is-complete .tckb-training-plan__check {
  background: #16a46f;
  color: #fff;
}

.tckb-training-lesson {
  border: 1px solid #e4ebf5;
  border-radius: 22px;
  padding: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.tckb-training-lesson__header {
  margin-bottom: 16px;
  border-bottom: 1px solid #e7eef7;
  padding-bottom: 14px;
}

.tckb-training-lesson__header span {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef5ff;
  color: #235cbd;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.tckb-training-lesson__header h3 {
  font-size: 25px;
  margin-bottom: 6px;
}

.tckb-training-lesson__header p {
  margin: 0;
  color: var(--tckb-muted);
}

.tckb-training-blocks {
  display: grid;
  gap: 12px;
}

.tckb-training-block {
  position: relative;
  padding: 18px 18px 18px 64px;
  border: 1px solid #dbe8f5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15,23,42,.04);
  animation: tckbTrainingIn .18s ease-out;
}

@keyframes tckbTrainingIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tckb-training-block.is-done {
  opacity: .72;
}

.tckb-training-block.is-current {
  border-color: #8fb8ff;
  box-shadow: 0 12px 26px rgba(47,125,246,.10);
}

.tckb-training-block__number {
  position: absolute;
  left: 18px;
  top: 18px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef5ff;
  color: #2d67c7;
  font-weight: 900;
  font-size: 12px;
}

.tckb-training-block h4 {
  margin: 0 0 8px;
  font-size: 19px;
  color: #24364d;
}

.tckb-training-block p {
  margin: 0 0 12px;
  color: var(--tckb-muted);
}

.tckb-training-subblocks {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.tckb-training-subblock {
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #edf2f7;
  color: #34445c;
  font-size: 15px;
}

.tckb-training-open-full {
  border: 0;
  background: transparent;
  color: #2f7df6;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}

.tckb-training-controls {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e7eef7;
}

.tckb-training-button {
  border: 1px solid #2f7df6;
  background: #2f7df6;
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 800;
}

.tckb-training-button:hover,
.tckb-training-button:focus {
  background: #195fdd;
  color: #fff;
}

.tckb-training-button--ghost {
  background: #fff;
  color: #2f7df6;
}

.tckb-training-button--ghost:hover,
.tckb-training-button--ghost:focus {
  background: #eef5ff;
  color: #195fdd;
}

@media (max-width: 1100px) {
  .tckb-training__header,
  .tckb-training-plan {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .tckb-training-view {
    padding: 15px;
  }
  .tckb-training__header,
  .tckb-training-plan {
    grid-template-columns: 1fr;
  }
  .tckb-training-block {
    padding: 58px 14px 14px;
  }
  .tckb-training-block__number {
    left: 14px;
    top: 14px;
  }
  .tckb-training-controls {
    justify-content: stretch;
  }
  .tckb-training-button {
    width: 100%;
  }
}

/* v0.6.1 training UX: each lesson opens as a separate sheet; full content with screenshots */
.tckb-training-plan {
  display: block !important;
  margin-top: 18px;
}

.tckb-training-plan__header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e7eef7;
}

.tckb-training-plan__header h3 {
  margin: 0 0 6px;
  font-size: 22px;
  color: #24364d;
}

.tckb-training-plan__header p {
  margin: 0;
  color: var(--tckb-muted);
}

.tckb-training-plan__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tckb-training-plan__item {
  position: relative;
  min-width: 0 !important;
  min-height: 160px;
  padding: 18px 56px 18px 18px !important;
  border-radius: 20px !important;
  text-align: left !important;
  overflow: hidden !important;
  white-space: normal !important;
}

.tckb-training-plan__item strong,
.tckb-training-plan__item em {
  width: 100%;
  max-width: 100%;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

.tckb-training-plan__item strong {
  font-size: 18px !important;
  line-height: 1.25 !important;
  margin: 8px 0 8px !important;
}

.tckb-training-plan__item em {
  display: block !important;
  font-size: 14px !important;
  line-height: 1.45 !important;
  color: #66758a !important;
  font-style: normal !important;
}

.tckb-training-plan__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #eef5ff;
  color: #2867db;
  font-weight: 900;
  font-size: 13px;
}

.tckb-training-plan__check {
  position: absolute !important;
  top: 18px !important;
  right: 18px !important;
}

.tckb-training-lessons {
  margin-top: 18px;
}

.tckb-training-lesson {
  border-radius: 26px !important;
  padding: 26px !important;
  background: #fff !important;
  border: 1px solid #dfe8f4 !important;
  box-shadow: 0 14px 32px rgba(15,23,42,.06) !important;
}

.tckb-training-lesson__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.tckb-training-block {
  padding: 22px 22px 22px 74px !important;
  border-radius: 22px !important;
}

.tckb-training-block__lead {
  font-size: 16px;
  color: #56667b !important;
  margin-bottom: 18px !important;
}

.tckb-training-full-content {
  color: #24364d;
  font-size: 16px;
  line-height: 1.62;
}

.tckb-training-full-content h2,
.tckb-training-full-content h3,
.tckb-training-full-content h4 {
  margin-top: 22px;
  margin-bottom: 10px;
  color: #21324a;
}

.tckb-training-full-content p {
  margin: 0 0 12px;
  color: #34445c;
}

.tckb-training-full-content .tckb-doc-figure {
  margin: 18px 0 22px;
  padding: 10px;
  border: 1px solid #e2eaf5;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15,23,42,.04);
}

.tckb-training-full-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  cursor: zoom-in;
}

.tckb-training-open-full {
  display: none !important;
}

@media (max-width: 1000px) {
  .tckb-training-plan__grid {
    grid-template-columns: 1fr;
  }
  .tckb-training-lesson__header {
    display: block;
  }
  .tckb-training-lesson__header .tckb-training-button {
    margin-top: 12px;
  }
}

@media (max-width: 760px) {
  .tckb-training-lesson {
    padding: 16px !important;
    border-radius: 20px !important;
  }
  .tckb-training-block {
    padding: 58px 14px 14px !important;
  }
}

/* v0.6.2 training: identity page, one-block pages, required confirmation */
.tckb-training-identity {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid #dce8f7;
  border-radius: 20px;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.tckb-training-identity label {
  display: block;
  margin-bottom: 10px;
  color: #24364d;
}

.tckb-training-identity__row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.tckb-training-identity input {
  flex: 1 1 auto;
  min-width: 220px;
  border: 1px solid #cfdced;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: #172033;
}

.tckb-training-identity p {
  margin: 10px 0 0;
  color: #7a8799;
  font-size: 13px;
}

.tckb-training-identity p.is-ok {
  color: #0f7a52;
  font-weight: 700;
}

.tckb-training-plan__item.is-locked {
  opacity: .55;
  cursor: not-allowed;
}

.tckb-training-block {
  min-height: 520px;
}

.tckb-training-controls {
  align-items: center;
}

.tckb-training-understood {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #dce8f7;
  color: #24364d;
  font-weight: 700;
  cursor: pointer;
}

.tckb-training-understood input {
  width: 18px;
  height: 18px;
  accent-color: #2f7df6;
}

.tckb-training-button:disabled,
.tckb-training-button[disabled] {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(.15);
  transform: none !important;
  box-shadow: none !important;
}

.tckb-training-button:disabled:hover,
.tckb-training-button[disabled]:hover {
  background: #2f7df6;
  color: #fff;
}

.tckb-training-button--ghost:disabled:hover,
.tckb-training-button--ghost[disabled]:hover {
  background: #fff;
  color: #2f7df6;
}

@media (max-width: 760px) {
  .tckb-training-identity__row {
    display: block;
  }
  .tckb-training-identity input,
  .tckb-training-identity .tckb-training-button {
    width: 100%;
  }
  .tckb-training-identity .tckb-training-button {
    margin-top: 10px;
  }
  .tckb-training-block {
    min-height: 0;
  }
  .tckb-training-understood {
    width: 100%;
    justify-content: center;
  }
}

/* v0.7.0 training quizzes */
.tckb-training-plan__item.is-locked {
  opacity: .55;
  cursor: not-allowed;
}

.tckb-training-quiz {
  background: #fff;
  border: 1px solid #dbe7f4;
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 12px 28px rgba(15,23,42,.05);
}

.tckb-training-quiz__header span {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #2867db;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.tckb-training-quiz__header h4 {
  margin: 0 0 8px;
  font-size: 24px;
  color: #24364d;
}

.tckb-training-quiz__header p {
  margin: 0 0 16px;
  color: #64748b;
}

.tckb-training-quiz__body {
  display: grid;
  gap: 14px;
}

.tckb-quiz-question {
  border: 1px solid #e3ebf5;
  border-radius: 18px;
  padding: 16px;
  margin: 0;
  background: #f9fbfe;
}

.tckb-quiz-question legend {
  font-weight: 800;
  color: #24364d;
  padding: 0 6px;
}

.tckb-quiz-question label {
  display: block;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e3ebf5;
  cursor: pointer;
}

.tckb-quiz-question label:hover {
  border-color: #bcd2f1;
}

.tckb-training-quiz__result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
}

.tckb-training-quiz__result.is-ok {
  background: #ecfdf5;
  color: #047857;
}

.tckb-training-quiz__result.is-bad {
  background: #fff1f2;
  color: #be123c;
}

.tckb-training-quiz__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}


/* v0.7.2 default manager view + readable active role cards */
.tckb .tckb-role-card.is-active,
.tckb button.tckb-role-card.is-active {
  background: linear-gradient(135deg, #226fe8 0%, #2f7df6 100%) !important;
  border-color: #2f7df6 !important;
  color: #ffffff !important;
  box-shadow: 0 14px 30px rgba(47,125,246,.22) !important;
}

.tckb .tckb-role-card.is-active strong,
.tckb button.tckb-role-card.is-active strong {
  color: #ffffff !important;
}

.tckb .tckb-role-card.is-active span,
.tckb button.tckb-role-card.is-active span {
  color: rgba(255,255,255,.88) !important;
}

.tckb .tckb-role-card:hover span,
.tckb button.tckb-role-card:hover span {
  color: inherit;
}

/* v0.8.1 training title/progress polish */
.tckb-training-plan__status,
.tckb-training-plan__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  max-width: 100% !important;
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.25;
  white-space: normal;
  color: #506784;
  background: #f1f5f9;
}

.tckb-training-plan__count {
  margin-left: 6px;
  font-weight: 700;
  color: #6b7a8f;
  background: #f8fafc;
}

.tckb-training-plan__item.is-unfinished .tckb-training-plan__status {
  background: #fff7ed;
  color: #c96a14;
}

.tckb-training-plan__item.is-complete .tckb-training-plan__status {
  background: #ecfdf5;
  color: #047857;
}

.tckb-training-plan__item.is-active:not(.is-complete) .tckb-training-plan__status {
  background: #eef4ff;
  color: #2867db;
}

.tckb-training-plan__item.is-locked .tckb-training-plan__status,
.tckb-training-plan__item.is-locked .tckb-training-plan__count {
  opacity: .65;
}


/* v0.9.0 frontend settings shortcode */
.tckb-settings-front {
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 18px;
  color: var(--tckb-text, #172033);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.tckb-settings-panel,
.tckb-settings-front .wrap {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 18px 42px rgba(15,23,42,.08);
}

.tckb-settings-panel h1,
.tckb-settings-front .wrap h1 {
  margin: 0 0 18px;
  font-size: clamp(26px, 3vw, 38px);
  color: #172033;
}

.tckb-settings-panel h2,
.tckb-settings-front .wrap h2 {
  margin: 28px 0 12px;
  font-size: 22px;
  color: #24364d;
  border-top: 1px solid #e8eef6;
  padding-top: 20px;
}

.tckb-settings-panel h2:first-of-type,
.tckb-settings-front .wrap h2:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.tckb-settings-panel table,
.tckb-settings-front .wrap table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
}

.tckb-settings-panel th,
.tckb-settings-panel td,
.tckb-settings-front .wrap th,
.tckb-settings-front .wrap td {
  padding: 13px 14px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  text-align: left;
}

.tckb-settings-panel th,
.tckb-settings-front .wrap th {
  width: 260px;
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}

.tckb-settings-panel tr:last-child th,
.tckb-settings-panel tr:last-child td,
.tckb-settings-front .wrap tr:last-child th,
.tckb-settings-front .wrap tr:last-child td {
  border-bottom: 0;
}

.tckb-settings-panel input[type="text"],
.tckb-settings-panel textarea,
.tckb-settings-front .wrap input[type="text"],
.tckb-settings-front .wrap textarea {
  width: 100%;
  max-width: 760px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: #172033;
}

.tckb-settings-panel textarea,
.tckb-settings-front .wrap textarea {
  min-height: 88px;
  resize: vertical;
}

.tckb-settings-panel code,
.tckb-settings-front .wrap code {
  display: inline-block;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 8px;
  background: #eef4ff;
  color: #1e5bc7;
  word-break: break-all;
}

.tckb-settings-panel .description,
.tckb-settings-front .wrap .description {
  margin: 7px 0 0;
  color: #64748b;
  font-size: 13px;
}

.tckb-settings-panel .button,
.tckb-settings-panel input[type="submit"],
.tckb-settings-front .wrap .button,
.tckb-settings-front .wrap input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid #2f7df6;
  border-radius: 999px;
  background: #2f7df6;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(47,125,246,.16);
}

.tckb-settings-panel .button.delete,
.tckb-settings-panel input.delete,
.tckb-settings-front .wrap .button.delete,
.tckb-settings-front .wrap input.delete {
  background: #fff;
  border-color: #ef4444;
  color: #b91c1c;
  box-shadow: none;
}

.tckb-settings-front .notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-left: 4px solid #16a34a;
  border-radius: 12px;
  background: #ecfdf5;
  color: #166534;
}

.tckb-settings-front__notice {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 24px;
  box-shadow: 0 14px 34px rgba(15,23,42,.07);
}

.tckb-settings-front__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #2f7df6;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

@media (max-width: 800px) {
  .tckb-settings-front {
    padding: 0 10px;
  }
  .tckb-settings-panel,
  .tckb-settings-front .wrap {
    padding: 16px;
    border-radius: 18px;
  }
  .tckb-settings-panel table,
  .tckb-settings-panel tbody,
  .tckb-settings-panel tr,
  .tckb-settings-panel th,
  .tckb-settings-panel td,
  .tckb-settings-front .wrap table,
  .tckb-settings-front .wrap tbody,
  .tckb-settings-front .wrap tr,
  .tckb-settings-front .wrap th,
  .tckb-settings-front .wrap td {
    display: block;
    width: 100%;
  }
  .tckb-settings-panel th,
  .tckb-settings-front .wrap th {
    border-bottom: 0;
  }
}


/* v0.9.1 frontend settings submit buttons */
.tckb-settings-front .submit {
  margin: 18px 0 0;
  padding: 0;
}
.tckb-settings-front .tckb-front-submit,
.tckb-settings-front button.button.tckb-front-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: #2f7df6;
  color: #ffffff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(47,125,246,.18);
}
.tckb-settings-front .tckb-front-submit:hover,
.tckb-settings-front button.button.tckb-front-submit:hover {
  background: #1458c8;
  color: #ffffff;
}
.tckb-settings-front .tckb-front-submit--delete,
.tckb-settings-front button.button.tckb-front-submit--delete {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  box-shadow: none;
}
.tckb-settings-front .tckb-front-submit--delete:hover,
.tckb-settings-front button.button.tckb-front-submit--delete:hover {
  background: #be123c;
  color: #ffffff;
}


/* v0.9.2 frontend admin hub */
.tckb-admin-front__head {
  margin-bottom: 18px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, #0f2d52, #2867db);
  color: #fff;
}

.tckb-admin-front__head h1 {
  margin: 0 0 8px;
  color: #fff;
}

.tckb-admin-front__head p {
  margin: 0;
  color: rgba(255,255,255,.86);
}

.tckb-admin-front__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.tckb-admin-front__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid #d8e4f3;
  border-radius: 999px;
  background: #fff;
  color: #24364d;
  text-decoration: none;
  font-weight: 700;
}

.tckb-admin-front__nav a:hover,
.tckb-admin-front__nav a.is-active {
  background: #2f7df6;
  border-color: #2f7df6;
  color: #fff;
}

.tckb-admin-front__panel {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15,23,42,.05);
}

.tckb-front-table-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.tckb-front-table-head h2 {
  margin: 0;
}

.tckb-front-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
}

.tckb-front-table th,
.tckb-front-table td {
  border: 1px solid #e2e8f0;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.tckb-front-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
}

.tckb-mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1e5bc7;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
}

.tckb-mini-button:hover {
  background: #2f7df6;
  color: #fff;
}

@media (max-width: 760px) {
  .tckb-front-table-head {
    display: block;
  }
  .tckb-front-table-head .tckb-settings-front__button {
    margin-top: 10px;
  }
  .tckb-front-table {
    display: block;
    overflow-x: auto;
  }
}


/* v1.1.0 Bitrix24 users role mapping */
.tckb-b24-users-table-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  margin-top: 12px;
}

.tckb-b24-users-table th,
.tckb-b24-users-table td {
  vertical-align: middle;
}

.tckb-b24-users-empty {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px dashed #b8c7dc;
  border-radius: 14px;
  background: #f8fbff;
}

.tckb [hidden] {
  display: none !important;
}


/* v1.1.1 Bitrix24 role visibility and automatic identity */
.tckb[data-tckb-access-role="manager"] .tckb-role-card:not([data-tckb-filter="role:manager"]),
.tckb[data-tckb-access-role="manager"] .tckb-filters [data-tckb-filter="all"],
.tckb[data-tckb-access-role="manager"] .tckb-filters [data-tckb-filter="role:all"],
.tckb[data-tckb-access-role="manager"] .tckb-filters [data-tckb-filter="role:admin-process"],
.tckb[data-tckb-access-role="manager"] .tckb-filters [data-tckb-filter="role:lawyer"] {
  display: none !important;
}

.tckb[data-tckb-access-role="lawyer"] .tckb-role-card:not([data-tckb-filter="role:lawyer"]),
.tckb[data-tckb-access-role="lawyer"] .tckb-filters [data-tckb-filter="all"],
.tckb[data-tckb-access-role="lawyer"] .tckb-filters [data-tckb-filter="role:all"],
.tckb[data-tckb-access-role="lawyer"] .tckb-filters [data-tckb-filter="role:admin-process"],
.tckb[data-tckb-access-role="lawyer"] .tckb-filters [data-tckb-filter="role:manager"] {
  display: none !important;
}

.tckb[data-tckb-access-role="manager"] .tckb-card:not([data-roles*="manager"]):not([data-roles*="all"]),
.tckb[data-tckb-access-role="lawyer"] .tckb-card:not([data-roles*="lawyer"]):not([data-roles*="all"]) {
  display: none !important;
}

.tckb--app .tckb-training-identity[hidden] {
  display: none !important;
}

/* v1.1.2 B24 admin management entry */
.tckb-hero__button--admin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.tckb-hero__button--admin[hidden] {
  display: none !important;
}


/* v1.1.3 inline admin mode and button alignment */
.tckb-hero__button--admin,
.tckb-hero__button--admin:visited {
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #164472 !important;
  border-color: rgba(255,255,255,.95) !important;
  box-shadow: 0 8px 18px rgba(15,23,42,.08) !important;
  text-decoration: none !important;
  font-weight: 500 !important;
}

.tckb-hero__button--admin:hover,
.tckb-hero__button--admin:focus {
  background: #f3f8ff !important;
  color: #164472 !important;
  border-color: #ffffff !important;
  transform: translateY(-1px);
}

.tckb-tests-panel {
  max-width: 1200px;
}

.tckb-tests-panel > p {
  color: #64748b;
}


/* v1.1.4 admin return button and unified hero buttons */
.tckb-hero__actions .tckb-hero__button,
.tckb-hero__actions a.tckb-hero__button,
.tckb-hero__actions button.tckb-hero__button,
.tckb-hero__actions .tckb-hero__button--learn,
.tckb-hero__actions .tckb-hero__button--admin,
.tckb-hero__actions .tckb-hero__button--admin:visited {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 52px !important;
  padding: 0 22px !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: #164472 !important;
  border: 1px solid rgba(255,255,255,.95) !important;
  box-shadow: 0 8px 20px rgba(15,23,42,.10) !important;
  font: inherit !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  vertical-align: middle !important;
}

.tckb-hero__actions .tckb-hero__button:hover,
.tckb-hero__actions a.tckb-hero__button:hover,
.tckb-hero__actions button.tckb-hero__button:hover,
.tckb-hero__actions .tckb-hero__button--learn:hover,
.tckb-hero__actions .tckb-hero__button--admin:hover,
.tckb-hero__actions .tckb-hero__button:focus,
.tckb-hero__actions .tckb-hero__button--admin:focus {
  background: #f4f8ff !important;
  color: #164472 !important;
  border-color: #ffffff !important;
  transform: translateY(-1px);
}

.tckb-admin-front__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.tckb-admin-front__head > div {
  min-width: 0;
}

.tckb-admin-front__return,
.tckb-admin-front__return:visited {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  color: #164472;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(15,23,42,.12);
}

.tckb-admin-front__return:hover,
.tckb-admin-front__return:focus {
  background: #f4f8ff;
  color: #164472;
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  .tckb-admin-front__head {
    display: block;
  }
  .tckb-admin-front__return {
    margin-top: 14px;
  }
}
