/* ---- AI グローバル停止オーバーレイ ----------------------------------- */
.ai-suspended body {
    overflow: hidden;
}

.ai-suspend-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    text-align: center;
    padding: 24px;
    box-sizing: border-box;
    color: #fff;
}

.ai-suspend-overlay__content {
    max-width: 720px;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 12px;
    padding: 32px 40px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.ai-suspend-overlay__title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 16px;
}

.ai-suspend-overlay__message {
    font-size: 15px;
    line-height: 1.8;
    white-space: pre-line;
}
.ai-suspend-overlay__message a {
    color: #fff;
    text-decoration: underline;
}
.ai-suspend-overlay__message a:hover {
    color: #e5e7eb;
    text-decoration: none;
}

.ai-suspended .ai-layout {
    filter: grayscale(0.9);
    pointer-events: none;
    user-select: none;
}

/* おすすめ資料セクション */
.ai-reco-intro { margin: 10px 0 6px; }
.ai-reco-intro__inner { display:flex; align-items:center; gap:8px; }
.ai-reco-intro__label { font-size:12px; color:#6b7280; background:#f3f4f6; border:1px solid #e5e7eb; padding:2px 6px; border-radius:9999px; }
.ai-reco-intro__title { font-size:14px; color:var(--ai-foreground); font-weight:600; }

.ai-reco-cta { margin: 0 0 14px; }
.ai-reco { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid #e5e7eb; border-radius:10px; background:#fafafa; }
.ai-reco__text { color:#374151; font-size:13px; }

/* おすすめ資料まとめ表示 */
.ai-recommendations-summary {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(29,57,55,0.08) 0%, rgba(29,57,55,0.04) 100%);
    border-radius: 12px;
    border: 1px solid rgba(29,57,55,0.15);
    box-shadow: 0 4px 12px rgba(29,57,55,0.1);
}

.ai-recommendations-summary .ai-reco-intro {
    margin-bottom: 16px;
}

.ai-recommendations-summary .ai-reco-cta {
    margin-bottom: 8px;
}

.ai-recommendations-summary .ai-reco-cta:last-child {
    margin-bottom: 0;
}

/* おすすめ資料 2列レイアウト */
.ai-reco-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:8px}
.ai-reco-card{background:#fff;border:1px solid var(--ai-border);border-radius:10px;padding:10px;box-shadow:0 2px 8px rgba(0,0,0,0.06);height:auto;display:flex;align-items:center;justify-content:center}
.ai-reco-link--block{display:block;text-decoration:none;text-align:center;font-weight:700;font-size:16px;color:var(--ai-primary);transition:background-color 0.2s;}
[data-theme="dark"] .ai-reco-card{background:var(--ai-card)}
[data-theme="dark"] .ai-reco-link--block{color:#fff}
.ai-reco-intro__title{color:var(--ai-foreground)}
@media (max-width:768px){.ai-reco-grid{grid-template-columns:1fr}}


/* インライン資料紹介CTA（本文の合間に差し込む） */
.ai-inline-reco{margin:14px 0;padding:14px 16px;border:1px solid var(--ai-border);border-radius:12px;background:linear-gradient(135deg, rgba(29,57,55,0.06) 0%, rgba(29,57,55,0.02) 100%);display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;box-shadow:0 2px 8px rgba(0,0,0,0.06)}
.ai-inline-reco--alt{background:linear-gradient(135deg, rgba(29,57,55,0.1) 0%, rgba(29,57,55,0.04) 100%)}
.ai-inline-reco__text{font-size:13px;color:#374151}
.ai-inline-reco__btn{display:inline-block;padding:10px 14px;border-radius:12px;text-decoration:none;background:var(--ai-primary);color:var(--ai-primary-foreground);font-weight:700;box-shadow:0 2px 8px rgba(29,57,55,0.2)}
.ai-inline-reco__btn:hover{opacity:0.9}
[data-theme="dark"] .ai-inline-reco{background:rgba(255,255,255,0.06);border-color:var(--ai-border)}
[data-theme="dark"] .ai-inline-reco--alt{background:rgba(255,255,255,0.1)}

/* 外部リンクボタン（控えめなサイズ、固定幅） */
.ai-ext-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    padding: 1px 5px;
    margin: 0 1px;
    font-size: 10px;
    line-height: 1.2;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.2s ease;
    vertical-align: baseline;
    opacity: 0.85;
    /* 固定幅で統一感を保つ */
    min-width: 120px;
    max-width: 120px;
    height: 18px;
    box-sizing: border-box;
}

.ai-ext-link-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
    opacity: 1;
}

.ai-ext-link-btn i {
    font-size: 8px;
    opacity: 0.7;
    flex-shrink: 0;
}

.ai-ext-link-btn:hover i {
    opacity: 1;
}

.ai-ext-link-btn span {
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    text-align: left;
}

[data-theme="dark"] .ai-ext-link-btn {
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

[data-theme="dark"] .ai-ext-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: #d1d5db;
    opacity: 1;
}

/* おすすめリンクのためのaタグ用クラス（ベージュ/緑系統） */
.ai-reco-link{ display:inline-block; padding:8px 12px; border-radius:10px; text-decoration:none; margin:6px 6px 10px 0; font-weight:600 }

:root{--ai-background:#eee9e6;--ai-foreground:#1d3937;--ai-card:#1d3937;--ai-card-foreground:#eee9e6;--ai-popover:#eee9e6;--ai-popover-foreground:#1d3937;--ai-primary:#1d3937;--ai-primary-foreground:#eee9e6;--ai-secondary:#4b5563;--ai-secondary-foreground:#ffffff;--ai-muted:#b4ada9;--ai-muted-foreground:#1d3937;--ai-accent:#1d3937;--ai-accent-foreground:#eee9e6;--ai-destructive:#e53e3e;--ai-destructive-foreground:#ffffff;--ai-border:#b4ada9;--ai-input:#fffaf7;--ai-ring:#1d3937;--ai-sidebar:#1d3937;--ai-sidebar-foreground:#eee9e6;--ai-sidebar-primary:#1d3937;--ai-sidebar-primary-foreground:#eee9e6;--ai-sidebar-accent:#2a4a47;--ai-sidebar-accent-foreground:#eee9e6;--ai-sidebar-border:#2a4a47;--ai-sidebar-ring:#eee9e6}

/* ダークテーマ（チャコール×紫） */
[data-theme="dark"]{--ai-background:#0f1115;--ai-foreground:#e6e6ea;--ai-card:#1a1d24;--ai-card-foreground:#e6e6ea;--ai-popover:#1a1d24;--ai-popover-foreground:#e6e6ea;--ai-primary:#2b2e3a;--ai-primary-foreground:#c9a4ff;--ai-secondary:#3a3d47;--ai-secondary-foreground:#e6e6ea;--ai-muted:#2a2d38;--ai-muted-foreground:#c7c7d1;--ai-accent:#6e56cf;--ai-accent-foreground:#f3e9ff;--ai-destructive:#b42318;--ai-destructive-foreground:#fff;--ai-border:#2b2e39;--ai-input:#232634;--ai-ring:#6e56cf;--ai-sidebar:#151821;--ai-sidebar-foreground:#dcd8ff;--ai-sidebar-primary:#6e56cf;--ai-sidebar-primary-foreground:#1a1d24;--ai-sidebar-accent:#4d3aa6;--ai-sidebar-accent-foreground:#e6e6ea;--ai-sidebar-border:#2b2e39;--ai-sidebar-ring:#a08cff}
*{box-sizing:border-box}
body{margin:0;color:var(--ai-foreground);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji"}

.ai-layout{display:flex;min-height:100vh;background:var(--ai-background)}

/* Sidebar */
.ai-sidebar{width:260px;background:var(--ai-sidebar);color:var(--ai-sidebar-foreground);display:flex;flex-direction:column;justify-content:space-between;position:fixed;top:0;left:0;height:100vh;z-index:100;transition:width 0.3s ease;overflow:visible;box-shadow: 4px 0 20px rgba(29,57,55,0.3), 8px 0 40px rgba(29,57,55,0.15)}
.ai-sidebar::before{content:'';position:absolute;top:0;right:0;width:2px;height:100%;background:linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.1) 100%);z-index:1}
.ai-sidebar.collapsed{width:60px}

/* サイドバー閉じるボタン */
.ai-sidebar__top{padding:16px;padding-top:50px;display:flex;flex-direction:column;flex:1;overflow:hidden;min-height:0}
.ai-sidebar.collapsed .ai-sidebar__top{padding:12px 8px;padding-top:50px;display:flex;flex-direction:column}
.ai-sidebar__beta{position:absolute;top:8px;left:8px;font-size:12px;padding:0;border:none;border-radius:0;cursor:pointer;user-select:none;z-index:10;background:transparent;display:grid;place-items:center;transition:background-color 0.2s,width 0.2s,height 0.2s;width:36px;height:36px}
.ai-sidebar__beta:hover{background:rgba(255,255,255,.12)}
.ai-hamburger{position:relative;width:22px;height:16px;display:inline-flex;align-items:center;justify-content:center}
.ai-hamburger span{position:absolute;width:100%;height:2px;background:#fff;border-radius:2px;transition:transform 0.3s ease,opacity 0.3s ease,top 0.3s ease,width 0.3s ease,left 0.3s ease,right 0.3s ease;transform-origin:left center;left:0}
.ai-hamburger span:nth-child(1){top:0}
.ai-hamburger span:nth-child(2){top:7px}
.ai-hamburger span:nth-child(3){top:14px}
[data-theme="dark"] .ai-hamburger span{background:#fff}
.ai-sidebar:not(.collapsed) .ai-sidebar__beta:hover .ai-hamburger span{left:0;right:auto;transform-origin:left center}
.ai-sidebar:not(.collapsed) .ai-sidebar__beta:hover .ai-hamburger span:nth-child(1){top:7px;width:18px;transform:rotate(-45deg)}
.ai-sidebar:not(.collapsed) .ai-sidebar__beta:hover .ai-hamburger span:nth-child(2){top:7px;width:22px}
.ai-sidebar:not(.collapsed) .ai-sidebar__beta:hover .ai-hamburger span:nth-child(3){top:7px;width:18px;transform:rotate(45deg)}
.ai-sidebar.collapsed .ai-sidebar__beta:hover .ai-hamburger span{left:auto;right:0;transform-origin:right center}
.ai-sidebar.collapsed .ai-sidebar__beta:hover .ai-hamburger span:nth-child(1){top:7px;width:18px;transform:rotate(45deg)}
.ai-sidebar.collapsed .ai-sidebar__beta:hover .ai-hamburger span:nth-child(2){top:7px;width:22px}
.ai-sidebar.collapsed .ai-sidebar__beta:hover .ai-hamburger span:nth-child(3){top:7px;width:18px;transform:rotate(-45deg)}
.ai-sidebar__new{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;background:transparent;border:1px solid rgba(255,255,255,.7);border-radius:20px;color:#fff;cursor:pointer}
.ai-sidebar__new:hover{background:rgba(255,255,255,.1)}
.ai-sidebar__section{margin:18px 4px 8px;font-size:14px;opacity:.9;flex-shrink:0}
.ai-sidebar__nav{display:flex;flex-direction:column;gap:10px;overflow-y:auto;overflow-x:hidden;flex:1;min-height:0;padding-right:4px}
.ai-sidebar__nav::-webkit-scrollbar{width:6px}
.ai-sidebar__nav::-webkit-scrollbar-track{background:rgba(255,255,255,.1);border-radius:3px}
.ai-sidebar__nav::-webkit-scrollbar-thumb{background:rgba(255,255,255,.3);border-radius:3px}
.ai-sidebar__nav::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.4)}

/* タブスタイル */
.ai-tab{display:flex;align-items:center;justify-content:space-between;padding:6px 8px;margin-bottom:4px;border-radius:6px;cursor:pointer;transition:background-color 0.2s;position:relative}
.ai-tab:hover{background:rgba(255,255,255,.12)}
.ai-tab.active{background:rgba(255,255,255,.2)}
.ai-tab__title{flex:1;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:clip;max-width:calc(100% - 10px);line-height:1.3;transition:all 0.2s ease}
.ai-tab:hover .ai-tab__title{text-overflow:ellipsis;max-width:calc(100% - 20px)}
.ai-tab__menu{background:none;border:none;color:#fff;font-size:12px;cursor:pointer;padding:1px 3px;border-radius:3px;opacity:0;transition:opacity 0.2s}
.ai-tab:hover .ai-tab__menu{opacity:0.7}
.ai-tab__menu:hover{opacity:1;background:rgba(255,255,255,.2)}

/* タブメニュー（削除ボタン） */
.ai-tab-menu{
    position: fixed;
    background: rgba(60, 60, 60, 0.95);
    border-radius: 12px;
    padding: 8px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
    animation: slideUp 0.2s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 120px;
}

.ai-tab-menu__item{
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #fff;
    font-size: 14px;
    border-radius: 6px;
    margin: 0 4px;
}

.ai-tab-menu__item:hover{
    background: rgba(255, 255, 255, 0.1);
}

.ai-tab-menu__item--delete{
    color: #ff6b6b;
}

.ai-tab-menu__item--delete:hover{
    background: rgba(255, 107, 107, 0.1);
}

.ai-tab-menu__item i{
    width: 16px;
    height: 16px;
    color: inherit;
}
.ai-sidebar__bottom{
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.ai-sidebar.collapsed .ai-sidebar__bottom{
    padding: 12px 8px;
}

.ai-user{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    z-index: 200;
}

.ai-user:hover{
    background: rgba(255, 255, 255, 0.1);
}

.ai-user__avatar{
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: none;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
}

.ai-user__avatar img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-user__avatar i{
    font-size: 28px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-user__info{
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.ai-user__name{
    font-size: 18px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-user__status{
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.ai-user-menu{
    position: fixed;
    bottom: 16px;
    left: 256px;
    width: 200px;
    background: rgba(60, 60, 60, 0.95);
    border-radius: 12px;
    padding: 12px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    z-index: 1000;
    animation: slideUp 0.2s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.ai-user-menu__item{
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #fff;
    font-size: 14px;
    border-radius: 6px;
    margin: 0 8px;
    text-decoration: none;
}

.ai-user-menu__item:hover{
    background: rgba(255, 255, 255, 0.1);
}

.ai-user-menu__item i{
    width: 16px;
    height: 16px;
    color: #ccc;
}

/* 折りたたまれたサイドバーのスタイル */
.ai-sidebar.collapsed .ai-sidebar__beta{display:flex;left:50%;transform:translateX(-50%);top:8px}
.ai-sidebar.collapsed .ai-sidebar__new span:not(.ai-icon){display:none}
.ai-sidebar.collapsed .ai-sidebar__new{justify-content:center;padding:12px;margin-bottom:8px;border:none;background:transparent;width:auto;height:auto;border-radius:50%}
.ai-sidebar.collapsed .ai-sidebar__new:hover{background:rgba(255,255,255,.1);border-radius:50%}
.ai-sidebar.collapsed .ai-sidebar__section{display:none}
.ai-sidebar.collapsed .ai-sidebar__nav{display:none}
.ai-sidebar.collapsed .ai-tab__title{display:none}
.ai-sidebar.collapsed .ai-tab__menu{display:none}
.ai-sidebar.collapsed .ai-tab{justify-content:center;padding:8px 6px;margin-bottom:4px}
.ai-sidebar.collapsed .ai-user__info{display:none}
.ai-sidebar.collapsed .ai-user{justify-content:center;padding:12px 8px}
.ai-sidebar.collapsed .ai-user__avatar{width:32px;height:32px}
.ai-sidebar.collapsed .ai-user-menu{
    left: 76px;
    bottom: 16px;
    width: 200px;
}

/* 折りたたみ時のアイコン中央配置 */
.ai-sidebar.collapsed .ai-icon{
    margin: 0 auto;
}

/* Main */
.ai-main{flex:1;display:flex;flex-direction:column;background:var(--ai-background);margin-left:250px;transition:margin-left 0.3s ease;position:relative;height:100vh;overflow-y:auto;overflow-x:hidden}
.ai-main.sidebar-collapsed{margin-left:60px}
.ai-main::-webkit-scrollbar{width:10px}
.ai-main::-webkit-scrollbar-track{background:rgba(29,57,55,0.05);border-radius:5px}
.ai-main::-webkit-scrollbar-thumb{background:rgba(29,57,55,0.2);border-radius:5px}
.ai-main::-webkit-scrollbar-thumb:hover{background:rgba(29,57,55,0.3)}
.ai-header{height:64px;display:flex;align-items:center;padding:0 24px;flex-shrink:0}
.ai-logo{display:inline-flex;align-items:center;gap:8px;font-weight:800;font-size:18px;color:var(--ai-foreground);cursor:pointer;user-select:none}
.ai-logo__image{display:block;height:40px;width:auto;object-fit:contain}
.ai-logo__image--dark{display:none}
[data-theme="dark"] .ai-logo__image--light{display:none}
[data-theme="dark"] .ai-logo__image--dark{display:block}
.ai-logo:hover{opacity:0.8}

.ai-hero{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:0px 24px;min-height:calc(100vh - 250px);position:relative;overflow:auto;}
.ai-hero__title{font-size:28px;font-weight:800;margin:20px 0 28px;color:var(--ai-foreground);text-align:center}

/* 質問タイプ選択エリア */
.ai-question-type-selector{max-width:min(800px,70vw);margin:0 auto;width:100%}
.ai-question-type-options{display:flex;gap:20px;justify-content:center;flex-wrap:wrap;margin-bottom:32px}
.ai-question-type-option{flex:1;min-width:300px;max-width:400px;cursor:pointer}
.ai-question-type-card{background:var(--ai-card);color:var(--ai-card-foreground);border:3px solid var(--ai-border);border-radius:16px;padding:24px;transition:all 0.3s ease;position:relative;overflow:hidden;box-shadow:0 4px 12px rgba(0,0,0,0.1);opacity:0.7}
.ai-question-type-card:hover{border-color:var(--ai-primary);box-shadow:0 8px 20px rgba(29,57,55,0.2);transform:translateY(-2px)}
.ai-question-type-card::before{content:'';position:absolute;top:0;left:0;right:0;height:6px;background:var(--ai-border);transition:background-color 0.3s ease}
.ai-question-type-header{display:flex;align-items:center;gap:12px;margin-bottom:16px}
.ai-question-type-icon{display:flex;align-items:center;justify-content:center}
.ai-question-type-icon .ai-icon{width:32px;height:32px;background:var(--ai-primary)}
.ai-question-type-content{text-align:left}
.ai-question-type-title{font-size:20px;font-weight:700;margin:0;color:var(--ai-card-foreground)}
.ai-question-type-description{font-size:14px;line-height:1.5;color:var(--ai-card-foreground);opacity:0.8;margin:0}

/* 画面下部の説明エリア */
.ai-question-type-help{display:flex;justify-content:space-between;align-items:center;padding:24px;background:linear-gradient(135deg,rgba(29,57,55,0.08) 0%,rgba(29,57,55,0.04) 100%);border-radius:16px;border:1px solid rgba(29,57,55,0.15);gap:24px;box-shadow:0 4px 12px rgba(29,57,55,0.1)}
.ai-question-type-example-area{flex:1;max-width:70%}
.ai-question-type-example-label{font-size:15px;color:var(--ai-foreground);opacity:0.8;font-weight:600;margin-bottom:12px;display:block}
[data-theme="dark"] .ai-question-type-example-label{color:#ffffff;opacity:0.9}
.ai-question-type-example-text{font-size:14px;color:var(--ai-foreground);opacity:0.9;line-height:1.6}
.ai-question-type-template-area{flex:0 0 auto}
.ai-template-btn{display:flex;align-items:center;gap:8px;padding:12px 20px;background:linear-gradient(135deg,var(--ai-primary) 0%,var(--ai-accent) 100%);color:var(--ai-primary-foreground);border:none;border-radius:12px;font-size:14px;font-weight:600;cursor:pointer;transition:all 0.3s ease;box-shadow:0 4px 12px rgba(29,57,55,0.3)}
.ai-template-btn:hover{transform:translateY(-2px);box-shadow:0 6px 16px rgba(29,57,55,0.4)}
.ai-template-btn i{font-size:16px}

/* 例の内容スタイル */
.example-content{display:block}
.example-item{margin-bottom:16px;padding:12px 16px;background:rgba(255,255,255,0.7);border-radius:8px;border-left:4px solid var(--ai-primary);box-shadow:0 2px 8px rgba(29,57,55,0.1);color:var(--ai-primary);}
.example-item:last-child{margin-bottom:0}
.example-item strong{color:var(--ai-primary);font-weight:700}

/* Radioボタンのスタイル */
.ai-radio-input{position:absolute;opacity:0;pointer-events:none}
.ai-radio-input:checked + .ai-question-type-card{border-color:var(--ai-primary);border-width:4px;background:linear-gradient(135deg,var(--ai-primary) 0%,var(--ai-accent) 100%);color:var(--ai-primary-foreground);box-shadow:0 12px 24px rgba(29,57,55,0.4),0 0 0 2px rgba(29,57,55,0.1);transform:translateY(-3px);opacity:1}
.ai-radio-input:checked + .ai-question-type-card::before{background:var(--ai-primary-foreground);height:8px}
.ai-radio-input:checked + .ai-question-type-card .ai-question-type-icon .ai-icon{background:var(--ai-primary-foreground)}
.ai-radio-input:checked + .ai-question-type-card .ai-question-type-title{color:var(--ai-primary-foreground);font-weight:800}
.ai-radio-input:checked + .ai-question-type-card .ai-question-type-description{color:var(--ai-primary-foreground);opacity:0.9}
.ai-btn{display:inline-flex;align-items:center;gap:8px;border-radius:14px;padding:10px 16px;cursor:pointer;border:1px solid var(--ai-border);background:var(--ai-card);color:var(--ai-card-foreground);position:relative;overflow:hidden;box-shadow: 0 2px 8px rgba(0,0,0,0.1);z-index:1;transition: all 0.3s ease}
.ai-btn--ghost{border:1px solid var(--ai-border);box-shadow:0 1px 0 rgba(0,0,0,.04);background: rgba(29, 57, 55, 0.05);color: var(--ai-foreground)}
.ai-btn:hover{background:var(--ai-accent);transform: translateY(-1px);box-shadow: 0 4px 12px rgba(0,0,0,0.15)}

/* Icons */
.ai-icon{display:inline-block;width:18px;height:18px}
.ai-icon--pencil{background:linear-gradient( to bottom, #f5f2ef 0,#e6f1e2 100%);mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23000"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1.003 1.003 0 0 0 0-1.42l-2.34-2.34a1.003 1.003 0 0 0-1.42 0l-1.83 1.83 3.75 3.75 1.84-1.82z"/></svg>') center/contain no-repeat}
.ai-icon--doc{background:#6b7280;mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23000"><path d="M6 2h7l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm7 1.5V8h4.5L13 3.5z"/></svg>') center/contain no-repeat}
.ai-icon--search{background:#6b7280;mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23000"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zM9.5 14C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>') center/contain no-repeat}
.ai-icon--send{background:#f5f2ef;mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23000"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>') center/contain no-repeat;width:20px;height:20px}

/* チャット形式のスタイル */
.ai-chat-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-behavior: smooth;
    height: calc(100vh - 64px);
    min-height: 0;
}

.ai-chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
}

.ai-message {
    display: flex;
    margin-bottom: 16px;
    width: 100%;
}

.ai-message--user {
    justify-content: flex-end;
}

.ai-message--assistant {
    justify-content: flex-start;
    width: 100%;
}


.ai-message__content {
    max-width: 100%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
    position: relative;
    overflow: visible; /* 推薦カード展開時に枠が伸びるように */
}

.ai-message--user .ai-message__content {
    background: var(--ai-primary);
    color: var(--ai-primary-foreground);
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 8px rgba(29,57,55,0.2);
    z-index: 1;
    border-radius: 18px;
    max-width: 80%;
    margin-left: auto;
}

.ai-message--assistant .ai-message__content {
    background: transparent;
    color: var(--ai-foreground);
    border-bottom-left-radius: 4px;
    max-width: 100%;
    padding: 12px 16px; /* 余白を圧縮 */
    line-height: 1.5; /* 行間をやや詰める */
    font-size: 15px;
    position: relative;
    z-index: 1;
}

/* アシスタント文中の基本要素の余白をコンパクトに */
.ai-message--assistant .ai-message__content p {
    margin: 0.45em 0;
}

.ai-message--assistant .ai-message__content ul,
.ai-message--assistant .ai-message__content ol {
    margin: 0.45em 0;
    padding-left: 1.2em;
}

.ai-message--assistant .ai-message__content li {
    margin: 0.15em 0;
}

/* 先頭末尾の外側余白を詰める */
.ai-message--assistant .ai-message__content > *:first-child { margin-top: 0; }
.ai-message--assistant .ai-message__content > *:last-child { margin-bottom: 0; }


.ai-input-container {
    padding: 26px 20px;
    background: var(--ai-background);
    border-top: 1px solid var(--ai-border);
    position: sticky;
    bottom: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 50;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ai-input-disclaimer {
    margin-top: 12px;
    text-align: center;
    width: 100%;
    max-width: 768px;
}

.ai-input-disclaimer__text {
    font-size: 12px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.ai-input-disclaimer__text a {
    color: #666;
    text-decoration: underline;
}

.ai-input-disclaimer__text a:hover {
    color: var(--ai-primary, #007bff);
}

/* ダークモード対応 */
[data-theme="dark"] .ai-input-disclaimer__text {
    color: var(--ai-muted-foreground, #c7c7d1);
}

[data-theme="dark"] .ai-input-disclaimer__text a {
    color: var(--ai-muted-foreground, #c7c7d1);
}

[data-theme="dark"] .ai-input-disclaimer__text a:hover {
    color: var(--ai-sidebar-primary, #6e56cf);
}


/* ストリーミング表示用スタイル */
.streaming-cursor {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    color: var(--ai-primary);
    font-size: 14px;
}

.streaming-dots {
    display: inline-flex;
    gap: 2px;
}

.streaming-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ai-primary);
    animation: streamingPulse 1.4s ease-in-out infinite both;
}

.streaming-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.streaming-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.streaming-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes streamingPulse {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* ダークモード時のローディング表示（明るい色で視認性向上） */
[data-theme="dark"] .streaming-cursor {
    color: var(--ai-sidebar-primary, #6e56cf);
}

[data-theme="dark"] .streaming-dot {
    background: var(--ai-sidebar-primary, #6e56cf);
}

/* ストリーミング通知（ダークモード対応） */
.ai-streaming-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: rgba(34, 34, 34, 0.9);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    max-width: 280px;
    line-height: 1.6;
    transition: opacity 0.3s ease;
}

[data-theme="dark"] .ai-streaming-notice {
    background: rgba(110, 86, 207, 0.9);
    color: #fff;
    box-shadow: 0 4px 12px rgba(110, 86, 207, 0.4);
}

.streaming-content {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 15px;
}

/* モーダルスタイル */
.ai-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.ai-modal__content {
    position: relative;
    background: #f5f2ef;
    border-radius: 1.25rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 600px;
    width: 90%;
    max-height: 100vh;
    overflow-y: auto;
    border: 1px solid oklch(0.9 0.005 270);
}

.ai-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid oklch(0.9 0.005 270);
}

.ai-modal__header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: oklch(0.25 0.01 270);
    line-height: 1.4;
}

.ai-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: oklch(0.55 0.01 270);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.ai-modal__close:hover {
    color: oklch(0.25 0.01 270);
    background: oklch(0.95 0.01 240);
}

.ai-modal__body {
    padding: 1.5rem;
}

.ai-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid oklch(0.9 0.005 270);
}

/* 認証モーダル専用スタイル */
.ai-auth-modal {
    max-width: 38rem;
    width: 100%;
    padding: 2rem;
    border-radius: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: ai-modal-enter 0.2s ease-out;
}

@keyframes ai-modal-enter {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ai-auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.ai-auth-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: oklch(0.25 0.01 270);
    line-height: 1.6;
    margin: 0;
}

.ai-auth-divider {
    position: relative;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-auth-divider-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: oklch(0.9 0.005 270);
    transform: translateY(-50%);
}

.ai-auth-divider-text {
    background: #f5f2ef;
    padding: 0 1rem;
    font-size: 0.875rem;
    color: oklch(0.55 0.01 270);
    position: relative;
    z-index: 1;
}

.ai-auth-modal .ai-btn--register {
    width: 100%;
    height: 3rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    background: #ff6b35 !important;
    color: white !important;
    border: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ai-auth-modal .ai-btn--register:hover {
    background: #e55a2b !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.ai-auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: oklch(0.25 0.01 270);
}

.ai-input {
    width: 100%;
    height: 3rem;
    padding: 0 1rem;
    border: none;
    border-radius: 0.75rem;
    background: #f8f6f4;
    color: oklch(0.25 0.01 270);
    font-size: 1rem;
    line-height: 1.5;
    transition: all 0.2s ease;
    outline: none;
}

.ai-input:focus {
    background: #f5f2ef;
    box-shadow: 0 0 0 3px oklch(0.65 0.19 45 / 0.1);
}

.ai-input::placeholder {
    color: oklch(0.55 0.01 270);
}

.ai-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.ai-checkbox-input {
    width: 1rem;
    height: 1rem;
    accent-color: oklch(0.65 0.19 45);
    cursor: pointer;
}

.ai-checkbox-label {
    font-size: 0.875rem;
    color: oklch(0.25 0.01 270);
    cursor: pointer;
    user-select: none;
}

.ai-auth-modal .ai-btn--login {
    width: 100%;
    height: 3rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    background: #4fc3f7 !important;
    color: white !important;
    border: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ai-auth-modal .ai-btn--login:hover {
    background: #29b6f6 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.ai-forgot-password {
    text-align: center;
    padding-top: 0.5rem;
}

.ai-forgot-password a {
    color: oklch(0.52 0.15 240);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.ai-forgot-password a:hover {
    color: oklch(0.48 0.15 240);
    text-decoration: underline;
}

.ai-facebook-login {
    margin-top: 1.5rem;
}

.ai-btn--facebook {
    width: 100%;
    height: 3rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.75rem;
    background: #3b5998;
    color: white;
    border: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.ai-btn--facebook:hover {
    background: #344e86;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}


.ai-btn--primary {
    background: var(--ai-primary);
    color: var(--ai-primary-foreground);
    border: none;
}

.ai-btn--primary:hover {
    background: var(--ai-accent);
}

.ai-btn--primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ai-btn--secondary {
    background: var(--ai-card);
    color: var(--ai-card-foreground);
    border: 1px solid var(--ai-border);
}

.ai-btn--secondary:hover {
    background: var(--ai-accent);
}


/* レスポンシブ対応 */
@media (max-width: 768px) {
    .ai-sidebar{position:fixed;transform:translateX(-100%);transition:transform 0.3s ease}
    .ai-sidebar.mobile-open{transform:translateX(0)}
    .ai-main{margin-left:0}
    .ai-main.sidebar-collapsed{margin-left:0}

    .ai-question-type-options{flex-direction:column;gap:16px}
    .ai-question-type-option{min-width:auto;max-width:none}
    .ai-question-type-card{padding:20px}
    .ai-question-type-help{flex-direction:column;gap:20px;align-items:flex-start;padding:20px}
    .ai-question-type-example-area{max-width:100%}
    .ai-question-type-template-area{width:100%}
    .ai-template-btn{width:100%;justify-content:center}

    .ai-message--user .ai-message__content {
        max-width: 85%;
    }

    .ai-message--assistant .ai-message__content {
        padding: 16px 20px;
    }

    .ai-chat-container {
        padding: 16px;
    }

    .ai-input-container {
        padding: 16px;
    }
}

/* チャット画面の入力エリア（Material風） */
.ai-chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: var(--ai-input);
    border: none;
    border-radius: 12px;
    padding: 10px 12px;
    width: 100%;
    max-width: 768px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: box-shadow .2s ease, transform .1s ease;
    position: relative;
    overflow: hidden;
}

.ai-chat-input-wrapper:focus-within {
    box-shadow: 0 6px 10px rgba(0,0,0,.14), 0 1px 18px rgba(0,0,0,.12), 0 3px 5px rgba(0,0,0,.2), 0 0 0 1px var(--ai-ring);
}

.ai-chat-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.ai-chat-input__field {
    background: transparent;
    border: none;
    border-bottom: 2px solid #e0e0e0;
    color: var(--ai-foreground);
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    outline: none;
    min-height: 40px;
    max-height: 200px;
    font-family: inherit;
    padding: 8px 4px 6px 4px;
    transition: border-color .2s ease, background-color .2s ease;
}

.ai-chat-input__field:focus {
    border-bottom-color: var(--ai-ring);
    background-color: rgba(29,57,55,0.04);
}

.ai-chat-input__field::placeholder {color:#9aa6a1}


.ai-chat-input__send {
    background: var(--ai-primary);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--ai-primary-foreground);
    transition: background-color .2s ease, box-shadow .2s ease, transform .05s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,.2), 0 2px 6px rgba(0,0,0,.12), 0 4px 12px rgba(29,57,55,0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.ai-chat-input__send::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,.35);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width .25s ease, height .25s ease, opacity .35s ease;
    opacity: 0;
}

.ai-chat-input__send:active::after {
    width: 180%;
    height: 180%;
    opacity: 1;
}

.ai-chat-input__send:hover {background: var(--ai-accent)}

.ai-chat-input__send:disabled {background:#ccc;cursor:not-allowed;opacity:.6}


/* マークダウン要素のスタイル */
.ai-heading-1 {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0.8em 0 0.4em 0; /* 余白を圧縮 */
    color: var(--ai-foreground);
    border-bottom: 2px solid var(--ai-primary);
    padding-bottom: 0.2em;
}

.ai-heading-2 {
    font-size: 1.3em;
    font-weight: bold;
    margin: 1.2em 0 0.5em 0;
    padding-top: 0.8em;
    padding-bottom: 0.3em;
    color: var(--ai-foreground);
    border-top: 1px solid var(--ai-border);
    border-bottom: none;
}

.ai-heading-2:first-of-type,
.ai-heading-2:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0.7em;
}

.ai-heading-3 {
    font-size: 1.1em;
    font-weight: bold;
    margin: 1em 0 0.4em 0;
    padding-top: 0.6em;
    padding-bottom: 0.2em;
    color: var(--ai-foreground);
    border-top: 2px solid var(--ai-border);
    border-bottom: none;
}

.ai-heading-3:first-of-type,
.ai-heading-3:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0.6em;
}

.ai-heading-4 {
    font-size: 1em;
    font-weight: bold;
    margin: 0.5em 0 0.25em 0;
    color: var(--ai-foreground);
}

.ai-heading-bold {
    font-size: 1.5em;
    font-weight: bold;
    margin: 1em 0 0.6em 0;
    color: var(--ai-foreground);
    display: block;
    line-height: 1.4;
}

.ai-code-block {
    background: var(--ai-muted);
    border: 1px solid var(--ai-border);
    border-radius: 6px;
    padding: 0.8em; /* 余白を圧縮 */
    margin: 0.8em 0; /* 余白を圧縮 */
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

.ai-code-block code {
    background: none;
    padding: 0;
    border: none;
    font-family: inherit;
}

.ai-inline-code {
    background: var(--ai-muted);
    border: 1px solid var(--ai-border);
    border-radius: 3px;
    padding: 0.2em 0.4em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    color: var(--ai-muted-foreground);
}

.ai-list {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.ai-ordered-list {
    margin: 0.5em 0;
    padding-left: 1.5em;
    list-style-type: none; /* 番号表示を削除 */
}

.ai-checkbox-list {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.ai-list-item,
.ai-ordered-item,
.ai-checkbox-item {
    margin: 0.2em 0; /* 余白を圧縮 */
    line-height: 1.45; /* 少し詰める */
}

.ai-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.ai-checkbox-item input[type="checkbox"] {
    margin: 0;
    cursor: default;
}

.ai-link {
    color: var(--ai-primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-bottom-color 0.2s;
}

.ai-link:hover {
    border-bottom-color: var(--ai-primary);
    text-decoration: none;
}

.ai-link:visited {
    color: var(--ai-accent);
}

.ai-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 0.5em 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ai-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}

.ai-table-header {
    background: transparent;
    color: var(--ai-foreground);
    padding: 0.75em 0.5em;
    text-align: left;
    font-weight: 600;
    font-size: 1em;
    border-bottom: 1px solid var(--ai-border);
    border-top: none;
    border-left: none;
    border-right: none;
}

.ai-table-cell {
    padding: 0.75em 0.5em;
    border-bottom: 1px solid var(--ai-border);
    border-top: none;
    border-left: none;
    border-right: none;
    vertical-align: top;
    background: transparent;
}

.ai-table tr:last-child .ai-table-cell {
    border-bottom: none; /* 最後の行の下線を削除 */
}

/* 縦のボーダーを削除し、列の区切りはスペーシングのみ */
.ai-table th,
.ai-table td {
    border-left: none;
    border-right: none;
}

/* Light mode: シンプルなスタイル */
:root .ai-table {
    background: transparent;
}

:root .ai-table-header {
    background: transparent;
    color: #1f2937;
    border-bottom: 1px solid #6b7280; /* ヘッダー下線：細く・濃く */
}

:root .ai-table,
:root .ai-table-cell {
    color: #1f2937;
    background: transparent;
}

/* データ行間の下線：少し濃くして視認性向上 */
:root .ai-table-cell {
    border-bottom: 1px solid #9ca3af; /* トーンアップ */
}

/* 最後の行の下線：削除 */
:root .ai-table tr:last-child .ai-table-cell {
    border-bottom: none;
}

:root .ai-table tr:nth-child(even) {
    background: transparent;
}

/* Dark mode: シンプルなスタイル */
[data-theme="dark"] .ai-table {
    background: transparent;
}

[data-theme="dark"] .ai-table-header {
    background: transparent;
    color: #e6e6ea;
    border-bottom: 1px solid #6b7280; /* ヘッダー下線：細く・濃く */
}

[data-theme="dark"] .ai-table,
[data-theme="dark"] .ai-table-cell {
    color: #e6e6ea;
    background: transparent;
}

/* データ行間の下線：少し濃くして視認性向上 */
[data-theme="dark"] .ai-table-cell {
    border-bottom: 1px solid #4b5563; /* トーンアップ */
}

/* 最後の行の下線：削除 */
[data-theme="dark"] .ai-table tr:last-child .ai-table-cell {
    border-bottom: none;
}

[data-theme="dark"] .ai-table tr:nth-child(even) {
    background: transparent;
}

.ai-blockquote {
    border-left: 4px solid var(--ai-primary);
    padding-left: 0.75em; /* 余白を圧縮 */
    margin: 0.6em 0; /* 余白を圧縮 */
    color: var(--ai-muted-foreground);
    font-style: italic;
    background: rgba(29, 57, 55, 0.05);
    padding: 0.5em 0.8em; /* 余白を圧縮 */
    border-radius: 0 6px 6px 0;
}

.ai-blockquote-container {
    margin: 0.6em 0; /* 余白を圧縮 */
}

.ai-horizontal-rule {
    border: none;
    height: 2px;
    background: var(--ai-border);
    margin: 2em 0;
    border-radius: 1px;
}

.ai-strikethrough {
    text-decoration: line-through;
    opacity: 0.7;
}

.ai-underline {
    text-decoration: underline;
}

strong {
    font-weight: bold;
    color: var(--ai-foreground);
}

em {
    font-style: italic;
    color: var(--ai-muted-foreground);
}

/* 現在の質問形式表示 */
.ai-current-mode {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--ai-card);
    color: var(--ai-card-foreground);
    border: 1px solid var(--ai-border);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.ai-current-mode__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.ai-current-mode__text {
    white-space: nowrap;
}

/* ダークテーマでの調整 */
[data-theme="dark"] .ai-current-mode {
    background: var(--ai-card);
    color: var(--ai-card-foreground);
    border-color: var(--ai-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 推薦カード（画像左・テキスト中央・ボタン右） */
.ai-recommendations-summary {
    margin: 20px 0;
}

.ai-reco-intro__inner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.ai-reco-intro__label {
    display: inline-block;
    font-size: 12px;
    color: var(--ai-primary-foreground);
    background: var(--ai-primary);
    border-radius: 9999px;
    padding: 2px 8px;
}

.ai-reco-intro__title {
    font-weight: 600;
    color: var(--ai-foreground);
}

/* ダークモードでのおすすめ見出し */
[data-theme="dark"] .ai-reco-intro__label {
    background: var(--ai-sidebar-primary);
    color: #ffffff; /* 紫地に白文字でコントラストを最大化 */
}

[data-theme="dark"] .ai-reco-intro__title {
    color: var(--ai-foreground);
}

.ai-reco-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* インライン推薦カード（本文中に表示される） */
.ai-reco-inline {
    margin: 20px 0;
}

.ai-reco-inline__header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #333;
}

.ai-reco-inline__label {
    font-weight: 600;
}

.ai-reco-inline__arrow {
    color: #666;
    font-size: 10px;
}

.ai-reco-card {
    background: #fff;
    border: 1px solid #e6e6e9;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 16px;
    margin-bottom: 16px;
}

.ai-reco-card--row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.ai-reco-card__image-wrap {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 8px;
    background: #f6f7f9;
}

/* ダークモード時の画像ラッパーの背景色 */
[data-theme="dark"] .ai-reco-card__image-wrap {
    background: #2a2d38;
}

.ai-reco-card__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    display: block;
}

.ai-reco-card__body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.ai-reco-card__title {
    font-weight: 700;
    color: #222;
    line-height: 1.5;
    word-break: break-word;
    font-size: 16px;
    margin-bottom: 4px;
}

/* タイトル自体をテキストリンクに */
.ai-reco-title-link {
    color: #0b5bd3;
    text-decoration: underline;
}
.ai-reco-title-link:hover {
    opacity: .85;
}

.ai-reco-card__text {
    color: #444;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    margin: 8px 0 4px 0;
}

.ai-reco-card__read-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #006DDB;
    font-size: 14px;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0;
    margin: 4px 0 8px 0;
    cursor: pointer;
    transition: color 0.2s ease;
    align-self: flex-start;
}

.ai-reco-card__read-more:hover {
    color: #0052a3;
    text-decoration: underline;
}

.ai-reco-card__read-more i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.ai-reco-card__read-more:hover i {
    transform: translateY(2px);
}

.ai-reco-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ai-reco-card__meta {
    color: #999;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    white-space: nowrap;
}

/* 下部CTAボタン（資料紹介カード用） */
.ai-reco-card__cta-wrap {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
}

.ai-reco-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 40px;
    /* ライトモード：オレンジ系で視認性と訴求力を強化 */
    background: linear-gradient(135deg, #ff6b35 0%, #ff9f43 100%);
    color: #ffffff;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
    font-size: 18px;
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.4);
    transition: all 0.2s ease;
}

.ai-reco-card__cta:hover {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* ダークモード時のCTAボタン */
[data-theme="dark"] .ai-reco-card__cta {
    background: linear-gradient(135deg, var(--ai-sidebar-primary) 0%, var(--ai-accent) 100%);
    color: #ffffff; /* ボタン内テキストは白で明瞭に */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .ai-reco-card__cta:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.ai-reco-card__cta i {
    font-size: 12px;
}

/* ダークモード時の資料紹介カードのテキスト色 */
[data-theme="dark"] .ai-reco-card {
    background: var(--ai-card);
    border-color: var(--ai-border);
}

[data-theme="dark"] .ai-reco-card__title {
    color: #e6e6ea;
}

[data-theme="dark"] .ai-reco-card__text {
    color: #e6e6ea;
}

[data-theme="dark"] .ai-reco-card__read-more {
    color: #a08cff;
}

[data-theme="dark"] .ai-reco-card__read-more:hover {
    color: #c9a4ff;
}

[data-theme="dark"] .ai-reco-card__meta {
    color: #999;
}

@media (max-width: 640px) {
    .ai-reco-card {
        padding: 12px;
    }

    .ai-reco-card--row {
        flex-direction: column;
        gap: 12px;
    }

    .ai-reco-card__image-wrap {
        flex-basis: auto;
        width: 100%;
        height: 200px;
    }

    .ai-reco-card__image {
        width: 100%;
        height: 100%;
        min-width: auto;
        min-height: auto;
        object-fit: contain;
        object-position: center;
    }

    .ai-reco-card__body {
        padding-right: 0;
    }

    .ai-reco-card__footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .ai-reco-card__cta-wrap {
        width: 100%;
    }

    .ai-reco-card__cta {
        width: 100%;
        justify-content: center;
    }

    .ai-reco-card__meta {
        width: 100%;
        text-align: left;
    }
}

/* 見出しの上の線の色を調整（ライトモード） - 視認性向上のため濃く */
:root .ai-heading-2,
:root .ai-heading-3 {
    border-top-color: #9ca3af;
}

/* 見出しの上の線の色を調整（ダークモード） - 視認性向上のため濃く */
[data-theme="dark"] .ai-heading-2,
[data-theme="dark"] .ai-heading-3 {
    border-top-color: #4b5563;
}

