* { font-family: 'Noto Sans JP', sans-serif; margin:0; padding:0; box-sizing:border-box; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
body { background: #f1f5f9; color: #1e293b; }
.page { display: none; }
.page.active { display: block; }
.nav-item.active { background: rgba(255,255,255,0.15); border-left: 3px solid #fff; }
.nav-item { border-left: 3px solid transparent; transition: background 0.15s; }
.card { background: #fff; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-card:hover { transform: translateY(-2px); transition: transform 0.15s; }
.badge { display:inline-flex; align-items:center; padding:2px 10px; border-radius:9999px; font-size:12px; font-weight:500; }
.fade-in { animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
.modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.45); z-index:50; align-items:center; justify-content:center; }
.modal-overlay.show { display:flex; }
table.dt { width:100%; border-collapse:separate; border-spacing:0; }
table.dt th { background:#f8fafc; font-weight:500; font-size:12px; color:#64748b; text-transform:uppercase; letter-spacing:0.04em; padding:10px 14px; text-align:left; border-bottom:1px solid #e2e8f0; }
table.dt td { padding:11px 14px; border-bottom:1px solid #f1f5f9; font-size:13px; }
table.dt tr:hover td { background:#f8fafc; }
.chat-bubble { max-width:80%; padding:10px 16px; border-radius:16px; font-size:13px; line-height:1.6; }
.chat-bubble.user { background:#3b82f6; color:#fff; border-bottom-right-radius:4px; }
.chat-bubble.ai { background:#f1f5f9; color:#1e293b; border-bottom-left-radius:4px; }
.typing-dot { animation:blink 1.4s infinite both; width:6px; height:6px; background:#94a3b8; border-radius:50%; display:inline-block; }
.typing-dot:nth-child(2) { animation-delay:0.2s; }
.typing-dot:nth-child(3) { animation-delay:0.4s; }
@keyframes blink { 0%,80%,100%{opacity:0} 40%{opacity:1} }
.tab-btn { padding:6px 14px; border-radius:8px; font-size:12px; cursor:pointer; border:none; background:#f1f5f9; color:#64748b; }
.tab-btn.active { background:#3b82f6; color:#fff; }
input,select,textarea { font-family:'Noto Sans JP',sans-serif; }
.btn-primary { padding:6px 16px; background:#3b82f6; color:#fff; border:none; border-radius:8px; font-size:13px; cursor:pointer; }
.btn-primary:hover { background:#2563eb; }
.btn-secondary { padding:6px 16px; background:#fff; color:#374151; border:1px solid #d1d5db; border-radius:8px; font-size:13px; cursor:pointer; }
.btn-sm { padding:4px 10px; font-size:12px; border-radius:6px; cursor:pointer; border:none; }
.input-field { width:100%; border:1px solid #d1d5db; border-radius:8px; padding:8px 12px; font-size:13px; outline:none; }
.input-field:focus { border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,0.1); }

/* ===== n8n Workflow Section ===== */
.wf-section{margin-top:24px;background:#1a1a2e;border-radius:16px;overflow:hidden;border:1px solid #3a3a5c}
.wf-header{background:#1e1e32;border-bottom:1px solid #3a3a5c;padding:12px 20px;display:flex;align-items:center;justify-content:space-between}
.wf-header-left{display:flex;align-items:center;gap:10px}
.wf-header-logo{width:28px;height:28px;background:#6c5ce7;border-radius:6px;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:12px;color:#fff}
.wf-header h3{font-size:13px;font-weight:600;color:#e0e0f0;margin:0}
.wf-header-right{display:flex;align-items:center;gap:10px}
.wf-timer{font-family:ui-monospace,monospace;font-size:12px;color:#8888aa;min-width:50px;text-align:right}
.wf-timer.active{color:#ffb74d}
.wf-timer.done{color:#00d68f}
.wf-status{padding:3px 10px;border-radius:10px;font-size:11px;font-weight:600;color:#8888aa;border:1px solid #3a3a5c}
.wf-status.running{color:#ffb74d;border-color:rgba(255,183,77,.5);background:rgba(255,183,77,.1);animation:wf-badge-pulse 1.5s infinite}
.wf-status.done{color:#00d68f;border-color:rgba(0,214,143,.4);background:rgba(0,214,143,.1)}
@keyframes wf-badge-pulse{0%,100%{opacity:1}50%{opacity:.7}}
.wf-run-btn{background:#6c5ce7;color:#fff;border:none;padding:7px 18px;border-radius:6px;font-size:12px;font-weight:600;cursor:pointer;display:flex;align-items:center;gap:6px;transition:all .2s}
.wf-run-btn:hover{background:#a78bfa;transform:translateY(-1px)}
.wf-run-btn:disabled{opacity:.5;cursor:not-allowed;transform:none}
.wf-run-btn .wf-play{width:0;height:0;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:8px solid #fff}
.wf-canvas{position:relative;padding:30px 24px 24px;min-height:120px;background:radial-gradient(circle,rgba(255,255,255,.02) 1px,transparent 1px);background-size:20px 20px}
.wf-row{display:flex;align-items:flex-start;justify-content:center;gap:24px;margin-bottom:36px;position:relative;flex-wrap:wrap}
.wf-row:last-child{margin-bottom:0}
.wf-node{position:relative;z-index:2;background:#1e1e32;border:2px solid #3a3a5c;border-radius:10px;width:180px;transition:all .4s;cursor:default}
.wf-node:hover{border-color:#6c5ce7}
.wf-node.running{border-color:#ffb74d;box-shadow:0 0 16px rgba(255,183,77,.4);animation:wf-node-pulse 1.5s infinite}
.wf-node.done{border-color:#00d68f;box-shadow:0 0 20px rgba(0,214,143,.3)}
.wf-node.waiting{opacity:.45}
@keyframes wf-node-pulse{0%,100%{box-shadow:0 0 12px rgba(255,183,77,.3)}50%{box-shadow:0 0 24px rgba(255,183,77,.5)}}
.wf-node-hdr{padding:8px 12px;display:flex;align-items:center;gap:8px;border-bottom:1px solid #3a3a5c}
.wf-node-icon{width:28px;height:28px;border-radius:6px;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0}
.wf-node-title{font-size:11px;font-weight:600;color:#e0e0f0;line-height:1.3}
.wf-node-body{padding:8px 12px;font-size:10px;color:#8888aa;line-height:1.5}
.wf-node-body .wf-item{padding:2px 0;display:flex;align-items:center;gap:5px}
.wf-node-body .wf-item::before{content:'';width:3px;height:3px;border-radius:50%;background:#8888aa;flex-shrink:0}
.wf-node.done .wf-node-body .wf-item::before{background:#00d68f}
.wf-node-badge{position:absolute;top:-7px;right:-7px;width:18px;height:18px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;border:2px solid #1a1a2e;opacity:0;transition:opacity .3s;z-index:3}
.wf-node.running .wf-node-badge{opacity:1;background:#ffb74d;animation:wf-spin 1s linear infinite}
.wf-node.done .wf-node-badge{opacity:1;background:#00d68f}
@keyframes wf-spin{to{transform:rotate(360deg)}}
.wf-node-badge .wf-check{display:none}.wf-node-badge .wf-spinner{display:none}
.wf-node.running .wf-node-badge .wf-spinner{display:block}
.wf-node.done .wf-node-badge .wf-check{display:block}
.wf-port{position:absolute;width:8px;height:8px;border-radius:50%;background:#3a3a5c;border:2px solid #1a1a2e;z-index:4;transition:background .3s}
.wf-port.in{left:-4px;top:50%;transform:translateY(-50%)}
.wf-port.out{right:-4px;top:50%;transform:translateY(-50%)}
.wf-node.done .wf-port{background:#00d68f}
.wf-node.running .wf-port.in{background:#ffb74d}
.wf-connectors{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:1}
.wf-line{stroke:#3a3a5c;stroke-width:1.5;fill:none;transition:stroke .3s}
.wf-line.active{stroke:#00d68f;stroke-width:2}
.wf-line.running{stroke:#ffb74d;stroke-width:2;stroke-dasharray:6 3;animation:wf-dash 1s linear infinite}
@keyframes wf-dash{to{stroke-dashoffset:-9}}
.wf-node.wide{width:220px}
@media(max-width:900px){.wf-node,.wf-node.wide{width:160px}.wf-node-title{font-size:10px}.wf-node-body{font-size:9px}}
