.ud-wrapper {
    font-family: inherit;
    max-width: 760px;
}

.ud-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ud-category-label {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #0d6efd;
}

.ud-toggle-btn {
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
}

.ud-toggle-btn i {
    margin-right: 6px;
}

.ud-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
}

.ud-sidebar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 160px;
    flex-shrink: 0;
}

.ud-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    border: none;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color: #333;
    width: 100%;
}

.ud-tab-btn i {
    width: 16px;
    font-size: 13px;
}

.ud-tab-btn.active {
    background: var(--ud-accent, #0d6efd);
    color: #fff;
}

.ud-content {
    flex: 1;
    min-width: 0;
}

.ud-category-block {
    display: none;
    margin-bottom: 18px;
}

.ud-category-block.active {
    display: block;
}

.ud-header-card,
.ud-header-plain {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

/* リンクあり見出し = 「ボタン」 */
.ud-header-card {
    border-radius: 10px;
    padding: 9px 12px;
    margin-bottom: 6px;
    background: var(--ud-bg, #fff);
    border: 2px solid var(--ud-accent, #0d6efd);
}

/* リンクなし見出し = 「見出しテキスト」(ボタンと形を分ける) */
.ud-header-plain {
    padding: 4px 2px 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
    color: #555;
}

.ud-header-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--ud-accent, #0d6efd);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
}

.ud-header-icon.plain {
    width: auto;
    height: auto;
    background: none;
    color: var(--ud-accent, #666);
    font-size: 15px;
}

.ud-header-label {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    flex: 1;
}

.ud-header-plain .ud-header-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--ud-accent, #555);
}

.ud-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 160px));
    justify-content: flex-start;
    gap: 6px;
}

.ud-item-card {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    background: var(--ud-bg, #f8f9fa);
    border-radius: 10px;
    padding: 8px 10px;
    text-decoration: none;
    color: #222;
    font-size: 13px;
}

.ud-item-card i {
    width: 18px;
    font-size: 14px;
    color: var(--ud-accent, #0d6efd);
}

/* カテゴリ配色(パステル背景 + 濃色アクセントの2トーン) */
.color-blue {
    --ud-bg: #E3F2FD;
    --ud-accent: #1565C0;
}

.color-skyblue {
    --ud-bg: #E1F5FE;
    --ud-accent: #0277BD;
}

.color-teal {
    --ud-bg: #E0F2F1;
    --ud-accent: #00796B;
}

.color-orange {
    --ud-bg: #FFF3E0;
    --ud-accent: #EF6C00;
}

.color-purple {
    --ud-bg: #F3E5F5;
    --ud-accent: #6A1B9A;
}

.color-pink {
    --ud-bg: #FCE4EC;
    --ud-accent: #C2185B;
}

.color-indigo {
    --ud-bg: #E8EAF6;
    --ud-accent: #283593;
}

.color-green {
    --ud-bg: #E8F5E9;
    --ud-accent: #2E7D32;
}

.color-gray {
    --ud-bg: #F5F5F5;
    --ud-accent: #616161;
}

.color-brown {
    --ud-bg: #EFEBE9;
    --ud-accent: #6D4C41;
}

/* すべて表示モード: サイドバーは非表示にして1カラムで展開 */
.ud-layout.show-all .ud-sidebar {
    display: none;
}

.ud-layout.show-all .ud-content {
    width: 100%;
}

.ud-layout.show-all .ud-category-block {
    display: block !important;
}

/* スマホ対応: タブ表示時のサイドバーを横スクロールのチップ列に */
@media (max-width: 600px) {
    .ud-layout {
        flex-direction: column;
    }

    .ud-layout:not(.show-all) .ud-sidebar {
        flex-direction: row;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .ud-layout:not(.show-all) .ud-tab-btn {
        width: auto;
        flex-shrink: 0;
    }
}

/* スクロールの説明 */
.ud-scroll-hint {
    display: none;
}

@media (max-width: 600px) {
    .ud-layout:not(.show-all) .ud-scroll-hint {
        display: block;
        width: 100%;
        text-align: center;
        font-size: 11px;
        color: #e83e8c;
        margin: 2px 0 10px;
    }
}