/* FAQ Page Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.faq-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Cap oversized uploaded images to a reasonable size instead of showing them at full resolution */
.faq-content img,
.faq-search-result-answer img,
.search-result-answer img,
.question-content img,
.faq-result-a-text img {
    max-width: min(100%, 400px);
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Header Styles */
.faq-header {
    background-color: white;
    padding: 10px 20px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    min-height: 60px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
}

.logo-image {
    height: 40px;
    width: auto;
    max-width: min(200px, 35vw);
    object-fit: contain;
    object-position: left center;
    display: block;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    padding-bottom: 5px;
}

.header-text {
    font-size: 14px;
    margin-left: 35px;
}

/* Main Content */
.faq-main {
    flex: 1;
    display: flex;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    gap: 30px;
    box-sizing: border-box;
}

/* Sidebar Navigation */
.faq-sidebar {
    width: 280px;
    min-width: 0;
    max-width: 280px;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    background-color: white;
    color: #333;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

/* Mobile Menu Toggle Button */
.faq-mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: #5b0098;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1000;
    font-size: 24px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.faq-mobile-menu-toggle:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.faq-mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Mobile Sidebar Overlay */
.faq-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.faq-sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.sidebar-icon {
    font-size: 18px;
    margin-right: 10px;
    color: #333;
}

.sidebar-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.sidebar-nav {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-item-header {
    display: flex;
    align-items: flex-start;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s, filter 0.2s;
}

.nav-item-header:hover {
    background-color: #e8e8e8;
    filter: brightness(1.5);
}

.nav-icon {
    margin-right: 10px;
    font-size: 14px;
    color: #666;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.nav-icon:not(:empty) {
    border: 1px solid currentColor;
    border-radius: 2px;
}

.nav-toggle {
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.nav-text {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    word-break: break-word;
    white-space: normal;
    text-decoration: none;
    overflow-wrap: break-word;
    hyphens: auto;
}

.nav-text:hover,
.nav-text:focus {
    color: #333;
    text-decoration: none;
}

/* Base nav-sublist styling */
.nav-sublist {
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
    display: none;
}

.nav-item.expanded > .nav-sublist,
.nav-subitem.expanded > .nav-sublist {
    display: block;
}

/* Base nav-subitem styling */
.nav-subitem {
    transition: background-color 0.2s;
}

/* Level 2: First sublevel - Bold text like 注目ワード, no background */
.nav-item > .nav-sublist > .nav-subitem {
    margin-left: 0;
}

.nav-item > .nav-sublist > .nav-subitem .nav-text {
    font-size: 13px;
    color: #555;
    font-weight: bold;
    line-height: 1.5;
    word-break: break-word;
    white-space: normal;
    padding: 8px 12px;
    display: block;
}

.nav-item > .nav-sublist > .nav-subitem .nav-subitem-header {
    display: flex;
    align-items: flex-start;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-item > .nav-sublist > .nav-subitem .nav-subitem-header .nav-text {
    font-weight: bold;
    padding: 0;
}

/* Level 3: Second sublevel - Indent 1em, bold, no static background (matches level 2) */
.nav-item > .nav-sublist > .nav-subitem > .nav-sublist {
    margin-left: 1em;
}

.nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem:not(.active) .nav-text {
    font-size: 13px;
    color: #555;
    font-weight: bold;
    line-height: 1.5;
    word-break: break-word;
    white-space: normal;
    padding: 8px 12px;
    display: block;
    border-radius: 4px;
}

.nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem:not(.active) .nav-subitem-header {
    display: flex;
    align-items: flex-start;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem:not(.active) .nav-subitem-header .nav-text {
    font-weight: bold;
    padding: 0;
}

/* Level 4: Third sublevel - No bold, indent one step further than level 3 */
.nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist {
    margin-left: 1em;
}

.nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem .nav-text {
    font-size: 13px;
    color: #555;
    font-weight: normal;
    line-height: 1.5;
    word-break: break-word;
    white-space: normal;
    padding: 8px 12px;
    display: block;
}

.nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem .nav-subitem-header {
    display: flex;
    align-items: flex-start;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem .nav-subitem-header .nav-text {
    font-weight: normal;
    padding: 0;
}

/* Level 5: Fourth sublevel - Indent additional 1em */
.nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist {
    margin-left: 1em;
}

.nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem .nav-text {
    font-size: 13px;
    color: #555;
    font-weight: normal;
    line-height: 1.5;
    word-break: break-word;
    white-space: normal;
    padding: 8px 12px;
    display: block;
}

.nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem .nav-subitem-header {
    display: flex;
    align-items: flex-start;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem .nav-subitem-header .nav-text {
    font-weight: normal;
    padding: 0;
}

/* Common hover and icon styles for all levels */
.nav-subitem.active .nav-subitem-header:hover {
    filter: brightness(1.5);
}
.nav-subitem-header:not(.active):hover {
    background-color: #e8e8e8;
}

.nav-subitem:not(.active) .nav-text:hover {
    background-color: #e8e8e8;
}

.nav-subitem-header .nav-icon {
    margin-right: 10px;
    font-size: 12px;
    color: #666;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-subitem-header .nav-icon:not(:empty) {
    border: 1px solid currentColor;
    border-radius: 2px;
}

/* Active state - colors will be set by inline styles from button colors */
.nav-subitem.active .nav-text,
.nav-subitem.active .nav-subitem-header {
    background-color: transparent;
}

.faq-content {
    flex: 1;
    max-width: 900px;
    min-width: 0;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.faq-title {
    text-align: center;
    font-size: 48px;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 40px;
    color: #333;
}

.faq-subtitle {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-bottom: 30px;
}

/* Search Bar */
.search-container {
    margin-bottom: 40px;
}

.search-wrapper {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    background-color: #ffffff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Search input container - holds tags and input inside search box */
.search-input-container {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    min-height: 60px;
    cursor: text;
}

/* Selected Keywords Tags (inside search box) */
.selected-keywords-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.selected-keyword-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background-color: #5B0098;
    color: #ffffff;
    border-radius: 16px;
    font-size: 12px;
    gap: 6px;
    white-space: nowrap;
    animation: slideIn 0.2s ease-out;
}

.selected-keyword-tag-text {
    display: inline-block;
}

.selected-keyword-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    transition: background-color 0.2s;
}

.selected-keyword-tag-remove:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.search-input {
    flex: 1;
    min-width: 120px;
    padding: 5px 5px;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
}

.search-input::placeholder {
    color: #999;
}

.search-button {
    background-color: #262626;
    color: white;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

/* Section Title */
.section-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

/* Featured Keywords */
.featured-keywords {
    margin-bottom: 50px;
}

.keywords-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.keyword-tag {
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    white-space: normal;
    word-break: break-word;
    flex-shrink: 0;
}

.tag-purple {
    background-color: #5B0098;
    color: #ffffff;
}

.tag-white {
    background-color: #E8DEF8;
    color: #4A4459;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Frequent Questions */
.frequent-questions {
    margin-bottom: 50px;
}

.questions-list-wrapper {
    max-height: 300px;
    overflow: auto;
}

.questions-list {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.question-header {
    padding: 18px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.question-header:hover {
    background-color: #f8f8f8;
}

.question-icon {
    margin-right: 15px;
    color: #7c4dff;
    font-size: 12px;
    transition: transform 0.3s;
}

.question-item.active .question-icon {
    transform: rotate(90deg);
}

.question-text {
    flex: 1;
    font-size: 14px;
    color: #5B0098;
}

.question-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: #fafafa;
    padding: 0 20px;
}

.question-item.active .question-content {
    /* Generous cap so long answers aren't clipped; images are separately capped at 400px */
    max-height: 5000px;
    padding: 20px;
    transition: max-height 0.3s ease-in, padding 0.3s ease-in;
}

/* Match the TinyMCE answer editor's paragraph spacing (margin-based, no per-paragraph padding) */
.question-content p {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

/* Featured Categories */
.featured-categories {
    margin-bottom: 50px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.category-btn {
    padding: 16px 8px;
    border-radius: 8px;
    border: 2px solid transparent;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    color: #5B0098;
    text-decoration: none;
}

.category-btn:hover,
.category-btn:focus {
    text-decoration: none;
}

.category-white {
    border-color: #5B0098;
}

.category-white:hover {
    background-color: #f9f9f9;
}

.category-purple {
    border-color: #5B0098;
}

.category-purple:hover {
    background-color: #f9f9f9;
}

/* Content actions use transparency on hover; text links use an underline. */
.faq-content button:not(:disabled):hover,
.faq-content [role="button"]:hover,
.faq-content .question-header:hover,
.faq-content .category-btn:hover,
.faq-content .pagination-btn:hover:not([disabled]):not(.active) {
    opacity: 0.75;
}

.faq-content a:not(.category-btn):not(.pagination-btn):hover {
    text-decoration: underline !important;
}

/* Contact Support */
.contact-support {
    margin-bottom: 50px;
}

.support-title {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.support-box {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.phone-number {
    font-size: 36px;
    font-weight: bold;
    color: #5B0098;
    margin-bottom: 10px;
}

.support-hours {
    font-size: 14px;
    margin-bottom: 20px;
}

.support-email {
    font-size: 14px;
}

.support-email a {
    color: #5B0098;
    text-decoration: none;
}

.support-email a:hover {
    text-decoration: underline;
}

/* Footer */
.faq-footer {
    background-color: white;
    padding: 10px 20px;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
    min-height: 60px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-logo {
    font-size: 24px;
    font-weight: bold;
    flex: 1;
}

.footer-powered-by {
    color: #DDE4E6;
    text-align: center;
    font-size: 12px;
    flex: 1;
}

.footer-powered-by a {
    color: inherit;
    text-decoration: none;
}

.footer-powered-by a:hover {
    text-decoration: underline;
}

.footer-copyright {
    font-size: 12px;
    color: #999;
    text-align: right;
    flex: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .faq-main {
        flex-direction: column;
    }

    .faq-sidebar {
        width: 100%;
        max-width: 100%;
        position: relative;
        top: 0;
    }
}

@media (max-width: 1024px) {
    .faq-main {
        padding: 20px 15px;
        gap: 20px;
        max-width: 100%;
        flex-direction: column;
    }
    
    /* Hide sidebar by default on mobile */
    .faq-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        z-index: 999;
        padding: 15px;
        border-radius: 0;
        transition: left 0.3s ease;
        overflow-y: auto;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.2);
    }
    
    /* Show sidebar when active */
    .faq-sidebar.active {
        left: 0;
    }
    
    /* Show mobile menu toggle button */
    .faq-mobile-menu-toggle {
        display: flex;
    }
    
    /* Enable overlay on mobile (but keep pointer-events: none until active) */
    .faq-sidebar-overlay {
        display: block;
    }
    
    .faq-content {
        max-width: 100%;
        width: 100%;
    }
    
    .faq-title {
        font-size: 32px;
        margin-bottom: 15px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .faq-subtitle {
        font-size: 13px;
        margin-bottom: 25px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .faq-header {
        padding: 10px 15px;
        height: auto;
        min-height: 60px;
    }

    .header-content {
        padding: 0 10px;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
    }
    
    .header-text {
        font-size: 12px;
        margin-left: 15px;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .category-btn {
        font-size: 13px;
        padding: 14px 12px;
        min-height: 48px;
    }
    
    .questions-list-wrapper {
        max-height: none;
    }
    
    .question-header {
        padding: 15px;
    }
    
    .question-text {
        font-size: 14px;
    }
    
    .question-content {
        padding: 0 15px;
    }
    
    .question-item.active .question-content {
        padding: 15px;
    }
    
    .question-content p {
        font-size: 13px;
    }
    
    .sidebar-title {
        font-size: 15px;
    }
    
    .nav-text {
        font-size: 13px;
    }
    
    .nav-item-header {
        padding: 10px;
    }
    
    .nav-item > .nav-sublist > .nav-subitem .nav-text {
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem:not(.active) .nav-text {
        font-size: 13px;
        padding: 8px 10px;
    }

    .search-wrapper {
        border-radius: 25px;
        max-width: 100%;
    }

    .search-input-container {
        padding: 8px 12px;
        min-height: 44px;
    }
    
    .search-input {
        font-size: 14px;
        min-width: 100px;
    }

    .search-button {
        padding: 12px 20px;
        font-size: 14px;
    }

    .selected-keyword-tag {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .keyword-tag {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .keywords-grid {
        gap: 10px;
    }
    
    .section-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .featured-keywords,
    .frequent-questions,
    .featured-categories,
    .contact-support {
        margin-bottom: 35px;
    }

    .phone-number {
        font-size: 28px;
    }

    .support-box {
        padding: 30px 20px;
    }
    
    .support-title {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .footer-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 10px 0;
    }
    
    .footer-logo {
        font-size: 20px;
    }
    
    .footer-powered-by,
    .footer-copyright {
        font-size: 11px;
        text-align: center;
    }
    
    .faq-footer {
        padding: 15px 20px;
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .faq-main {
        padding: 15px 10px;
        gap: 15px;
    }
    
    /* Adjust sidebar width for smaller screens */
    .faq-sidebar {
        width: 90%;
        max-width: 280px;
        padding: 12px;
    }
    
    /* Smaller toggle button for small screens */
    .faq-mobile-menu-toggle {
        width: 50px;
        height: 50px;
        top: 16px;
        right: 16px;
        font-size: 20px;
    }
    
    .faq-title {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .faq-subtitle {
        font-size: 12px;
        margin-bottom: 20px;
    }
    
    .faq-header {
        padding: 8px 10px;
    }
    
    .header-content {
        padding: 0 5px;
    }

    .header-text {
        font-size: 11px;
        margin-left: 12px;
    }
    
    .search-container {
        margin-bottom: 30px;
    }
    
    .search-wrapper {
        border-radius: 25px;
        flex-direction: column;
    }
    
    .search-input-container {
        padding: 10px 12px;
        min-height: 40px;
    }
    
    .search-input {
        font-size: 13px;
        min-width: 80px;
    }
    
    .search-button {
        padding: 10px 15px;
        font-size: 13px;
        border-radius: 0 0 25px 25px;
        width: 100%;
    }
    
    .selected-keyword-tag {
        font-size: 10px;
        padding: 3px 7px;
    }
    
    .section-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .keyword-tag {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .keywords-grid {
        gap: 8px;
    }
    
    .featured-keywords,
    .frequent-questions,
    .featured-categories,
    .contact-support {
        margin-bottom: 30px;
    }

    .question-header {
        padding: 12px 15px;
    }
    
    .question-text {
        font-size: 13px;
    }
    
    .question-icon {
        font-size: 11px;
        margin-right: 12px;
    }
    
    .question-content {
        padding: 0 15px;
    }
    
    .question-item.active .question-content {
        padding: 12px 15px;
    }
    
    .question-content p {
        font-size: 12px;
        line-height: 1.6;
    }

    .category-btn {
        font-size: 12px;
        padding: 12px 10px;
        min-height: 44px;
    }
    
    .categories-grid {
        gap: 10px;
    }
    
    .faq-sidebar {
        padding: 12px;
    }
    
    .sidebar-header {
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    .sidebar-icon {
        font-size: 16px;
        margin-right: 8px;
    }
    
    .sidebar-title {
        font-size: 14px;
    }
    
    .nav-text {
        font-size: 12px;
    }
    
    .nav-item-header {
        padding: 8px 10px;
    }
    
    .nav-item > .nav-sublist > .nav-subitem .nav-text {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem:not(.active) .nav-text {
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .nav-item > .nav-sublist > .nav-subitem > .nav-sublist {
        margin-left: 0.5em;
    }
    
    .nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem > .nav-sublist {
        margin-left: 0.5em;
    }

    .phone-number {
        font-size: 24px;
    }
    
    .support-hours,
    .support-email {
        font-size: 13px;
    }

    .support-box {
        padding: 25px 15px;
    }
    
    .support-title {
        font-size: 16px;
        margin-bottom: 18px;
    }
    
    .footer-content {
        gap: 10px;
        padding: 8px 0;
    }
    
    .footer-logo {
        font-size: 18px;
    }
    
    .footer-powered-by,
    .footer-copyright {
        font-size: 10px;
    }
    
    .faq-footer {
        padding: 12px 15px;
    }
}

/* Extra small devices (iPhone SE and similar) */
@media (max-width: 375px) {
    .faq-title {
        font-size: 22px;
        margin-bottom: 10px;
    }
    
    .faq-main {
        padding: 12px 8px;
    }
    
    /* Even smaller sidebar for very small screens */
    .faq-sidebar {
        width: 95%;
        max-width: 260px;
    }
    
    /* Smaller toggle button */
    .faq-mobile-menu-toggle {
        width: 48px;
        height: 48px;
        top: 14px;
        right: 14px;
        font-size: 18px;
    }
    
    .header-content {
        padding: 0 3px;
    }
    
    .header-text {
        font-size: 10px;
        margin-left: 10px;
    }
    
    .search-input {
        font-size: 12px;
        min-width: 60px;
    }
    
    .search-button {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .keyword-tag {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .section-title {
        font-size: 15px;
    }
    
    .category-btn {
        font-size: 11px;
        padding: 10px 8px;
        min-height: 40px;
    }
    
    .nav-text,
    .nav-item > .nav-sublist > .nav-subitem .nav-text,
    .nav-item > .nav-sublist > .nav-subitem > .nav-sublist > .nav-subitem:not(.active) .nav-text {
        font-size: 11px;
    }
    
    .footer-logo {
        font-size: 16px;
    }
}

/* Search Results Inline Container Styles */
.faq-search-results {
    width: 100%;
    max-width: 100%;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    box-sizing: border-box;
}

.faq-search-results-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.faq-search-results-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.faq-search-results-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.faq-search-results-close:hover {
    background-color: #e9ecef;
    color: #333;
}

/* Responsive styles for search results */
@media (max-width: 768px) {
    .faq-search-results {
        border-radius: 8px;
        margin-top: 15px;
    }
    
    .faq-search-results-header {
        padding: 12px 15px;
    }
    
    .faq-search-results-title {
        font-size: 14px;
    }
    
    .faq-search-results-close {
        width: 26px;
        height: 26px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .faq-search-results {
        border-radius: 6px;
        margin-top: 12px;
    }
    
    .faq-search-results-header {
        padding: 10px 12px;
    }
    
    .faq-search-results-title {
        font-size: 13px;
    }
    
    .faq-search-results-close {
        width: 24px;
        height: 24px;
        font-size: 18px;
    }
}

/* Search Results List Wrapper Styles */
.faq-search-results-list-wrapper {
    max-height: 500px;
    overflow: auto;
}

/* Search Results List Styles */
.faq-search-results-list {
    padding: 20px;
    background-color: #fafbfc;
    box-sizing: border-box;
}

.faq-search-result-item {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: box-shadow 0.2s;
    box-sizing: border-box;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.faq-search-result-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.faq-search-result-item:last-child {
    margin-bottom: 0;
}

.faq-search-result-question {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 0;
    cursor: pointer;
    padding-bottom: 10px;
}

.faq-result-q-icon {
    background-color: #6f42c1;
    color: white;
    font-weight: 600;
    font-size: 14px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.faq-result-q-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
    flex: 1;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.faq-search-result-synonym {
    margin-left: 34px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.faq-search-result-answer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease-out;
    padding-left: 20px;
}

.faq-search-result-item.active .faq-search-result-answer {
    max-height: 1000px;
    opacity: 1;
    margin-top: 10px;
    transition: all 0.3s ease-in;
}

.faq-result-a-icon {
    background-color: #28a745;
    color: white;
    font-weight: 600;
    font-size: 14px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.faq-result-a-text {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
    flex: 1;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.faq-result-a-text p {
    margin: 0 0 10px 0;
}

.faq-result-a-text p:last-child {
    margin-bottom: 0;
}

/* No Results Message */
.faq-search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.faq-search-no-results p {
    margin: 10px 0;
    font-size: 14px;
}

.faq-search-no-results p:first-child {
    font-weight: 600;
    font-size: 15px;
    color: #333;
}

/* Error Message */
.faq-search-error {
    text-align: center;
    padding: 40px 20px;
    color: #d32f2f;
    background-color: #ffeaea;
    border-radius: 8px;
    margin: 10px 0;
}

.faq-search-error p {
    margin: 0;
    font-size: 14px;
}

/* Loading Styles */
.faq-search-loading {
    text-align: center;
    padding: 40px 20px;
}

.faq-search-loading-spinner {
    margin-bottom: 15px;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6f42c1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.faq-search-loading p {
    color: #666;
    font-size: 14px;
}

/* Pagination Styles */
.faq-search-pagination {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination-info {
    text-align: center;
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination-pages {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination-btn {
    background-color: var(--faq-pagination-inactive-bg, white);
    border: 1px solid #dee2e6;
    color: #333;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
}

.pagination-btn:hover:not([disabled]):not(.active) {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.pagination-btn.active {
    background-color: var(--faq-pagination-active-bg, #6f42c1);
    color: var(--faq-pagination-active-text, white);
    border-color: var(--faq-pagination-active-bg, #6f42c1);
    font-weight: 600;
    cursor: default;
}

.pagination-btn:disabled {
    background-color: #f8f9fa;
    color: #adb5bd;
    cursor: not-allowed;
    border-color: #dee2e6;
}

.pagination-ellipsis {
    padding: 8px 5px;
    color: #666;
    font-size: 14px;
}

/* Mobile responsive for search results */
@media (max-width: 768px) {
    .faq-search-results {
        border-radius: 8px;
        margin-top: 15px;
        max-width: 100%;
        overflow: hidden;
    }
    
    .faq-search-results-header {
        padding: 12px 16px;
    }
    
    .faq-search-results-title {
        font-size: 14px;
    }
    
    .faq-search-results-list-wrapper {
        max-height: 400px;
    }
    
    .faq-search-results-list {
        padding: 15px;
        max-height: 500px;
        overflow-x: hidden;
    }
    
    .faq-search-result-item {
        padding: 15px;
        margin-bottom: 12px;
        max-width: 100%;
    }
    
    .faq-result-q-text {
        font-size: 14px;
    }
    
    .faq-result-a-text {
        font-size: 13px;
    }
    
    .pagination-btn {
        padding: 6px 10px;
        font-size: 13px;
        min-width: 35px;
    }
    
    .pagination-info {
        font-size: 12px;
    }
}

/* Tag Links - Clickable tags in search results */
.faq-tag-link {
    cursor: pointer;
}

.faq-tag-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Inline search result tags (JavaScript generated) */
.faq-result-tag {
    cursor: pointer;
}

.faq-result-tag:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Responsive styles for search results list */
@media (max-width: 768px) {
    .faq-search-results-list {
        padding: 15px;
    }
    
    .faq-search-result-item {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .faq-result-q-icon,
    .faq-result-a-icon {
        width: 22px;
        height: 22px;
        font-size: 13px;
    }
    
    .faq-result-q-text {
        font-size: 15px;
    }
    
    .faq-result-a-text {
        font-size: 13px;
    }
    
    .faq-search-result-synonym {
        font-size: 12px;
        margin-left: 32px;
        margin-bottom: 12px;
    }
    
    .faq-search-result-answer {
        padding-left: 15px;
        gap: 8px;
    }
    
    .faq-search-no-results,
    .faq-search-error,
    .faq-search-loading {
        padding: 30px 15px;
    }
    
    .faq-search-no-results p,
    .faq-search-error p {
        font-size: 13px;
    }
    
    .faq-search-no-results p:first-child {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .faq-search-results-list {
        padding: 12px;
    }
    
    .faq-search-results-list-wrapper {
        max-height: none;
    }
    
    .faq-search-result-item {
        padding: 12px;
        margin-bottom: 10px;
        border-radius: 6px;
    }
    
    .faq-result-q-icon,
    .faq-result-a-icon {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    .faq-result-q-text {
        font-size: 14px;
    }
    
    .faq-result-a-text {
        font-size: 12px;
        line-height: 1.5;
    }
    
    .faq-search-result-synonym {
        font-size: 11px;
        margin-left: 30px;
        margin-bottom: 10px;
    }
    
    .faq-search-result-answer {
        padding-left: 10px;
        padding-top: 12px;
        gap: 6px;
    }
    
    .faq-search-result-question {
        gap: 8px;
        padding-bottom: 8px;
    }
    
    .faq-search-no-results,
    .faq-search-error,
    .faq-search-loading {
        padding: 25px 12px;
    }
    
    .faq-search-no-results p,
    .faq-search-error p {
        font-size: 12px;
    }
    
    .faq-search-no-results p:first-child {
        font-size: 13px;
    }
}

/* Responsive styles for search results page header and navigation */
@media (max-width: 768px) {
    .search-results-header {
        margin-bottom: 20px;
    }
    
    .search-results-title {
        font-size: 24px;
    }
    
    .search-results-meta {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .search-query-display {
        font-size: 15px;
    }
    
    .search-query-keyword {
        padding: 5px 10px;
        font-size: 13px;
    }
    
    .back-to-faq {
        padding: 8px 16px;
        font-size: 13px;
        width: auto;
        display: inline-flex;
    }
    
    .pagination-container {
        margin-top: 24px;
        gap: 6px;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .search-results-header {
        margin-bottom: 16px;
    }
    
    .search-results-title {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .search-results-meta {
        gap: 10px;
    }
    
    .search-query-display {
        font-size: 14px;
    }
    
    .search-query-keywords {
        gap: 6px;
    }
    
    .search-query-keyword {
        padding: 4px 8px;
        font-size: 12px;
        border-radius: 3px;
    }
    
    .back-to-faq {
        padding: 8px 14px;
        font-size: 12px;
        border-radius: 5px;
        margin-bottom: 12px;
        width: 100%;
        justify-content: center;
    }
    
    .pagination-container {
        margin-top: 20px;
        gap: 4px;
    }
}

@media (max-width: 375px) {
    .search-results-title {
        font-size: 18px;
    }
    
    .search-query-display {
        font-size: 13px;
    }
    
    .search-query-keyword {
        font-size: 11px;
        padding: 3px 7px;
    }
    
    .back-to-faq {
        font-size: 11px;
        padding: 7px 12px;
    }
}

/* Additional mobile overflow prevention */
@media (max-width: 768px) {
    .faq-container,
    .faq-main,
    .faq-content,
    .search-wrapper,
    .keywords-grid,
    .categories-grid,
    .questions-list,
    .faq-search-results {
        overflow-x: hidden;
    }
    
    /* Ensure images scale properly */
    .faq-content img,
    .faq-search-result-answer img,
    .question-content img,
    .faq-result-a-text img {
        max-width: min(100%, 400px);
        max-height: 400px;
        object-fit: contain;
        height: auto;
        display: block;
    }
    
    /* Prevent text overflow - comprehensive word breaking */
    .faq-title,
    .faq-subtitle,
    .section-title,
    .question-text,
    .question-content,
    .question-content p,
    .category-btn,
    .keyword-tag,
    .nav-text,
    .faq-result-q-text,
    .faq-result-a-text,
    .faq-result-a-text p,
    .search-result-question,
    .search-result-answer,
    .support-box,
    .faq-content * {
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        max-width: 100%;
    }
    
    /* Prevent long URLs from overflowing */
    .faq-content a,
    .question-content a,
    .faq-result-a-text a {
        word-break: break-all;
        overflow-wrap: break-word;
    }
    
    /* Ensure code blocks don't overflow */
    .faq-content pre,
    .faq-content code,
    .question-content pre,
    .question-content code,
    .faq-result-a-text pre,
    .faq-result-a-text code {
        max-width: 100%;
        overflow-x: auto;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    /* Ensure tables are responsive */
    .faq-content table,
    .question-content table,
    .faq-result-a-text table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Touch-friendly tap targets */
    .keyword-tag,
    .category-btn,
    .question-header,
    .nav-item-header,
    .search-button,
    .faq-mobile-menu-toggle {
        min-height: 44px;
        touch-action: manipulation;
    }
}

@media (max-width: 480px) {
    /* Reduce margins for very small screens */
    .faq-main > * {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Ensure proper spacing on mobile */
    .faq-sidebar,
    .faq-content {
        padding-left: 12px;
        padding-right: 12px;
    }
}
