/* Egogram Diagnosis System - Modern Design */

:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4338ca;
    --accent: #ec4899;
    --bg-gradient-start: #f5f3ff;
    --bg-gradient-end: #fdf2f8;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --error-bg: #fef2f2; --error-text: #dc2626; --error-border: #fecaca;
    --success-bg: #f0fdf4; --success-text: #16a34a; --success-border: #bbf7d0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    --radius: 12px; --radius-sm: 8px;
    --transition: all 0.2s ease;
    --sidebar-width: 260px;
    --cp: #EF4444; --np: #F59E0B; --a: #22C55E; --fc: #3B82F6; --ac: #8B5CF6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body {
    font-family: 'Helvetica Neue','Hiragino Sans','Hiragino Kaku Gothic ProN','Noto Sans JP','Yu Gothic','Meiryo',sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-primary); line-height: 1.6;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}

/* ===== LOGIN ===== */
.login-container { width: 100%; max-width: 460px; padding: 20px; }
.login-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow-xl); padding: 48px 40px;
    position: relative; overflow: hidden;
}
.login-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--cp), var(--np), var(--a), var(--fc), var(--ac));
}
.login-header { text-align: center; margin-bottom: 36px; }
.login-logo { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 8px; }
.login-logo-img { display: flex; justify-content: center; margin-bottom: 8px; }
.login-logo-img img { max-width: 240px; width: 70%; height: auto; }
.logo-icon {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { width: 28px; height: 28px; color: #fff; }
.login-title {
    font-size: 22px; font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.login-btn {
    display: block; width: 100%; padding: 14px 24px;
    font-size: 16px; font-weight: 600; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none; border-radius: var(--radius-sm); cursor: pointer;
    transition: var(--transition); margin-top: 8px; font-family: inherit;
}
.login-btn:hover { background: linear-gradient(135deg, var(--primary-light), var(--primary)); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.login-footer { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; }
.footer-text { font-size: 12px; color: var(--text-muted); }
.footer-link { font-size: 13px; color: var(--text-secondary); text-decoration: none; transition: var(--transition); }
.footer-link:hover { color: var(--primary); }
.copyright { text-align: center; margin-top: 24px; font-size: 12px; color: var(--text-muted); }
.login-legal-links { margin-top: 16px; text-align: center; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; font-size: 11px; }
.login-legal-links a { color: var(--text-muted); text-decoration: none; transition: var(--transition); }
.login-legal-links a:hover { color: var(--primary); text-decoration: underline; }
.login-legal-sep { color: var(--border); }

/* はじめてご利用になる方へ */
.gs-hero { background: linear-gradient(135deg, #f5f3ff 0%, #eef2ff 100%); border-radius: 12px; padding: 24px 28px; margin-bottom: 20px; border-left: 4px solid var(--primary); }
.gs-hero-title { margin: 0 0 8px 0; font-size: 20px; color: var(--primary-dark); font-weight: 700; }
.gs-hero-lead { margin: 0; font-size: 14px; color: var(--text-primary); line-height: 1.8; }
.gs-quickstart { margin-bottom: 20px; }
.gs-steps { list-style: none; padding: 0; margin: 0; counter-reset: gs-step; }
.gs-steps > li { counter-increment: gs-step; position: relative; padding: 16px 16px 16px 56px; margin-bottom: 12px; background: #fafafa; border-radius: 8px; border: 1px solid var(--border); }
.gs-steps > li::before { content: counter(gs-step); position: absolute; left: 16px; top: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.gs-step-title { font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; font-size: 15px; }
.gs-step-body { font-size: 14px; color: var(--text-secondary); line-height: 1.8; }
.gs-step-body strong { color: var(--text-primary); }
.gs-link { color: var(--primary); text-decoration: underline; }
.gs-sample { display: inline-block; background: #fff; padding: 2px 8px; border: 1px dashed var(--border); border-radius: 4px; font-family: monospace; font-size: 13px; }
.gs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }
.gs-feature { display: flex; flex-direction: column; }
.gs-feature-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gs-feature-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--primary-dark); }
.gs-ico { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.gs-feature-body { margin: 0 0 10px 0; font-size: 13.5px; color: var(--text-secondary); line-height: 1.8; }
.gs-list { margin: 0 0 12px 0; padding-left: 20px; font-size: 13px; color: var(--text-secondary); line-height: 1.8; }
.gs-btn { align-self: flex-start; margin-top: auto; display: inline-block; padding: 6px 14px; background: var(--primary); color: #fff; border-radius: 6px; font-size: 13px; font-weight: 600; text-decoration: none; transition: var(--transition); }
.gs-btn:hover { background: var(--primary-dark); }
.gs-faq details { border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; background: #fff; }
.gs-faq summary { cursor: pointer; font-weight: 600; color: var(--text-primary); font-size: 14px; list-style-position: inside; }
.gs-faq summary:hover { color: var(--primary); }
.gs-faq details[open] summary { color: var(--primary-dark); margin-bottom: 8px; }
.gs-faq details p { margin: 0; font-size: 13.5px; color: var(--text-secondary); line-height: 1.8; padding-top: 6px; border-top: 1px dashed var(--border); }
.gs-faq details p a { color: var(--primary); text-decoration: underline; }
.gs-support { background: #fafafa; }

/* 同意チェックボックス */
.consent-box { margin-top: 32px; padding: 16px 20px; border: 2px solid var(--primary-light); border-radius: 8px; background: #f5f3ff; }
.consent-label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.consent-label input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; cursor: pointer; accent-color: var(--primary); }
.consent-text { font-size: 15px; color: var(--text-primary); line-height: 1.6; }
.consent-text strong { color: var(--primary-dark); font-weight: 700; }
.consent-note { margin: 10px 0 0 32px; font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.consent-note a { color: var(--primary); text-decoration: underline; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== FORM COMPONENTS ===== */
.form-group { margin-bottom: 24px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.form-input {
    width: 100%; padding: 10px 14px; font-size: 15px;
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    outline: none; transition: var(--transition);
    background: #f8fafc; color: var(--text-primary); font-family: inherit;
}
.form-input:focus { border-color: var(--primary-light); background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-textarea {
    width: 100%; padding: 12px 14px; font-size: 15px;
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    outline: none; transition: var(--transition); resize: vertical;
    background: #f8fafc; font-family: inherit;
}
.form-textarea:focus { border-color: var(--primary-light); background: #fff; }
.print-comment-show { display: none; }
.checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; padding: 8px 12px; border-radius: var(--radius-sm); transition: var(--transition); }
.checkbox-label:hover { background: #f1f5f9; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }
.radio-group { display: flex; gap: 24px; }
.radio-label {
    display: flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer;
    padding: 10px 20px; border: 2px solid var(--border); border-radius: var(--radius-sm);
    transition: var(--transition); flex: 1; justify-content: center;
}
.radio-label:has(input:checked) { border-color: var(--primary); background: #eef2ff; }
.radio-label input[type="radio"] { accent-color: var(--primary); }

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-block; padding: 10px 24px; font-size: 15px; font-weight: 600;
    color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); font-family: inherit;
}
.btn-primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-secondary {
    display: inline-block; padding: 10px 24px; font-size: 15px; font-weight: 600;
    color: var(--text-secondary); background: var(--card-bg);
    border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); text-decoration: none; font-family: inherit;
}
.btn-secondary:hover { border-color: var(--text-muted); }
.btn-sm {
    display: inline-block; padding: 5px 14px; font-size: 13px; font-weight: 600;
    color: var(--primary); background: #eef2ff; border: none; border-radius: 6px;
    cursor: pointer; transition: var(--transition); text-decoration: none; font-family: inherit;
}
.btn-sm:hover { background: #e0e7ff; }
.btn-danger { color: var(--error-text)!important; background: var(--error-bg)!important; }
.btn-danger:hover { background: #fee2e2!important; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; }

/* ===== FLASH ===== */
.flash-container { padding: 0 24px; margin-bottom: 16px; }
.flash-msg { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 8px; }
.flash-error { background: var(--error-bg); color: var(--error-text); border: 1px solid var(--error-border); }
.flash-success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.error-message { display: none; background: var(--error-bg); color: var(--error-text); border: 1px solid var(--error-border); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 20px; font-size: 14px; }

/* ===== ADMIN LAYOUT ===== */
.admin-body { display: block; background: #f1f5f9; align-items: stretch; justify-content: stretch; }
.admin-layout { display: flex; min-height: 100vh; overflow-x: hidden; }
.system-sidebar { background: #1a1a2e !important; }
.system-sidebar .nav-section { color: #ef4444 !important; }
.system-logo { background: linear-gradient(135deg, #ef4444, #f59e0b) !important; }
.sidebar {
    width: var(--sidebar-width); background: #1e1b4b; color: #e2e8f0;
    display: flex; flex-direction: column; position: fixed;
    top: 0; left: 0; bottom: 0; z-index: 100; transition: transform 0.3s ease;
}
.sidebar-header { padding: 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #312e81; }
.sidebar-logo-icon {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
}
.sidebar-logo-icon svg { width: 20px; height: 20px; color: #fff; }
.sidebar-logo-img { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; }
.sidebar-title { font-size: 15px; font-weight: 700; color: #fff; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-section { padding: 16px 20px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #6366f1; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; font-size: 14px; color: #a5b4fc; text-decoration: none; transition: var(--transition); }
.nav-item:hover { background: #312e81; color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid #312e81; display: flex; align-items: center; justify-content: space-between; }
.sidebar-user { font-size: 13px; color: #a5b4fc; }
.sidebar-logout { font-size: 13px; color: #a5b4fc; text-decoration: none; padding: 4px 12px; border: 1px solid #4338ca; border-radius: 6px; transition: var(--transition); }
.sidebar-logout:hover { background: #ef4444; color: #fff; border-color: #ef4444; }

.admin-main { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.admin-header {
    background: var(--card-bg); border-bottom: 1px solid var(--border);
    padding: 16px 24px; display: flex; align-items: center; gap: 16px;
    position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm);
}
.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; color: var(--text-secondary); }
.menu-toggle svg { width: 24px; height: 24px; }
.page-title { font-size: 20px; font-weight: 700; }
.admin-content { padding: 24px; flex: 1; }

/* ===== CARDS ===== */
.card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); padding: 24px; margin-bottom: 24px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-header h2, .card-header h3 { font-size: 16px; font-weight: 700; }
.card-link { font-size: 14px; color: var(--primary); text-decoration: none; font-weight: 600; }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; }
.card-description { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; line-height: 1.7; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--border); padding: 24px; display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.blue { background: #eef2ff; color: var(--primary); }
.stat-icon.green { background: var(--success-bg); color: var(--success-text); }
.stat-value { font-size: 28px; font-weight: 800; }
.stat-label { font-size: 13px; color: var(--text-muted); }

/* ===== TABLES ===== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 10px 14px; font-weight: 600; color: var(--text-secondary); border-bottom: 2px solid var(--border); white-space: nowrap; font-size: 13px; }
.data-table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table tbody tr.row-past { background: #f1f5f9; color: #94a3b8; }
.data-table tbody tr.row-past:hover { background: #e2e8f0; }
.td-name { font-weight: 600; }
.td-empty { text-align: center; color: var(--text-muted); padding: 40px!important; }
.sort-link { color: var(--text-secondary); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.sort-link:hover { color: var(--primary); }
.sort-arrow { font-size: 10px; }
.row-highlight { background: #eef2ff!important; }

/* Ego scores inline */
.ego-score { font-weight: 700; color: var(--c); }

/* Pattern badge */
.pattern-badge {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600; background: #f5f3ff; color: var(--primary);
}

/* Stress badge */
.stress-badge { font-weight: 700; font-size: 13px; }

/* Role badges */
.role-badge { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; background: #f1f5f9; color: var(--text-secondary); }
.role-leader { background: #fef9c3; color: #854d0e; }
.role-sub { background: #e0e7ff; color: #3730a3; }

/* Similarity */
.similarity-score { font-weight: 700; color: var(--primary); }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 4px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.page-link { padding: 6px 14px; font-size: 14px; border-radius: 6px; text-decoration: none; color: var(--text-secondary); transition: var(--transition); }
.page-link:hover { background: #eef2ff; color: var(--primary); }
.page-link.active { background: var(--primary); color: #fff; }
.page-dots { padding: 6px 8px; color: var(--text-muted); }

/* Filter */
.filter-card { margin-bottom: 16px; }
.filter-form { width: 100%; }
.filter-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; }
.filter-item { flex: 1; min-width: 160px; }
.filter-actions { display: flex; gap: 8px; min-width: auto; flex: 0; }

/* Detail layout */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.chart-container { position: relative; max-height: 300px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-item { display: flex; flex-direction: column; }
.info-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.info-value { font-size: 15px; font-weight: 600; }
.back-link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--primary); text-decoration: none; margin-bottom: 20px; font-weight: 600; }
.back-link:hover { text-decoration: underline; }

/* Ego bar scores */
.ego-scores-bar { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.ego-bar-item { display: flex; align-items: center; gap: 12px; }
.ego-bar-label { width: 32px; font-weight: 800; font-size: 14px; text-align: center; }
.ego-bar-track { flex: 1; height: 12px; background: #f1f5f9; border-radius: 6px; overflow: hidden; }
.ego-bar-fill { height: 100%; border-radius: 6px; transition: width 0.5s ease; }
.ego-bar-value { width: 40px; font-size: 14px; font-weight: 700; text-align: right; color: var(--text-secondary); }

/* Pattern result */
.pattern-result { text-align: center; margin-bottom: 20px; }
.pattern-name { font-size: 24px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.pattern-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* Ego detail grid */
.ego-detail-grid { display: flex; flex-direction: column; gap: 12px; }
.ego-detail-item { padding: 12px 16px; border-radius: var(--radius-sm); background: #f8fafc; }
.ego-detail-header { display: flex; align-items: center; justify-content: space-between; padding-left: 12px; margin-bottom: 4px; }
.ego-detail-name { font-size: 14px; font-weight: 700; }
.ego-detail-score { font-size: 18px; font-weight: 800; }
.ego-detail-desc { font-size: 13px; color: var(--text-secondary); padding-left: 16px; }

/* ===== DIAGNOSIS PAGES ===== */
.diagnosis-container { width: 100%; max-width: 560px; padding: 20px; margin: 0 auto; }
.diagnosis-card {
    background: var(--card-bg); border-radius: var(--radius);
    box-shadow: var(--shadow-xl); padding: 40px; position: relative; overflow: hidden;
}
.diagnosis-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: linear-gradient(90deg, var(--cp), var(--np), var(--a), var(--fc), var(--ac));
}
.diagnosis-header { text-align: center; margin-bottom: 32px; }
.diagnosis-logo-img { display: block; width: 64px; height: 64px; object-fit: contain; margin: 0 auto 12px; }
.diagnosis-title { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.diagnosis-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.diagnosis-footer { text-align: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

/* Instructions */
.instructions-content { display: flex; flex-direction: column; gap: 20px; }
.instruction-item { display: flex; gap: 16px; align-items: flex-start; }
.instruction-number {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 16px;
}
.instruction-text h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.instruction-text p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* Progress */
.progress-info { font-size: 14px; color: var(--text-secondary); margin: 8px 0; }
.progress-bar { width: 100%; height: 6px; background: #e2e8f0; border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 3px; transition: width 0.3s ease; }

/* Questions */
.question-item { padding: 20px 0; border-bottom: 1px solid #f1f5f9; }
.question-number { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.question-text { font-size: 16px; font-weight: 600; margin-bottom: 14px; }

/* 3-column answer (はい/どちらでもない/いいえ) */
.answer-options-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.answer-label-3 { cursor: pointer; }
.answer-label-3 input[type="radio"] { display: none; }
.answer-btn {
    display: block; text-align: center; padding: 10px 8px;
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
    border: 2px solid var(--border); transition: var(--transition);
}
.answer-label-3 input:checked + .answer-btn.answer-yes { background: #dcfce7; border-color: #22c55e; color: #166534; }
.answer-label-3 input:checked + .answer-btn.answer-maybe { background: #fef9c3; border-color: #eab308; color: #854d0e; }
.answer-label-3 input:checked + .answer-btn.answer-no { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.answer-btn:hover { border-color: var(--primary-light); }

.question-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }

/* Result */
.result-pattern-section { text-align: center; margin: 24px 0; padding: 24px; background: #f5f3ff; border-radius: var(--radius); }
.result-pattern-name { font-size: 28px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.result-pattern-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

/* Pattern detail */
.pattern-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.pattern-detail-box { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.7; }
.pattern-detail-box h4 { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.pattern-strengths { background: #f0fdf4; border: 1px solid #bbf7d0; }
.pattern-strengths h4 { color: #16a34a; }
.pattern-caution { background: #fff7ed; border: 1px solid #fed7aa; }
.pattern-caution h4 { color: #ea580c; }

/* Ego analysis cards */
.ego-analysis-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.ego-analysis-card { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.ego-analysis-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ego-analysis-name { font-size: 16px; font-weight: 700; }
.ego-analysis-short { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; color: #fff; vertical-align: middle; }
.ego-analysis-score { font-size: 28px; font-weight: 800; }
.ego-analysis-score small { font-size: 14px; font-weight: 400; color: var(--text-muted); }
.ego-analysis-keywords { font-size: 13px; color: var(--text-muted); font-style: italic; margin-bottom: 12px; }
.ego-analysis-section { font-size: 14px; line-height: 1.8; color: var(--text-secondary); }
.ego-section-title { font-size: 13px; font-weight: 700; margin: 12px 0 4px; padding-left: 10px; border-left: 3px solid; }
.ego-section-strength { color: #16a34a; border-color: #22c55e; }
.ego-section-caution { color: #ea580c; border-color: #f97316; }
.ego-section-info { color: #3b82f6; border-color: #60a5fa; }
.ego-section-improve { color: #7c3aed; border-color: #8b5cf6; }

@media (max-width: 768px) { .pattern-detail-grid { grid-template-columns: 1fr; } }

/* ===== BDS INTEGRATION ===== */

.section-label {
    font-size: 13px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--primary); margin: 32px 0 16px;
    padding-bottom: 8px; border-bottom: 2px solid var(--primary);
    display: flex; align-items: center; gap: 8px;
}

.bds-badge {
    display: inline-block; padding: 3px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 700; white-space: nowrap;
}
.bds-digital { background: #dbeafe; color: #1e40af; }
.bds-sympathize { background: #dcfce7; color: #166534; }
.bds-emotion { background: #fef9c3; color: #854d0e; }

.bds-speed {
    display: inline-block; padding: 3px 10px; border-radius: 20px;
    font-size: 12px; font-weight: 600;
}
.bds-speed-fast { background: #fee2e2; color: #991b1b; }
.bds-speed-slow { background: #e0e7ff; color: #3730a3; }

.bds-star { font-size: 16px; font-weight: 700; color: var(--primary); }

.bds-result-section { display: flex; flex-direction: column; gap: 16px; }
.bds-result-row { display: flex; align-items: center; justify-content: space-between; }
.bds-result-label { font-size: 14px; color: var(--text-secondary); font-weight: 600; }

.bds-text {
    font-size: 14px; line-height: 1.8; color: var(--text-secondary);
    white-space: pre-line;
}

.bds-type-legend { display: flex; flex-direction: column; gap: 16px; padding: 8px 0; }
.bds-legend-item { display: flex; align-items: center; gap: 10px; }
.bds-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.bds-legend-desc { font-size: 13px; color: var(--text-muted); margin-left: 4px; }

/* BDS Communication Matrix Table */
.comm-matrix { width: 100%; border-collapse: collapse; table-layout: fixed; }
.comm-matrix .cm-corner {
    width: 100px; background: #2d3748; border: 1px solid #2d3748;
}
.comm-matrix .cm-head {
    background: #2d3748; color: #fff; font-size: 15px; font-weight: 700;
    padding: 12px 16px; text-align: left; border: 1px solid #4a5568;
}
.comm-matrix .cm-row-head {
    background: #4a5568; color: #fff; font-size: 15px; font-weight: 700;
    padding: 12px 16px; text-align: left; border: 1px solid #4a5568;
    white-space: nowrap;
}
.comm-matrix .cm-cell {
    padding: 14px 16px; border: 1px solid var(--border);
    vertical-align: top; min-height: 56px; background: #fff;
}
.comm-matrix tbody tr:nth-child(odd) .cm-cell { background: #f8fafc; }
.cm-person {
    font-size: 14px; font-weight: 500; padding: 4px 0;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.cm-person .role-badge { font-size: 11px; padding: 1px 6px; }
.cm-link { color: var(--primary); text-decoration: none; font-weight: 600; transition: var(--transition); }
.cm-link:hover { text-decoration: underline; color: var(--primary-dark); }
.name-link { color: var(--primary); text-decoration: none; font-weight: 600; transition: var(--transition); }
.name-link:hover { text-decoration: underline; color: var(--primary-dark); }

/* Biorhythm */
.bio-chart-wrap { position: relative; width: 100%; height: 220px; margin-bottom: 20px; }
.bio-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 16px;
}
.bio-day {
    text-align: center; padding: 8px 4px; border-radius: var(--radius-sm);
    border: 2px solid transparent;
}
.bio-date { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; font-weight: 600; }
.bio-label { font-size: 13px; font-weight: 700; }
.bio-level-1 { background: #dcfce7; border-color: #22c55e; } .bio-level-1 .bio-label { color: #16a34a; }
.bio-level-2 { background: #f0fdf4; border-color: #86efac; } .bio-level-2 .bio-label { color: #22c55e; }
.bio-level-3 { background: #fefce8; border-color: #fde047; } .bio-level-3 .bio-label { color: #ca8a04; }
.bio-level-4 { background: #fff7ed; border-color: #fdba74; } .bio-level-4 .bio-label { color: #ea580c; }
.bio-level-5 { background: #fef2f2; border-color: #fca5a5; } .bio-level-5 .bio-label { color: #dc2626; }
.bio-legend { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.bio-leg-item { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-secondary); }
.bio-dot { width: 10px; height: 10px; border-radius: 50%; }
.bio-dot.bio-level-1 { background: #16a34a; border: none; } .bio-dot.bio-level-2 { background: #22c55e; border: none; }
.bio-dot.bio-level-3 { background: #eab308; border: none; } .bio-dot.bio-level-4 { background: #f97316; border: none; }
.bio-dot.bio-level-5 { background: #ef4444; border: none; }

/* Similarity tabs & bars */
.sim-tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.sim-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 20px; font-size: 14px; font-weight: 600;
    color: var(--text-secondary); background: var(--card-bg);
    border: 2px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    text-decoration: none; transition: var(--transition); border-bottom: 2px solid var(--border);
}
.sim-tab:hover { color: var(--primary); border-color: var(--primary-light); }
.sim-tab.active {
    color: var(--primary); background: var(--card-bg);
    border-color: var(--primary); border-bottom-color: var(--card-bg);
    position: relative; z-index: 1;
}
.sim-target-card { border-top: 3px solid var(--primary); }
.sim-target-info { display: flex; gap: 32px; flex-wrap: wrap; }
.sim-target-col { display: flex; align-items: center; gap: 8px; }
.sim-scores { font-size: 13px; color: var(--text-muted); font-family: monospace; }
.sim-bar-wrap {
    position: relative; width: 120px; height: 22px;
    background: #f1f5f9; border-radius: 11px; overflow: hidden;
}
.sim-bar {
    position: absolute; top: 0; left: 0; height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 11px; transition: width 0.4s ease;
}
.sim-bar-text {
    position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
    height: 100%; font-size: 12px; font-weight: 700; color: var(--text-primary);
}

/* Mypage */
.mypage-container { width: 100%; min-height: 100vh; background: #f1f5f9; }
.mypage-header { background: var(--card-bg); box-shadow: var(--shadow-sm); border-bottom: 1px solid var(--border); }
.mypage-header-inner { max-width: 1000px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.mypage-logo { display: flex; align-items: center; gap: 10px; }
.mypage-logo-img { width: 36px; height: 36px; object-fit: contain; }
.mypage-logo-text { font-size: 16px; font-weight: 700; color: var(--primary); }
.mypage-nav { display: flex; align-items: center; gap: 14px; }
.mypage-user { font-size: 14px; color: var(--text-secondary); }
.mypage-link { font-size: 13px; color: var(--text-secondary); text-decoration: none; padding: 5px 14px; border: 1px solid var(--border); border-radius: 6px; transition: var(--transition); }
.mypage-link:hover { border-color: var(--primary); color: var(--primary); }
.mypage-logout { font-size: 13px; color: var(--text-secondary); text-decoration: none; padding: 5px 14px; border: 1px solid var(--border); border-radius: 6px; transition: var(--transition); }
.mypage-logout:hover { background: var(--error-bg); color: var(--error-text); border-color: var(--error-border); }
.mypage-main { max-width: 1000px; margin: 0 auto; padding: 24px; }
.mypage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.mypage-pattern { text-align: center; margin-bottom: 12px; }
.mypage-date { font-size: 12px; color: var(--text-muted); margin-top: 12px; text-align: right; }

/* Retake banner */
.retake-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    background: linear-gradient(135deg, #eef2ff, #e0f2fe); border: 2px solid var(--primary-light);
    border-radius: var(--radius); padding: 20px 24px; margin-bottom: 24px;
}
.retake-banner-text p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.retake-control { display: flex; align-items: center; gap: 12px; }
.retake-status { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--text-secondary); }
.retake-allowed { color: var(--success-text); background: var(--success-bg); padding: 10px 16px; border-radius: var(--radius-sm); }

@media (max-width: 768px) { .mypage-grid { grid-template-columns: 1fr; } .retake-banner { flex-direction: column; text-align: center; } }

/* User management */
.role-tag { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.role-tag-system { background: #fee2e2; color: #991b1b; }
.role-tag-admin { background: #fef9c3; color: #854d0e; }
.role-tag-diagnosis { background: #e0e7ff; color: #3730a3; }
.role-tag-user { background: #e0e7ff; color: #3730a3; }

/* ===== SHARE TOGGLE ===== */
.share-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.share-toggle input { display: none; }
.share-toggle-slider {
    position: relative; width: 48px; height: 26px;
    background: #cbd5e1; border-radius: 13px; transition: background 0.2s;
}
.share-toggle-slider::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px; background: #fff; border-radius: 50%;
    transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.share-toggle input:checked + .share-toggle-slider { background: #22c55e; }
.share-toggle input:checked + .share-toggle-slider::after { transform: translateX(22px); }
.share-toggle input:disabled + .share-toggle-slider { opacity: 0.5; }
.share-toggle-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); min-width: 48px; }

/* ===== AI USAGE BADGE ===== */
.ai-usage-badge { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 10px; padding: 10px 16px; min-width: 200px; }
.ai-usage-badge-low { background: #fff7ed; border-color: #fed7aa; }
.ai-usage-badge-empty { background: #fef2f2; border-color: #fecaca; }
.ai-usage-badge-label { font-size: 11px; color: #64748b; margin-bottom: 2px; }
.ai-usage-badge-value { font-size: 14px; line-height: 1; }
.ai-usage-remaining { font-size: 22px; font-weight: 700; color: #0369a1; }
.ai-usage-badge-low .ai-usage-remaining { color: #ea580c; }
.ai-usage-badge-empty .ai-usage-remaining { color: #dc2626; }
.ai-usage-slash { color: #94a3b8; margin: 0 4px; }
.ai-usage-limit { color: #64748b; font-size: 13px; }
.ai-usage-badge-sub { font-size: 11px; color: #64748b; margin-top: 4px; }

/* ===== ANALYTICS SUMMARY CARDS ===== */
.analytics-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.summary-card { background: var(--card-bg); border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow-sm); border-left: 4px solid var(--primary); }
.summary-card-blue { border-left-color: #3b82f6; }
.summary-card-green { border-left-color: #22c55e; }
.summary-card-purple { border-left-color: #8b5cf6; }
.summary-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 8px; }
.summary-value { font-size: 32px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.summary-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.badge-self { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; background: var(--primary); color: #fff; vertical-align: middle; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.status-active { background: #22c55e; }
.status-inactive { background: #d1d5db; }
.row-inactive { opacity: 0.5; }
.td-actions { display: flex; gap: 6px; white-space: nowrap; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-hint-inline { font-size: 12px; color: var(--text-muted); font-weight: 400; }

/* Role selector */
.role-select { display: flex; gap: 12px; }
.role-option {
    flex: 1; cursor: pointer; border: 2px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px; transition: var(--transition);
}
.role-option:hover { border-color: var(--primary-light); }
.role-option.selected { border-color: var(--primary); background: #f5f3ff; }
.role-option input[type="radio"] { display: none; }
.role-option-inner { display: flex; align-items: center; gap: 12px; }
.role-option-inner svg { width: 28px; height: 28px; color: var(--primary); flex-shrink: 0; }
.role-option-inner strong { display: block; font-size: 14px; }
.role-option-inner span { display: block; font-size: 12px; color: var(--text-muted); }

/* ===== ERROR ===== */
.error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.error-card { text-align: center; }
.error-code { font-size: 72px; font-weight: 800; color: var(--primary); }
.error-text { font-size: 16px; color: var(--text-secondary); margin: 8px 0 24px; }
.error-link { color: var(--primary); text-decoration: none; font-weight: 600; }

/* ===== PRINT ===== */
@media print {
    @page { size: A4; margin: 10mm; }
    .sidebar, .admin-header, .menu-toggle, .btn-sm, .btn-primary, .btn-secondary, .back-link, .filter-card, .print-hide, .flash-container { display: none!important; }
    body, .admin-layout, .admin-main, .admin-content { width: 100%!important; max-width: 100%!important; margin: 0!important; padding: 0!important; }
    .admin-main { margin-left: 0!important; }
    .detail-grid, .chart-grid, .pattern-detail-grid { grid-template-columns: 1fr; gap: 12px; }
    .card { box-shadow: none!important; border: 1px solid #ddd!important; break-inside: auto; padding: 12px!important; }
    .chart-container { max-width: 100%; }
    canvas { max-width: 100%!important; height: auto!important; }
    .bio-chart-wrap { max-width: 100%; height: auto!important; overflow: hidden; }
    .bio-grid { grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 11px; }
    .section-label { font-size: 14px; }
    .print-comment-show { display: block!important; }
    .print-comment-text { display: block!important; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) { .detail-grid, .chart-grid { grid-template-columns: 1fr; } }
/* Sidebar overlay (mobile) */
.sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 99; cursor: pointer;
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open ~ .sidebar-overlay { display: block; }
    .admin-main { margin-left: 0; max-width: 100vw; overflow-x: hidden; }
    .menu-toggle { display: block; }
    .filter-row { flex-direction: column; }
    .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .login-card, .diagnosis-card { padding: 28px 20px; }
    .radio-group { flex-direction: column; gap: 8px; }
    .answer-options-3col { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
}

/* ===== AI鑑定 ===== */
.ai-advice-card { border-left: 4px solid var(--primary); }
.ai-advice-text { line-height: 1.8; color: var(--text-primary); }
.ai-advice-text h1, .ai-advice-text h2, .ai-advice-text h3, .ai-advice-text h4 {
    margin-top: 16px; margin-bottom: 8px; color: var(--primary-dark);
}
.ai-advice-text h2 { font-size: 18px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.ai-advice-text h3 { font-size: 16px; }
.ai-advice-text ul, .ai-advice-text ol { padding-left: 24px; margin: 8px 0; }
.ai-advice-text li { margin-bottom: 4px; }
.ai-advice-text p { margin-bottom: 8px; }
.ai-advice-text strong { color: var(--primary-dark); }
.ai-advice-date { margin-top: 12px; font-size: 12px; color: var(--text-muted); }

.ai-chat-section { max-height: 600px; overflow-y: auto; }
.ai-chat-msg { padding: 10px 14px; margin-bottom: 10px; border-radius: var(--radius-sm); }
.ai-chat-user { background: #eef2ff; }
.ai-chat-assistant { background: #f9fafb; border: 1px solid var(--border); }
.ai-chat-role { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.ai-chat-content { line-height: 1.7; font-size: 14px; }
.ai-chat-content h1, .ai-chat-content h2, .ai-chat-content h3, .ai-chat-content h4 {
    margin-top: 8px; margin-bottom: 4px;
}
.ai-chat-content ul, .ai-chat-content ol { padding-left: 20px; }
.ai-chat-content p { margin-bottom: 6px; }

.ai-spinner {
    display: inline-block; width: 16px; height: 16px; border: 2px solid #fff;
    border-top-color: transparent; border-radius: 50%; vertical-align: middle;
    animation: ai-spin 0.6s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* ===== SITE FOOTER (Powered by Zeus) ===== */
.site-footer {
    width: 100%; margin-top: 48px; padding: 24px 16px 16px;
    border-top: 1px solid var(--border); background: rgba(255,255,255,0.6);
    font-size: 12px; color: var(--text-muted);
}
.site-footer-inner { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.site-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 4px; }
.site-footer-links a { color: var(--text-secondary); text-decoration: none; padding: 2px 6px; transition: var(--transition); }
.site-footer-links a:hover { color: var(--primary); text-decoration: underline; }
.site-footer-sep { color: var(--text-muted); }
.site-footer-copy { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; align-items: center; }
.site-footer-powered { color: var(--text-muted); }

.admin-main .site-footer { margin-top: auto; }

/* ===== LEGAL PAGES ===== */
.legal-container { width: 100%; min-height: 100vh; display: flex; flex-direction: column; background: #fff; }
.legal-header {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 32px; border-bottom: 1px solid var(--border);
    background: #fff; flex-wrap: wrap;
}
.legal-brand { display: flex; align-items: center; gap: 10px; color: var(--primary-dark); font-weight: 700; font-size: 18px; text-decoration: none; }
.legal-logo { width: 32px; height: 32px; object-fit: contain; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 16px; font-size: 14px; }
.legal-nav a { color: var(--text-secondary); text-decoration: none; transition: var(--transition); }
.legal-nav a:hover { color: var(--primary); }
.legal-main { flex: 1; padding: 48px 24px; }
.legal-article { max-width: 780px; margin: 0 auto; background: #fff; color: var(--text-primary); line-height: 1.9; }
.legal-title { font-size: 28px; font-weight: 700; color: var(--primary-dark); margin-bottom: 8px; padding-bottom: 16px; border-bottom: 2px solid var(--primary-light); }
.legal-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 32px; }
.legal-article h2 { font-size: 18px; font-weight: 700; color: var(--primary-dark); margin: 32px 0 12px; padding: 8px 12px; background: #f5f3ff; border-left: 4px solid var(--primary); border-radius: 0 4px 4px 0; }
.legal-article p { margin-bottom: 14px; font-size: 15px; }
.legal-article ol, .legal-article ul { margin: 12px 0 16px 0; padding-left: 28px; }
.legal-article ol li, .legal-article ul li { margin-bottom: 6px; font-size: 15px; }
.legal-article a { color: var(--primary); text-decoration: underline; }
.legal-article strong { color: var(--error-text); font-weight: 700; }
.legal-signature { text-align: right; margin-top: 40px; font-size: 14px; color: var(--text-secondary); }
.legal-company-card { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; margin: 20px 0 32px; }
.legal-company-info dt { font-weight: 700; color: var(--primary-dark); margin-top: 14px; font-size: 14px; }
.legal-company-info dt:first-child { margin-top: 0; }
.legal-company-info dd { margin: 4px 0 0 0; padding-left: 0; font-size: 15px; color: var(--text-primary); }
.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0 16px; font-size: 13.5px; }
.legal-table th, .legal-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; line-height: 1.7; }
.legal-table thead th { background: #f5f3ff; color: var(--primary-dark); font-weight: 700; }
.legal-table tbody td { background: #fff; color: var(--text-primary); }
@media (max-width: 640px) { .legal-table { font-size: 12.5px; } .legal-table th, .legal-table td { padding: 6px 8px; } }

@media (max-width: 640px) {
    .legal-header { padding: 12px 16px; }
    .legal-main { padding: 24px 16px; }
    .legal-title { font-size: 22px; }
}
