/* ========== HUB LAYOUT ========== */
html{height:auto!important;overflow-y:auto!important}
body.hub{background:#f1f5f9;font-family:'Noto Sans JP',sans-serif;color:#0f172a;min-height:100vh;height:auto!important;overflow-y:auto!important;overflow-x:hidden}
.hub-header{background:linear-gradient(135deg,#0f172a,#1e40af);color:#fff;padding:14px 28px;display:flex;justify-content:space-between;align-items:center;box-shadow:0 2px 10px rgba(0,0,0,.15)}
.hub-brand{display:flex;align-items:center;gap:12px}
.hub-brand-mark{font-size:30px}
.hub-brand-title{font-size:18px;font-weight:900}
.hub-brand-sub{font-size:11px;opacity:.8}
.hub-integ{display:flex;gap:8px}
.hub-integ .integ-pill{background:#ecfdf5;color:#065f46}
.hub-integ .integ-pill.integ-jocar{background:#fff7ed;color:#9a3412}

.hub-tabs{display:flex;gap:4px;padding:0 20px;background:#fff;border-bottom:1px solid #e2e8f0;overflow-x:auto}
.hub-tab{background:transparent;border:none;padding:14px 18px;font-size:13px;font-weight:700;color:#64748b;cursor:pointer;border-bottom:3px solid transparent;white-space:nowrap;font-family:inherit;transition:all .15s}
.hub-tab:hover{color:#0f172a;background:#f8fafc}
.hub-tab.active{color:#1e40af;border-bottom-color:#1e40af;background:#eff6ff}

.hub-main{padding:24px 28px;max-width:1400px;margin:0 auto}
.tab-panel{display:none}
.tab-panel.active{display:block;animation:fade-in .3s}
@keyframes fade-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}

.pain-banner{background:linear-gradient(135deg,#fef3c7,#fef9c3);border-left:5px solid #eab308;border-radius:8px;padding:16px 20px;margin-bottom:20px;box-shadow:0 1px 3px rgba(0,0,0,.05)}
.pain-title{font-size:12px;color:#92400e;font-weight:700;margin-bottom:4px}
.pain-text{font-size:15px;color:#0f172a;font-weight:700;margin-bottom:6px}
.pain-answer{font-size:13px;color:#1e40af;line-height:1.7}

.demo-card{background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:14px 18px;margin-bottom:16px}
.demo-card-title{font-size:13px;font-weight:700;margin-bottom:8px;color:#0f172a}
.demo-steps{padding-left:22px;font-size:13px;color:#334155;line-height:1.9}

/* Mini chat (Tab1) */
.mini-chat{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:16px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.mini-q-list{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px;padding-bottom:14px;border-bottom:1px dashed #cbd5e1}
.mini-q{background:#eff6ff;color:#1e40af;border:1px solid #bfdbfe;border-radius:999px;padding:6px 12px;font-size:12px;cursor:pointer;font-family:inherit;font-weight:600}
.mini-q:hover{background:#dbeafe}
.mini-chat-log{min-height:240px;display:flex;flex-direction:column;gap:12px}

/* JOCAR layout (Tab2) */
.jocar-layout{display:grid;grid-template-columns:340px 1fr;gap:16px}
.jocar-inbox{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:14px}
.jocar-inbox-title{font-size:13px;font-weight:700;color:#9a3412;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid #fed7aa}
.jocar-workspace{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:20px;min-height:400px}
.jocar-empty{color:#94a3b8;text-align:center;padding:80px 0;line-height:1.8;font-size:13px}

/* Structure (Tab3) */
.structure-layout{display:grid;grid-template-columns:1fr 360px;gap:16px}
.structure-diagram{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:20px}
.sd-caption{font-size:12px;color:#475569;margin-bottom:8px;font-weight:600}
.structure-svg{width:100%;height:auto;cursor:default}
.part-hot{cursor:pointer;transition:opacity .2s}
.part-hot:hover rect{fill-opacity:.9;stroke-dasharray:none}
.structure-panel{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:20px;min-height:400px}
.sp-empty{color:#94a3b8;text-align:center;padding:80px 0;line-height:1.8;font-size:13px}
.sp-title{font-size:17px;font-weight:900;color:#0f172a;margin-bottom:4px}
.sp-sub{font-size:11px;color:#64748b;margin-bottom:12px}
.sp-section{margin-bottom:14px}
.sp-h{font-size:12px;font-weight:700;color:#1e40af;margin-bottom:6px}
.sp-body{font-size:13px;color:#334155;line-height:1.7}
.sp-related{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.sp-related span{background:#f1f5f9;border:1px solid #cbd5e1;border-radius:4px;padding:3px 8px;font-size:11px}
.sp-tip{background:#fef3c7;border-left:3px solid #eab308;padding:8px 10px;border-radius:4px;font-size:12px;color:#78350f;line-height:1.6}

/* Tutor (Tab4) */
.tutor-layout{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:20px}
.tutor-steps{display:flex;gap:6px;margin-bottom:20px}
.tutor-step{flex:1;background:#f1f5f9;border:1px solid #cbd5e1;border-radius:6px;padding:10px 12px;display:flex;gap:10px;align-items:center;font-size:12px;color:#64748b}
.tutor-step.active{background:#1e40af;color:#fff;border-color:#1e40af}
.tutor-step.done{background:#dcfce7;color:#166534;border-color:#86efac}
.ts-num{width:22px;height:22px;border-radius:50%;background:#cbd5e1;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:11px}
.tutor-step.active .ts-num{background:#fff;color:#1e40af}
.tutor-step.done .ts-num{background:#16a34a;color:#fff}
.tutor-stage{min-height:320px;padding:16px;background:#f8fafc;border-radius:8px;margin-bottom:14px}
.tutor-msg{margin-bottom:12px}
.tutor-msg.ai{background:#eff6ff;border-left:3px solid #1e40af;padding:10px 14px;border-radius:6px}
.tutor-msg.user{background:#fff;border:1px solid #cbd5e1;padding:10px 14px;border-radius:6px;margin-left:40px}
.tutor-msg.ai b{color:#1e40af}
.tutor-choices{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.tutor-choice{background:#fff;border:1px solid #cbd5e1;border-radius:6px;padding:8px 14px;font-size:12px;cursor:pointer;font-family:inherit}
.tutor-choice:hover{background:#eff6ff;border-color:#1e40af}
.tutor-choice.selected{background:#1e40af;color:#fff;border-color:#1e40af}
.tutor-warn{background:#fee2e2;border-left:3px solid #dc2626;padding:10px 14px;border-radius:6px;color:#991b1b;font-size:12px;margin-top:8px}
.tutor-ok{background:#dcfce7;border-left:3px solid #16a34a;padding:10px 14px;border-radius:6px;color:#166534;font-size:12px;margin-top:8px}
.tutor-nav{display:flex;justify-content:space-between;gap:8px}
.tutor-btn{background:#fff;border:1px solid #cbd5e1;border-radius:6px;padding:10px 18px;font-size:13px;font-weight:700;cursor:pointer;font-family:inherit}
.tutor-btn:hover{background:#f1f5f9}
.tutor-btn-primary{background:#1e40af;color:#fff;border-color:#1e40af}
.tutor-btn-primary:hover{background:#1e3a8a}
.tutor-btn:disabled{opacity:.4;cursor:default}

/* Catalog (Tab5) */
.catalog-searchbar{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:16px;margin-bottom:16px}
.cs-input-wrap{display:flex;gap:8px;margin-bottom:6px}
.cs-input-wrap input{flex:1;padding:10px 14px;border:1px solid #cbd5e1;border-radius:6px;font-size:14px;font-family:inherit;outline:none}
.cs-input-wrap input:focus{border-color:#1e40af}
.cs-btn{background:#1e40af;color:#fff;border:none;border-radius:6px;padding:10px 20px;font-weight:700;cursor:pointer;font-family:inherit}
.cs-btn:hover{background:#1e3a8a}
.cs-sources{font-size:11px;color:#64748b;margin-top:6px}
.catalog-result{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:20px}
.cs-empty{color:#94a3b8;text-align:center;padding:40px 0}
.cs-samples{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.cs-sample{background:#eff6ff;color:#1e40af;border:1px solid #bfdbfe;border-radius:999px;padding:6px 12px;font-size:12px;cursor:pointer;font-family:inherit;font-weight:600}
.cs-sample:hover{background:#dbeafe}
.catalog-table{width:100%;border-collapse:collapse;font-size:13px}
.catalog-table th{background:#f1f5f9;padding:10px 12px;text-align:left;border-bottom:2px solid #cbd5e1;color:#475569;font-size:11px}
.catalog-table td{padding:12px;border-bottom:1px solid #e2e8f0;vertical-align:middle}
.catalog-table tr:hover{background:#f8fafc}
.ct-maker{font-weight:700;color:#0f172a}
.ct-oem{background:#dbeafe;color:#1e40af;border-radius:4px;padding:2px 6px;font-size:10px;margin-left:6px;font-weight:700}
.ct-optimized{background:#dcfce7;color:#166534;border-radius:4px;padding:2px 6px;font-size:10px;margin-left:6px;font-weight:700}
.ct-price{font-weight:700;font-family:'Roboto Mono',monospace;color:#0f172a}
.ct-stock-ok{color:#16a34a;font-weight:700}
.ct-stock-low{color:#ea580c;font-weight:700}
.ct-stock-ng{color:#dc2626;font-weight:700}
.ct-recommend{background:#fef3c7;color:#92400e;border-radius:4px;padding:2px 6px;font-size:10px;margin-left:4px;font-weight:700}

/* Maker (Tab6) */
.maker-searchbar{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:16px;margin-bottom:16px}
.ms-q{display:flex;gap:10px;align-items:center}
.ms-q select{flex:1;padding:10px 14px;border:1px solid #cbd5e1;border-radius:6px;font-size:13px;font-family:inherit}
.ms-btn{background:#1e40af;color:#fff;border:none;border-radius:6px;padding:10px 20px;font-weight:700;cursor:pointer;font-family:inherit}
.ms-btn:hover{background:#1e3a8a}
.maker-result{background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:20px}
.maker-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px;margin-bottom:20px}
.maker-card{border:2px solid #e2e8f0;border-radius:10px;padding:14px;background:#fff;position:relative}
.maker-card.top{border-color:#16a34a;box-shadow:0 4px 12px rgba(22,163,74,.15)}
.maker-card.top::before{content:'👑 一番のオススメ';position:absolute;top:-10px;left:12px;background:#16a34a;color:#fff;padding:3px 10px;border-radius:999px;font-size:11px;font-weight:700}
.mc-name{font-size:16px;font-weight:900;color:#0f172a;margin-bottom:4px}
.mc-rating{color:#eab308;font-size:14px;margin-bottom:8px}
.mc-rating small{color:#64748b;margin-left:6px;font-size:11px}
.mc-fields{font-size:12px;color:#334155;line-height:1.8;margin-bottom:8px}
.mc-fields b{color:#0f172a}
.mc-why{background:#f0fdf4;border-left:3px solid #16a34a;padding:6px 10px;border-radius:4px;font-size:11px;color:#166534;line-height:1.6}
.mc-ng{background:#fee2e2;border-left:3px solid #dc2626;padding:6px 10px;border-radius:4px;font-size:11px;color:#991b1b;line-height:1.6}
.maker-expert{background:linear-gradient(135deg,#faf5ff,#ede9fe);border:1px solid #ddd6fe;border-left:5px solid #7c3aed;padding:14px 18px;border-radius:8px}
.me-h{font-weight:700;color:#5b21b6;font-size:13px;margin-bottom:6px}
.me-body{font-size:13px;color:#334155;line-height:1.7}
.me-src{font-size:11px;color:#64748b;margin-top:6px}

/* Reusable bits */
.product-image-lg{width:160px;height:100px;background:linear-gradient(135deg,#f1f5f9,#e2e8f0);border:1px solid #cbd5e1;border-radius:8px;padding:8px}
.product-image-lg svg{width:100%;height:100%}

.pm-actions-row{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.pm-btn{border:none;border-radius:6px;padding:9px 16px;font-size:12px;font-weight:700;cursor:pointer;font-family:inherit;display:inline-flex;align-items:center;gap:6px}
.pm-btn-primary{background:#16a34a;color:#fff}
.pm-btn-primary:hover{background:#15803d}
.pm-btn-secondary{background:#fff;color:#0f172a;border:1px solid #cbd5e1}
.pm-btn-secondary:hover{background:#f1f5f9}

.hub-toast{position:fixed;bottom:24px;right:24px;background:#0f172a;color:#fff;padding:14px 20px;border-radius:8px;font-size:13px;box-shadow:0 10px 25px rgba(0,0,0,.25);z-index:9999;animation:toast-in .3s;max-width:360px;line-height:1.6}

.live-badge{display:inline-block;background:#dcfce7;color:#166534;border:1px solid #86efac;border-radius:4px;padding:2px 8px;font-size:10px;font-weight:700;margin-left:6px;vertical-align:middle}
.live-badge.warn{background:#fef3c7;color:#854d0e;border-color:#fcd34d}
.live-badge.ng{background:#fee2e2;color:#991b1b;border-color:#fca5a5}

/* Chat bubble reuse in T1 */
.mc-msg{display:flex;gap:10px;margin-bottom:10px}
.mc-avatar{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,#1e40af,#2563eb);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;flex-shrink:0}
.mc-msg.user .mc-avatar{background:#fbbf24;color:#78350f}
.mc-bubble{background:#f1f5f9;padding:12px 14px;border-radius:10px;font-size:13px;line-height:1.7;flex:1}
.mc-msg.user .mc-bubble{background:#eff6ff;color:#0f172a}
.mc-fields-block{background:#fff;border:1px solid #e2e8f0;border-radius:6px;padding:8px 12px;margin-top:8px}
.mc-field-row{display:flex;justify-content:space-between;padding:3px 0;font-size:12px;border-bottom:1px dashed #e2e8f0}
.mc-field-row:last-child{border-bottom:none}
.mc-field-row span:first-child{color:#64748b}
.mc-field-row span:last-child{font-weight:600;color:#0f172a}
.mc-cite{font-size:10px;color:#64748b;margin-top:6px}

/* ==========================================================
   WORKFLOW DIAGRAM (背景ワークフロー可視化 - dark theme)
   ========================================================== */
.workflow{margin-top:28px;background:#0f0f1a;background-image:radial-gradient(circle,rgba(255,255,255,.04) 1px,transparent 1px);background-size:18px 18px;border-radius:12px;padding:24px;color:#e0e0f0;position:relative;overflow:hidden;border:1px solid #3a3a5c}
.wf-hd{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px}
.wf-hd-title{font-size:13px;font-weight:700;color:#a78bfa;letter-spacing:.04em}
.wf-hd-title::before{content:'⚙ ';}
.wf-hd-sub{font-size:11px;color:#8b8ba8}
.wf-caption{font-size:12px;color:#c7c7e0;margin-bottom:18px;line-height:1.7}
.wf-caption b{color:#a78bfa}

.wf-canvas{display:flex;flex-direction:column;gap:22px;padding:6px 0}
.wf-row{display:flex;gap:40px;justify-content:center;align-items:stretch;flex-wrap:wrap;position:relative}
.wf-row.tight{gap:24px}
.wf-row.spread{gap:28px}

.wf-node{width:210px;background:#1e1e32;border:2px solid #3a3a5c;border-radius:10px;padding:10px 12px;position:relative;transition:all .3s}
.wf-node:hover{border-color:#6c5ce7;transform:translateY(-2px)}
.wf-node .wf-h{display:flex;gap:8px;align-items:center;margin-bottom:6px}
.wf-node .wf-ico{width:30px;height:30px;border-radius:8px;background:#2d2d4a;display:flex;align-items:center;justify-content:center;font-size:16px;flex-shrink:0}
.wf-node .wf-t{font-size:12px;font-weight:700;color:#e0e0f0;line-height:1.3}
.wf-node .wf-d{font-size:10.5px;color:#8b8ba8;line-height:1.55;margin-bottom:6px}
.wf-node .wf-out{display:flex;flex-wrap:wrap;gap:4px}
.wf-node .wf-out span{background:#2d2d4a;border:1px solid #3a3a5c;color:#a78bfa;border-radius:3px;padding:1px 6px;font-size:9.5px;font-family:'Roboto Mono',monospace}
.wf-node .wf-status{position:absolute;top:-9px;right:-9px;width:22px;height:22px;border-radius:50%;background:#3a3a5c;border:2px solid #0f0f1a;display:flex;align-items:center;justify-content:center;font-size:11px;color:#fff}

/* Node type color tints */
.wf-node.input .wf-ico{background:#1e3a8a}
.wf-node.ai .wf-ico{background:#5b21b6}
.wf-node.db .wf-ico{background:#075985}
.wf-node.integ .wf-ico{background:#14532d}
.wf-node.out .wf-ico{background:#78350f}

/* Arrows between rows using pseudo connectors */
.wf-arrow{display:flex;justify-content:center;align-items:center;height:28px;position:relative}
.wf-arrow::before{content:'';width:2px;height:100%;background:linear-gradient(to bottom,#6c5ce7 0,#6c5ce7 50%,transparent 50%,transparent 100%);background-size:2px 8px;animation:dash-v 1s linear infinite}
.wf-arrow::after{content:'▼';color:#6c5ce7;position:absolute;bottom:-2px;font-size:10px}
@keyframes dash-v{from{background-position:0 0}to{background-position:0 16px}}

/* Horizontal connector (fan in/out) */
.wf-fanline{position:absolute;left:50%;top:-22px;transform:translateX(-50%);width:70%;height:22px;border-top:2px solid #6c5ce7;border-left:2px solid #6c5ce7;border-right:2px solid #6c5ce7;border-radius:8px 8px 0 0;opacity:.6}

.wf-legend{display:flex;gap:14px;flex-wrap:wrap;margin-top:16px;padding-top:14px;border-top:1px solid #2d2d4a;font-size:10.5px;color:#8b8ba8}
.wf-legend span{display:inline-flex;align-items:center;gap:6px}
.wf-legend .dot{width:10px;height:10px;border-radius:3px}
.wf-legend .dot.input{background:#1e3a8a}
.wf-legend .dot.ai{background:#5b21b6}
.wf-legend .dot.db{background:#075985}
.wf-legend .dot.integ{background:#14532d}
.wf-legend .dot.out{background:#78350f}

.wf-badge-pulse{animation:wf-pulse 1.8s infinite}
@keyframes wf-pulse{0%,100%{box-shadow:0 0 0 0 rgba(108,92,231,.6)}50%{box-shadow:0 0 0 6px rgba(108,92,231,0)}}
