/* ═══════════════════════════════════════════════════════════ */
/* HIDE BOTH UIs UNTIL JS DECIDES                               */
/* ═══════════════════════════════════════════════════════════ */
#desktop-arch-ui, #mobile-arch-ui {
    display: none;
}

/* ═══════════════════════════════════════════════════════════ */
/* ARCHITECTURE PAGE STYLES                                     */
/* ═══════════════════════════════════════════════════════════ */

main.arch-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px 120px;
}

/* Page heading */
.arch-hero {
    text-align: center;
    margin-bottom: 80px;
}

.arch-hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 14px;
}

.arch-hero p {
    color: #94a3b8;
    font-size: 1.05rem;
    max-width: 660px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ─────────────────────────────────────────────────────────── */
/* FLOWCHARTS GRID — side by side desktop, stacked mobile      */
/* ─────────────────────────────────────────────────────────── */
.flowcharts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 80px;
}

@media (max-width: 860px) {
    .flowcharts-grid {
    grid-template-columns: 1fr;
    }
}

.flowchart-col {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 16px;
    padding: 36px 28px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.flowchart-col-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #e0e7ff;
    margin-bottom: 6px;
    text-align: center;
}

.flowchart-col-link {
    font-size: 0.82rem;
    color: #818cf8;
    text-decoration: none;
    margin-bottom: 30px;
    display: inline-block;
    transition: color 0.2s;
}

.flowchart-col-link:hover {
    color: #a5b4fc;
    text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────── */
/* BUBBLES + ARROWS (vertical)                                  */
/* ─────────────────────────────────────────────────────────── */
.flowchart-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.bubble-wrap {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

.bubble {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 170px;
    height: 66px;
    border-radius: 33px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 60%, #818cf8 100%);
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    text-align: center;
    padding: 0 18px;
    cursor: pointer;
    border: 2px solid rgba(255,255,255,0.15);
    box-shadow: 0 6px 24px rgba(99,102,241,0.28);
    transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), box-shadow 0.25s ease;
    z-index: 1;
    user-select: none;
}

.bubble:hover {
    transform: scale(1.09);
    box-shadow: 0 14px 40px rgba(99,102,241,0.5);
}

/* Tooltip */
.bubble::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 17, 32, 0.97);
    border: 1px solid rgba(99,102,241,0.4);
    color: #e0e7ff;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 9px 13px;
    border-radius: 8px;
    white-space: normal;
    width: 230px;
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(4px);
    z-index: 100;
}

.bubble:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Arrow connector */
.bubble-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin: 0;
}

.bubble-arrow .arrow-line {
    width: 2px;
    height: 22px;
    background: linear-gradient(to bottom, rgba(99,102,241,0.6), rgba(129,140,248,0.9));
}

.bubble-arrow .arrow-head {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 9px solid rgba(129,140,248,0.9);
}

/* Rate limit badge */
.rate-badge {
    margin-top: 28px;
    padding: 7px 16px;
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.3);
    border-radius: 20px;
    font-size: 0.82rem;
    color: #a5b4fc;
    font-weight: 500;
}

/* ─────────────────────────────────────────────────────────── */
/* ACCORDION — repos section                                    */
/* ─────────────────────────────────────────────────────────── */
.repos-section {
    margin-top: 20px;
}

.repos-section h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 8px;
}

.repos-section .section-sub {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 32px;
}

.accordion {
    border: 1px solid rgba(99,102,241,0.2);
    border-radius: 12px;
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid rgba(99,102,241,0.1);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    width: 100%;
    padding: 20px 24px;
    background: rgba(20, 30, 50, 0.6);
    border: none;
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s, padding-left 0.2s;
    gap: 12px;
    font-family: inherit;
}

.accordion-header:hover {
    background: rgba(30, 42, 68, 0.8);
}

.accordion-header.active {
    background: rgba(99,102,241,0.12);
    border-bottom: 1px solid rgba(99,102,241,0.35);
}

.accordion-header.disabled {
    cursor: not-allowed;
    opacity: 0.45;
    pointer-events: none;
}

.accordion-header .chevron {
    transition: transform 0.35s cubic-bezier(.34,1.56,.64,1);
    color: #6366f1;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.accordion-header.active .chevron {
    transform: rotate(180deg);
}

.coming-soon-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(99,102,241,0.18);
    color: #818cf8;
    padding: 3px 10px;
    border-radius: 10px;
    border: 1px solid rgba(99,102,241,0.3);
    margin-left: 10px;
    flex-shrink: 0;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: rgba(10, 17, 32, 0.3);
}

.accordion-content.open {
    max-height: 2000px;
}

.accordion-body {
    padding: 24px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* repo link rows */
.repo-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(99,102,241,0.04);
    border: 1px solid transparent;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, border-color 0.2s, transform 0.2s, color 0.2s;
}

.repo-link:hover {
    background: rgba(99,102,241,0.12);
    border-color: rgba(99,102,241,0.3);
    color: #a5b4fc;
    transform: translateX(4px);
}

.repo-link i {
    color: #6366f1;
    margin-top: 2px;
    min-width: 16px;
}

.repo-link .link-label {
    flex: 1;
}

.repo-link .link-url {
    font-size: 0.78rem;
    color: #64748b;
    word-break: break-all;
    display: block;
    margin-top: 2px;
}

.repo-private {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(30,30,40,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    color: #64748b;
    font-size: 0.9rem;
}

.repo-private i {
    color: #475569;
    min-width: 16px;
}

/* ─────────────────────────────────────────────────────────── */
/* BLINK ANIMATION                                              */
/* ─────────────────────────────────────────────────────────── */
@keyframes blink-yellow {
    0%   { background-color: rgba(99,102,241,0.04); }
    20%  { background-color: rgba(254,240,138,0.45); }
    40%  { background-color: rgba(99,102,241,0.04); }
    60%  { background-color: rgba(254,240,138,0.45); }
    80%  { background-color: rgba(99,102,241,0.04); }
    100% { background-color: rgba(254,240,138,0.45); }
}

.blink-link {
    animation: blink-yellow 1.5s ease-in-out;
}

/* ─────────────────────────────────────────────────────────── */
/* RESPONSIVE                                                   */
/* ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    main.arch-main {
    padding: 48px 14px 80px;
    }

    .arch-hero h1 {
    font-size: 1.8rem;
    }

    .bubble {
    width: 150px;
    height: 58px;
    font-size: 0.82rem;
    }

    .bubble::after {
    width: 200px;
    }

    .accordion-header {
    padding: 16px 16px;
    font-size: 0.93rem;
    }

    .accordion-body {
    padding: 16px 14px 20px;
    }
}

/* ═════════════════════════════════════════════════════════════ */
/* MOBILE STYLES — Navigation, Layout, Footer                    */
/* ═════════════════════════════════════════════════════════════ */

/* Mobile Navbar */
.mobile-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #030b17;
    border-bottom: 1px solid #1e3a5f;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #f1f5f9;
    font-size: 0.95rem;
}

.mobile-logo img {
    width: 32px;
    height: 32px;
}

.hamburger-btn {
    background: none;
    border: none;
    color: #f1f5f9;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    width: 280px;
    height: 100vh;
    background: #0a1120;
    border-right: 1px solid #1e3a5f;
    z-index: 200;
    transition: left 0.3s ease;
    overflow-y: auto;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e3a5f;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #f1f5f9;
    font-size: 0.95rem;
}

.sidebar-logo img {
    width: 28px;
    height: 28px;
}

.close-sidebar {
    background: none;
    border: none;
    color: #f1f5f9;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
}

.sidebar-menu {
    padding: 12px 0;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}

.sidebar-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-left-color: #6366f1;
}

.sidebar-item.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.sidebar-divider {
    padding: 12px 20px 8px;
    font-size: 0.8rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.sidebar-submenu {
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.sidebar-submenu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #cbd5e1;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.sidebar-submenu-header:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}

.sidebar-submenu-header .submenu-chevron {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.sidebar-submenu-header.open .submenu-chevron {
    transform: rotate(90deg);
}

.sidebar-submenu-content {
    display: none;
    background: rgba(99, 102, 241, 0.05);
    flex-direction: column;
}

.sidebar-submenu-content.open {
    display: flex;
}

.sidebar-submenu-content a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 10px 44px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
}

.sidebar-submenu-content a:hover {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
}

.mobile-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: auto;
}

.realtime-badge {
    background: rgba(99, 102, 241, 0.25);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.4);
}

.overnight-badge {
    background: rgba(129, 140, 248, 0.25);
    color: #c7d2e8;
    border: 1px solid rgba(129, 140, 248, 0.4);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #1e3a5f;
    margin-top: auto;
}

.sidebar-social {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    justify-content: center;
}

.sidebar-social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    transition: background 0.2s, color 0.2s;
}

.sidebar-social a:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.sidebar-copyright {
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;
}

.sidebar-overlay.open {
    display: block;
}

/* Mobile Footer */
.mobile-footer {
    background: #0a1120;
    border-top: 1px solid #1e3a5f;
    padding: 40px 20px 20px;
    color: #cbd5e1;
}

.mobile-footer-main {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 20px;
}

.mobile-footer-logo-col {
    text-align: center;
}

.mobile-footer-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #f1f5f9;
    font-size: 1rem;
    margin-bottom: 6px;
}

.mobile-footer-logo img {
    width: 32px;
    height: 32px;
}

.mobile-footer-tagline {
    font-size: 0.85rem;
    color: #64748b;
}

.mobile-footer-col h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e0e7ff;
    margin-bottom: 10px;
}

.mobile-footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-footer-col a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.mobile-footer-col a:hover {
    color: #cbd5e1;
}

.mobile-social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mobile-social-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    transition: background 0.2s, border-color 0.2s;
}

.mobile-social-links a:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

.mobile-footer-email {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    margin-bottom: 16px;
}

.mobile-email-link {
    color: #a5b4fc;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.mobile-email-link:hover {
    color: #c7d2e8;
}

.mobile-footer-copyright {
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #1e3a5f;
}

.mobile-product-by {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 4px 0;
}

.mobile-footer-copyright p {
    margin: 0;
    font-size: 0.8rem;
    color: #475569;
}

/* Adjust main padding for mobile */
@media (max-width: 768px) {
    main.arch-main {
    padding-top: 12px;
    }
}