/* strategy_analysis.css — Phase 47 */

.sa-container { max-width: 1100px; }

.sa-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.sa-title { margin: 0 0 4px 0; font-size: 18px; font-weight: 700; color: #111827; }
.sa-subtitle { margin: 0; font-size: 13px; color: #6b7280; }
.sa-save-btn {
    padding: 8px 18px; background: #3b82f6; color: white; border: none;
    border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.sa-save-btn:hover { background: #2563eb; }

/* Tabs */
.sa-tabs {
    display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb;
    margin-bottom: 20px; flex-wrap: wrap;
}
.sa-tab-btn {
    padding: 8px 16px; border: none; background: none; cursor: pointer;
    font-size: 13px; font-weight: 500; color: #6b7280; border-bottom: 3px solid transparent;
    margin-bottom: -2px; white-space: nowrap; display: flex; align-items: center; gap: 6px;
    transition: color 0.15s;
}
.sa-tab-btn:hover { color: #374151; }
.sa-tab-btn.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: 600; }
@keyframes sa-flash { 0%,100% { background: none; } 30% { background: #fef9c3; border-radius: 6px; } }
.sa-tab-flash { animation: sa-flash 1.8s ease; color: #d97706 !important; }
.sa-msg-refusal {
    display: flex; gap: 8px; align-items: flex-start;
    background: #fef3c7; border: 1px solid #fcd34d; border-radius: 10px;
    padding: 10px 14px; margin-bottom: 8px; font-size: 13px; color: #92400e; line-height: 1.5;
}
.sa-badge {
    background: #3b82f6; color: white; border-radius: 10px;
    font-size: 11px; padding: 1px 6px; font-weight: 600;
}
.sa-content { min-height: 400px; }

/* Section hint */
.sa-section-hint {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 10px 14px; font-size: 13px; color: #64748b; margin-bottom: 16px;
    line-height: 1.5;
}
.sa-btn-sm {
    padding: 4px 12px; background: white; border: 1px solid #d1d5db; border-radius: 6px;
    cursor: pointer; font-size: 12px; color: #374151; transition: background 0.15s;
}
.sa-btn-sm:hover { background: #f1f5f9; }

/* AI Session */
.sa-session { display: flex; flex-direction: column; height: 520px; }
.sa-session-info {
    background: linear-gradient(135deg, #f5f3ff, #ede9fe);
    border: 1px solid #c4b5fd; border-radius: 8px; padding: 10px 14px;
    font-size: 13px; color: #5b21b6; margin-bottom: 12px;
}
.sa-session-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px; gap: 8px;
}
.sa-session-toolbar .sa-session-hint {
    font-size: 12px; color: #6b7280; font-style: italic;
}
.sa-clear-btn {
    padding: 5px 12px; background: #fff7ed; border: 1px solid #fed7aa;
    border-radius: 6px; font-size: 12px; color: #92400e; cursor: pointer;
    white-space: nowrap; transition: background 0.15s;
}
.sa-clear-btn:hover { background: #ffedd5; }
.sa-messages {
    flex: 1; overflow-y: auto; padding: 8px 0; display: flex; flex-direction: column; gap: 12px;
    border: 1px solid #f1f5f9; border-radius: 8px; padding: 12px;
    background: #fafafa; margin-bottom: 10px;
}
.sa-msg { display: flex; gap: 10px; align-items: flex-start; }
.sa-msg-assistant { }
.sa-msg-user { flex-direction: row-reverse; }
.sa-msg-avatar { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.sa-msg-body {
    background: white; border: 1px solid #e5e7eb; border-radius: 10px;
    padding: 10px 14px; font-size: 13px; line-height: 1.6; max-width: 80%;
    color: #1f2937;
}
.sa-msg-user .sa-msg-body { background: #dbeafe; border-color: #bfdbfe; }

/* Typing animation */
.sa-typing-dots { display: flex; gap: 4px; align-items: center; padding: 14px !important; }
.sa-typing-dots span {
    width: 8px; height: 8px; background: #9ca3af; border-radius: 50%;
    animation: sa-bounce 1.2s infinite ease-in-out;
}
.sa-typing-dots span:nth-child(1) { animation-delay: 0s; }
.sa-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.sa-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sa-bounce { 0%,80%,100%{transform:scale(0.6);opacity:0.4} 40%{transform:scale(1);opacity:1} }

.sa-input-area { display: flex; gap: 8px; margin-bottom: 8px; }
.sa-input {
    flex: 1; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 14px; resize: none; font-family: inherit; line-height: 1.4;
}
.sa-input:focus { outline: none; border-color: #3b82f6; }
.sa-send-btn {
    padding: 10px 18px; background: #3b82f6; color: white; border: none;
    border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500;
    white-space: nowrap; align-self: flex-end;
}
.sa-send-btn:hover { background: #2563eb; }
.sa-quick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sa-chip {
    padding: 5px 12px; background: #f1f5f9; border: 1px solid #e2e8f0;
    border-radius: 16px; cursor: pointer; font-size: 12px; color: #374151;
    transition: background 0.15s;
}
.sa-chip:hover { background: #dbeafe; border-color: #93c5fd; color: #1d4ed8; }

/* PEST Grid */
.sa-pest-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 700px) { .sa-pest-grid { grid-template-columns: 1fr; } }

.sa-pest-quadrant {
    border: 2px solid #e5e7eb; border-radius: 10px; padding: 14px; background: white;
}
.sa-pest-qheader {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 8px; margin-bottom: 8px; font-size: 14px;
}
.sa-pest-count {
    background: #374151; color: white; border-radius: 10px;
    font-size: 11px; padding: 1px 7px; font-weight: 600;
}
.sa-pest-hint { font-size: 12px; color: #9ca3af; margin: 0 0 10px 0; }
.sa-pest-items { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; min-height: 30px; }
.sa-pest-item {
    display: flex; align-items: center; gap: 6px; font-size: 13px;
    background: white; border: 1px solid #f1f5f9; border-radius: 6px; padding: 5px 8px;
}
.sa-pest-impact { font-weight: 700; font-size: 14px; flex-shrink: 0; }
.sa-pest-factor { flex: 1; color: #1f2937; }
.sa-pest-importance { font-size: 11px; color: #9ca3af; flex-shrink: 0; }
.sa-item-del {
    background: none; border: none; color: #d1d5db; cursor: pointer;
    font-size: 16px; padding: 0 2px; line-height: 1; flex-shrink: 0;
}
.sa-item-del:hover { color: #ef4444; }
.sa-pest-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sa-factor-input {
    flex: 1; min-width: 120px; padding: 7px 10px; border: 1px solid #d1d5db;
    border-radius: 6px; font-size: 13px;
}
.sa-impact-select, .sa-importance-select {
    padding: 7px 8px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 12px; background: white;
}
.sa-add-btn {
    padding: 7px 12px; background: #374151; color: white; border: none;
    border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;
    flex-shrink: 0;
}
.sa-add-btn:hover { background: #1f2937; }

/* SWOT Grid */
.sa-swot-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 700px) { .sa-swot-grid { grid-template-columns: 1fr; } }

.sa-swot-quadrant {
    border: 2px solid #e5e7eb; border-radius: 10px; padding: 14px;
}
.sa-swot-qheader {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 8px; margin-bottom: 8px; font-size: 14px;
}
.sa-swot-items { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; min-height: 30px; }
.sa-swot-item {
    display: flex; align-items: center; gap: 6px; font-size: 13px;
    background: rgba(255,255,255,0.7); border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px; padding: 5px 8px;
}
.sa-swot-item > span { flex: 1; }
.sa-ai-item { border-style: dashed; }
.sa-swot-add { display: flex; gap: 6px; }

/* Priorities */
.sa-priorities-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.sa-priority-item {
    display: flex; align-items: center; gap: 12px;
    background: white; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px 14px;
}
.sa-priority-num {
    width: 28px; height: 28px; border-radius: 50%; color: white; font-size: 13px;
    font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sa-priority-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.sa-priority-text { font-size: 14px; color: #1f2937; line-height: 1.4; }
.sa-bsc-tag {
    display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px;
    border-radius: 10px; border: 1px solid; width: fit-content;
}
.sa-linked-badge {
    background: #dbeafe; color: #1d4ed8; font-size: 11px; padding: 2px 8px;
    border-radius: 10px; font-weight: 600; white-space: nowrap;
}
.sa-priority-add { display: flex; gap: 8px; margin-bottom: 20px; }

.sa-hoshin-export {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 2px solid #86efac; border-radius: 10px; padding: 16px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.sa-hoshin-export-info { font-size: 14px; color: #14532d; }
.sa-hoshin-export-cta { box-shadow: 0 2px 12px rgba(22, 163, 74, 0.18); margin-top: 8px; }
.sa-hoshin-btn {
    padding: 10px 20px; background: #16a34a; color: white; border: none;
    border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.sa-hoshin-btn:hover { background: #15803d; }

/* Foundation (Mission / Vision / Values) */
.sa-foundation { }
.sa-foundation-grid { display: flex; flex-direction: column; gap: 16px; }
.sa-foundation-block {
    background: white; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 18px;
}
.sa-foundation-label {
    display: block; font-size: 15px; font-weight: 700; color: #111827; margin-bottom: 4px;
}
.sa-foundation-hint {
    font-size: 12px; color: #6b7280; margin: 0 0 10px 0; line-height: 1.5;
}
.sa-foundation-textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 14px; line-height: 1.5; resize: vertical; font-family: inherit;
    box-sizing: border-box;
}
.sa-foundation-textarea:focus { outline: none; border-color: #3b82f6; }
.sa-values-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; min-height: 28px; }
.sa-value-item {
    display: flex; align-items: center; gap: 4px; background: #f1f5f9;
    border: 1px solid #e2e8f0; border-radius: 16px; padding: 4px 10px; font-size: 13px;
}
.sa-foundation-add { display: flex; gap: 6px; }
.sa-foundation-actions {
    display: flex; gap: 10px; margin: 16px 0; flex-wrap: wrap;
}
.sa-save-foundation-btn {
    padding: 10px 20px; background: #374151; color: white; border: none;
    border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.sa-save-foundation-btn:hover { background: #1f2937; }
.sa-next-btn {
    padding: 10px 20px; background: #3b82f6; color: white; border: none;
    border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600;
}
.sa-next-btn:hover { background: #2563eb; }
.sa-foundation-summary {
    background: #f0fdf4; border: 1px solid #86efac; border-radius: 10px;
    padding: 14px 18px; font-size: 13px; color: #14532d; line-height: 1.7;
}
.sa-foundation-summary h4 { margin: 0 0 6px 0; font-size: 13px; color: #374151; }
.sa-foundation-summary p { margin: 0 0 4px 0; }
.sa-value-badge {
    display: inline-block; background: #dbeafe; color: #1e40af;
    border-radius: 10px; padding: 2px 8px; font-size: 12px; margin: 0 3px 3px 0;
}

/* ── Demo Reference Modal ─────────────────────────────────────── */
.sa-demo-hint {
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 1px solid #bfdbfe; border-radius: 10px;
    padding: 12px 16px; margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
    font-size: 13px; color: #374151;
}
.sa-demo-btn {
    padding: 8px 16px; background: white; border: 1.5px solid #667eea;
    color: #667eea; border-radius: 8px; cursor: pointer; font-size: 13px;
    font-weight: 600; white-space: nowrap; transition: all 0.2s;
}
.sa-demo-btn:hover { background: #667eea; color: white; }
.sa-demo-btn-sm {
    padding: 6px 12px; background: white; border: 1.5px solid #d1d5db;
    color: #6b7280; border-radius: 8px; cursor: pointer; font-size: 12px;
    font-weight: 600; transition: all 0.2s;
}
.sa-demo-btn-sm:hover { border-color: #667eea; color: #667eea; }
.sa-demo-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.sa-demo-modal-box {
    background: white; border-radius: 16px; max-width: 780px; width: 100%;
    max-height: 88vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.sa-demo-modal-header {
    padding: 20px 24px; border-bottom: 1px solid #e5e7eb;
    display: flex; justify-content: space-between; align-items: center;
    position: sticky; top: 0; background: white; z-index: 1;
}
.sa-demo-close {
    background: none; border: none; font-size: 20px; cursor: pointer;
    color: #6b7280; padding: 4px 8px; border-radius: 6px;
}
.sa-demo-close:hover { background: #f3f4f6; }
.sa-demo-modal-body { padding: 20px 24px; }
.sa-demo-grid { display: flex; flex-direction: column; gap: 24px; }
.sa-demo-block { }
.sa-demo-block-title {
    font-size: 14px; font-weight: 700; color: #111827; margin-bottom: 12px;
    padding-bottom: 6px; border-bottom: 1px solid #e5e7eb;
}
.sa-demo-section { margin-bottom: 12px; }
.sa-demo-section-title {
    font-size: 11px; font-weight: 700; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.sa-demo-item {
    padding: 8px 12px; background: #f9fafb; border-radius: 6px;
    margin-bottom: 6px; display: flex; align-items: flex-start; gap: 8px;
}
.sa-demo-item-text { font-size: 13px; color: #374151; flex: 1; }
.sa-demo-item-badge {
    font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px;
    white-space: nowrap; flex-shrink: 0;
}
.sa-demo-badge-positive { background: #dcfce7; color: #166534; }
.sa-demo-badge-negative { background: #fee2e2; color: #991b1b; }
.sa-demo-badge-neutral  { background: #f3f4f6; color: #374151; }
.sa-demo-field { margin-bottom: 12px; }
.sa-demo-field label {
    font-size: 11px; font-weight: 700; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 4px;
}
.sa-demo-field p {
    font-size: 13px; color: #374151; margin: 0; line-height: 1.6;
    background: #f9fafb; padding: 10px 12px; border-radius: 6px;
}
.sa-demo-priority {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 12px; background: #f9fafb; border-radius: 6px; margin-bottom: 6px;
}
.sa-demo-priority-num {
    width: 22px; height: 22px; background: #667eea; color: white;
    border-radius: 50%; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.sa-demo-priority span:nth-child(2) { font-size: 13px; color: #374151; flex: 1; }
.sa-demo-bsc {
    font-size: 10px; font-weight: 600; padding: 2px 7px;
    background: #ede9fe; color: #5b21b6; border-radius: 10px;
    flex-shrink: 0; white-space: nowrap;
}
