.frontend-doc-body {
    font-size: 15px;
    line-height: 1.65;
}

.frontend-doc-body h3 {
    margin-top: 24px;
    font-weight: 700;
}

.frontend-doc-step {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    border-top: 1px solid #e5e7eb;
}

.frontend-doc-step-number {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.frontend-doc-step-content {
    flex: 1;
    min-width: 0;
}

.frontend-doc-step-content h4 {
    margin-top: 4px;
    font-weight: 700;
}

.frontend-doc-screenshot {
    max-width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-top: 10px;
    background: #fff;
}

.screen_help_modal .frontend-doc-help-dialog {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    width: 480px;
    max-width: 92vw;
}

.screen_help_modal .frontend-doc-help-dialog .modal-content {
    height: 100%;
    overflow-y: auto;
    border-radius: 0;
}

.screen_help_modal.fade .frontend-doc-help-dialog {
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
}

.screen_help_modal.fade.in .frontend-doc-help-dialog {
    transform: translateX(0);
}

/* --- Docs index: tab bar --------------------------------------------------- */

.frontend-doc-tabs > li > a {
    font-weight: 600;
}

.frontend-doc-tabs .frontend-doc-tab-btn {
    margin: 4px 0;
}

/* Anchors placed in the tab bar (e.g. "Public archive") pick up Bootstrap's
   .nav-tabs > li > a tab-link styling, which outranks .btn. Reset them so
   they render exactly like the sibling btn-default buttons (MCP Connection). */
.frontend-doc-tabs > li > a.frontend-doc-tab-btn,
.frontend-doc-tabs > li > a.frontend-doc-tab-btn:focus {
    display: inline-block;
    margin: 4px 0;
    padding: 6px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    line-height: 1.42857143;
    font-weight: 400;
}

.frontend-doc-tabs > li > a.frontend-doc-tab-btn:hover {
    background: #e6e6e6;
    border-color: #adadad;
    color: #333;
}

.frontend-doc-tabs .badge {
    margin-left: 4px;
}

/* --- Curated docs: module list ------------------------------------------- */

.frontend-doc-module-list li a {
    display: block;
    padding: 4px 6px;
    border-radius: 6px;
    color: #334155;
}

.frontend-doc-module-list li.active a,
.frontend-doc-module-list li a:hover {
    background: #f1f5f9;
    text-decoration: none;
}

.frontend-doc-module-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.frontend-doc-module-chip {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    vertical-align: middle;
}

.frontend-doc-module-section {
    margin-bottom: 28px;
}

.frontend-doc-module-heading {
    margin: 0 0 12px;
    font-weight: 700;
}

/* --- Curated docs: card grid --------------------------------------------- */

.frontend-doc-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.frontend-doc-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: 3px solid #475569;
    border-radius: 8px;
    overflow: hidden;
    color: #1e293b;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.frontend-doc-card:hover,
.frontend-doc-card:focus {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
    text-decoration: none;
    color: #1e293b;
}

.frontend-doc-card-thumb {
    aspect-ratio: 16 / 10;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
    overflow: hidden;
}

.frontend-doc-card-thumb img,
.frontend-doc-card-thumb svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.frontend-doc-card-body {
    padding: 12px 14px;
}

.frontend-doc-card-body h4 {
    margin: 0 0 4px;
    font-weight: 700;
    font-size: 15px;
}

.frontend-doc-card-body code {
    font-size: 11px;
}

.frontend-doc-card-body p {
    margin: 6px 0 0;
    font-size: 13px;
    color: #64748b;
}

.frontend-doc-card-meta {
    margin-top: 8px;
}

/* --- Live preview box ----------------------------------------------------- */

.frontend-doc-preview-box {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.frontend-doc-preview-chrome {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #e2e8f0;
}

.frontend-doc-chrome-dot {
    width: 10px;
    height: 10px;
    min-width: 10px;
    border-radius: 50%;
}

.frontend-doc-preview-chrome .frontend-doc-chrome-url {
    flex: 1;
    min-width: 0;
    margin-left: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.frontend-doc-preview-chrome .frontend-doc-chrome-open {
    font-size: 12px;
    white-space: nowrap;
}

.frontend-doc-preview-viewport {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f8fafc;
}

.frontend-doc-preview-viewport iframe {
    width: 1280px;
    height: 800px;
    border: 0;
    transform-origin: 0 0;
    pointer-events: none;
}

.frontend-doc-preview-note {
    padding: 6px 12px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border-top: 1px solid #eef2f7;
}

/* --- Image slider ---------------------------------------------------------- */

.frontend-doc-slider {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #0f172a;
}

.frontend-doc-slider .item img {
    width: 100%;
    display: block;
}

/* --- Media edit form ------------------------------------------------------- */

.frontend-doc-media-option {
    display: block;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 400;
}

.frontend-doc-media-option strong {
    margin-left: 4px;
}

.frontend-doc-media-option:has(input:checked) {
    border-color: #3c8dbc;
    background: #eaf3f9;
}

.frontend-doc-media-mock {
    float: right;
    width: 74px;
    height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    display: block;
    margin-left: 8px;
}

.frontend-doc-media-mock-bar {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 5px;
    background: #e2e8f0;
}

.frontend-doc-media-mock-bar i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #94a3b8;
}

.frontend-doc-media-mock-live {
    display: block;
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    color: #0f7a52;
    padding-top: 8px;
    letter-spacing: 0.1em;
}

.frontend-doc-media-mock-img {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
    color: #64748b;
    font-size: 12px;
    background: repeating-linear-gradient(45deg, #f1f5f9, #f1f5f9 6px, #e2e8f0 6px, #e2e8f0 12px);
}

.frontend-doc-media-mock-wire {
    display: block;
    margin: 6px;
    height: 34px;
    border: 1px dashed #94a3b8;
    border-radius: 4px;
    background:
        linear-gradient(#cbd5e1, #cbd5e1) no-repeat 4px 4px / 28px 5px,
        linear-gradient(#e2e8f0, #e2e8f0) no-repeat 4px 13px / 54px 4px,
        linear-gradient(#e2e8f0, #e2e8f0) no-repeat 4px 21px / 44px 4px;
}

.frontend-doc-edit-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.frontend-doc-edit-thumb {
    width: 160px;
    font-weight: 400;
    cursor: pointer;
}

.frontend-doc-edit-thumb img {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.frontend-doc-details th {
    width: 100px;
}

/* --- Knowledge-base sidebar (public + admin) ------------------------------- */

.frontend-doc-kb {
    background: #fff;
    color: #333;
    border: 1px solid #d2d6de;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.frontend-doc-kb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f4f4f4;
}

.frontend-doc-kb-mark {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 3px;
    background: #3c8dbc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
}

.frontend-doc-kb-brand b {
    display: block;
    color: #333;
    font-size: 14px;
}

.frontend-doc-kb-brand span {
    display: block;
    font-size: 11px;
    color: #999;
}

.frontend-doc-kb-search {
    padding: 10px 10px 4px;
}

.frontend-doc-kb-search input {
    width: 100%;
    padding: 6px 11px;
    font-size: 13px;
    color: #555;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.frontend-doc-kb-nav {
    padding: 6px 6px 12px;
    flex: 1;
    overflow-y: auto;
    max-height: 70vh;
}

.frontend-doc-kb-mod-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    background: none;
    border: 0;
    cursor: pointer;
    color: #444;
    font-size: 13px;
    font-weight: 600;
    border-radius: 3px;
    text-align: left;
}

.frontend-doc-kb-mod-btn:hover {
    background: #f5f5f5;
    color: #222;
}

.frontend-doc-kb-mod-btn .chev {
    margin-left: auto;
    transition: transform 0.18s ease;
    font-size: 10px;
    opacity: 0.5;
}

.frontend-doc-kb-mod.open .chev {
    transform: rotate(90deg);
}

.frontend-doc-kb-sub {
    display: none;
    padding: 2px 0 5px 9px;
    margin-left: 9px;
    border-left: 1px solid #e5e5e5;
}

.frontend-doc-kb-mod.open .frontend-doc-kb-sub {
    display: block;
}

.frontend-doc-kb-link {
    display: block;
    padding: 5px 10px;
    font-size: 12.5px;
    color: #555;
    border-radius: 3px;
}

.frontend-doc-kb-link:hover,
.frontend-doc-kb-link:focus {
    background: #f5f5f5;
    color: #222;
    text-decoration: none;
}

.frontend-doc-kb-link.active {
    background: #3c8dbc;
    color: #fff;
}

/* --- Knowledge-base content blocks (inside authored HTML) ------------------ */

.frontend-doc-body h3.sec {
    font-size: 18px;
    margin: 34px 0 14px;
    padding-top: 20px;
    border-top: 1px solid #dde3ee;
    font-weight: 700;
}

.frontend-doc-body ol.steps {
    counter-reset: s;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.frontend-doc-body ol.steps li {
    counter-increment: s;
    position: relative;
    padding: 0 0 18px 48px;
    margin: 0;
    border: 0;
}

.frontend-doc-body ol.steps li::before {
    content: counter(s);
    position: absolute;
    left: 0;
    top: -1px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #3c8dbc;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.frontend-doc-body ol.steps li::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: 2px;
    width: 1px;
    background: #dde3ee;
}

.frontend-doc-body ol.steps li:last-child {
    padding-bottom: 0;
}

.frontend-doc-body ol.steps li:last-child::after {
    display: none;
}

.frontend-doc-body ol.steps b {
    display: block;
    margin-bottom: 2px;
}

.frontend-doc-body ol.steps span {
    color: #3b4557;
    font-size: 14px;
}

.frontend-doc-body .note {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    margin: 0 0 20px;
    border-radius: 10px;
    border: 1px solid #dde3ee;
    background: #fff;
}

.frontend-doc-body .note.tip { background: #e3f5ed; border-color: rgba(15, 122, 82, 0.28); }
.frontend-doc-body .note.warn { background: #fdf0dd; border-color: rgba(163, 91, 0, 0.3); }
.frontend-doc-body .note.stop { background: #fdeceb; border-color: rgba(179, 38, 30, 0.3); }

.frontend-doc-body .note .ic {
    flex: none;
    font-size: 17px;
    line-height: 1.4;
}

.frontend-doc-body .note p {
    margin: 0;
}

.frontend-doc-body .note .note-t {
    display: block;
    margin-bottom: 3px;
}

.frontend-doc-body .note.tip .note-t { color: #0f7a52; }
.frontend-doc-body .note.warn .note-t { color: #a35b00; }
.frontend-doc-body .note.stop .note-t { color: #b3261e; }

.frontend-doc-body .tbl-scroll {
    overflow-x: auto;
    margin: 0 0 20px;
    border: 1px solid #d2d6de;
    border-radius: 3px;
}

.frontend-doc-body .tbl-scroll table {
    margin: 0;
}

.frontend-doc-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
    margin: 0 0 20px;
}

.frontend-doc-body table th {
    text-align: left;
    padding: 9px 12px;
    background: #eef1f8;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #697384;
    border-bottom: 1px solid #dde3ee;
}

.frontend-doc-body table td {
    padding: 9px 12px;
    border-top: 1px solid #dde3ee;
    vertical-align: top;
}

/* --- Screen-help drawer ----------------------------------------------------- */

.screen_help_modal .modal-title small .frontend-doc-module-chip {
    margin-top: 6px;
}

.frontend-doc-briefing {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
    background: #f5f5f5;
    border: 1px solid #e3e3e3;
    border-left: 3px solid #3c8dbc;
    border-radius: 3px;
    padding: 12px 16px;
    margin: 0 0 14px;
}

/* --- Public archive (/documentation) --------------------------------------- */

.frontend-doc-public-body {
    background: #ecf0f5;
    min-height: 100vh;
    margin: 0;
}

.frontend-doc-public-app {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.frontend-doc-public-side {
    border-radius: 0;
    border-top: 0;
    border-bottom: 0;
    border-left: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.frontend-doc-public-side .frontend-doc-kb-nav {
    max-height: none;
}

.frontend-doc-public-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.frontend-doc-public-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 32px;
    background: #fff;
    border-bottom: 1px solid #d2d6de;
}

.frontend-doc-public-crumbs {
    font-size: 13px;
    color: #777;
}

.frontend-doc-public-crumbs b {
    color: #333;
}

.frontend-doc-public-container {
    max-width: 1100px;
    padding: 28px 32px 80px;
    flex: 1;
}

@media (max-width: 940px) {
    .frontend-doc-public-app {
        grid-template-columns: 1fr;
    }

    .frontend-doc-public-side {
        position: static;
        height: auto;
        max-height: 45vh;
    }
}

.frontend-doc-public-hero {
    text-align: center;
    padding: 12px 0 24px;
}

.frontend-doc-public-hero h1 {
    font-weight: 700;
    margin-bottom: 4px;
}

.frontend-doc-public-hero p {
    color: #64748b;
}

.frontend-doc-public-search {
    display: flex;
    gap: 8px;
    max-width: 520px;
    margin: 12px auto 0;
}

.frontend-doc-public-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.frontend-doc-public-panel h4 {
    margin-top: 0;
    font-weight: 700;
}

.frontend-doc-public-title {
    margin-top: 0;
    font-weight: 700;
}

.frontend-doc-public-footer {
    text-align: center;
    color: #94a3b8;
    padding: 20px;
    font-size: 13px;
}

/* --- Public intro page: chapters list -------------------------------------- */

.frontend-doc-toc {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
    margin: 6px 0 10px;
}

.frontend-doc-toc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #d2d6de;
    border-radius: 3px;
    color: #333;
}

.frontend-doc-toc-item:hover,
.frontend-doc-toc-item:focus {
    background: #f5f5f5;
    color: #222;
    text-decoration: none;
}

.frontend-doc-toc-title {
    flex: 1;
    font-weight: 600;
    font-size: 13px;
}
