/**
 * Abeswell Loan Diagnosis - Frontend CSS (シンプル版)
 * 洗練されたミニマルデザイン
 */

/* ================================
   カラー変数定義
   ================================ */
:root {
    /* プライマリカラー */
    --ald-primary: #022f7c;
    --ald-primary-hover: #021f52;
    --ald-primary-light: #e6ecf5;
    --ald-primary-dark: #011a45;
    
    /* 追加カラー（AI診断強調用） */
    --ald-purple: #8B5CF6;
    --ald-purple-light: #EDE9FE;
    --ald-blue-accent: #3B82F6;
    --ald-blue-accent-light: #DBEAFE;
    --ald-green-accent: #10B981;
    --ald-green-accent-light: #D1FAE5;
    
    /* グレースケール */
    --ald-gray-900: #111827;
    --ald-gray-800: #1F2937;
    --ald-gray-700: #374151;
    --ald-gray-600: #4B5563;
    --ald-gray-500: #6B7280;
    --ald-gray-400: #9CA3AF;
    --ald-gray-300: #D1D5DB;
    --ald-gray-200: #E5E7EB;
    --ald-gray-100: #F3F4F6;
    --ald-gray-50: #F9FAFB;
    
    /* テキスト */
    --ald-text-primary: #111827;
    --ald-text-secondary: #6B7280;
    --ald-text-light: #9CA3AF;
    --ald-text-white: #FFFFFF;
    
    /* その他 */
    --ald-success: #10B981;
    --ald-warning: #F59E0B;
    --ald-danger: #EF4444;
    --ald-bg-white: #FFFFFF;
    --ald-border-radius: 8px;
    --ald-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ald-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --ald-transition: all 0.15s ease;
}

/* ================================
   基本設定・リセット
   ================================ */
.ald-diagnosis-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans JP", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--ald-text-primary);
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    animation: ald-fade-in 0.3s ease;
}

@keyframes ald-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ald-diagnosis-container * {
    box-sizing: border-box;
}

/* SWELLテーマのスタイルを完全リセット */
.ald-diagnosis-container [class*="swl-"],
.ald-diagnosis-container [class*="has-swl-"],
.ald-diagnosis-container [class*="is-style-"],
.ald-diagnosis-container [class*="wp-block"] {
    all: revert !important;
}

/* 見出しのリセット */
body .ald-diagnosis-container h1,
body .ald-diagnosis-container h2,
body .ald-diagnosis-container h3,
body .ald-diagnosis-container h4,
body .ald-diagnosis-container h5,
body .ald-diagnosis-container h6 {
    all: unset !important;
    display: block !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: var(--ald-text-primary) !important;
    -webkit-text-fill-color: var(--ald-text-primary) !important;
    text-decoration: none !important;
}

/* 疑似要素のリセット */
body .ald-diagnosis-container h1::before,
body .ald-diagnosis-container h1::after,
body .ald-diagnosis-container h2::before,
body .ald-diagnosis-container h2::after,
body .ald-diagnosis-container h3::before,
body .ald-diagnosis-container h3::after {
    content: none !important;
    display: none !important;
}

/* ================================
   カード
   ================================ */
.ald-card {
    background: var(--ald-bg-white);
    border: 1px solid var(--ald-gray-200);
    border-radius: var(--ald-border-radius);
    padding: 16px;
    margin-bottom: 16px;
}

@media (min-width: 640px) {
    .ald-card {
        padding: 20px;
    }
}

/* ================================
   プログレスバー（ミニマル版）
   ================================ */
.ald-progress {
    margin-bottom: 12px;
}

.ald-progress-header {
    margin-bottom: 10px;
}

.ald-progress-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--ald-text-primary) !important;
    letter-spacing: -0.02em;
    text-align: center;
}

.ald-progress-bar-wrapper {
    margin-bottom: 8px;
}

.ald-progress-label {
    font-size: 12px;
    color: var(--ald-text-secondary);
    margin-bottom: 6px;
    display: block;
}

.ald-progress-bar {
    height: 3px;
    background: var(--ald-gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.ald-progress-fill {
    height: 100%;
    background: var(--ald-progress-color, #022f7c);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.ald-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: ald-shimmer 2s infinite;
}

@keyframes ald-shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.ald-progress-percentage {
    font-size: 12px;
    color: var(--ald-text-secondary);
    text-align: right;
    margin-top: 4px;
}

/* ================================
   質問エリア
   ================================ */
.ald-question-container {
    margin-bottom: 12px;
}

.ald-question-label {
    display: block;
    font-size: 17px;
    font-weight: 600;
    color: var(--ald-text-primary);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
    line-height: 1.4;
    animation: ald-fade-in 0.4s ease;
}

/* アコーディオン */
.ald-accordion-wrapper {
    width: 100%;
    margin-bottom: 0;
    border: 1px solid var(--ald-gray-300);
    border-radius: var(--ald-border-radius);
    overflow: hidden;
    transition: var(--ald-transition);
}

.ald-accordion-wrapper.ald-accordion-open {
    border-color: #022f7c;
}

.ald-accordion-toggle {
    width: 100%;
    padding: 16px 20px;
    background: var(--ald-bg-white);
    border: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--ald-text-primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.ald-accordion-toggle:hover {
    background: var(--ald-gray-50);
}

.ald-accordion-toggle:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--ald-primary-light);
}

.ald-accordion-selected {
    flex: 1;
    padding-right: 12px;
}

.ald-accordion-arrow {
    font-size: 12px;
    color: var(--ald-gray-500);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
}

.ald-accordion-open .ald-accordion-arrow {
    transform: rotate(180deg);
    color: #022f7c;
}

.ald-accordion-content {
    border-top: 1px solid var(--ald-gray-200);
    max-height: 300px;
    overflow-y: auto;
    background: var(--ald-gray-50);
}

.ald-accordion-content .ald-options-list {
    margin: 0;
    padding: 8px;
    gap: 4px;
}

.ald-accordion-content .ald-option-item {
    background: var(--ald-bg-white);
    margin: 0;
}

.ald-accordion-content .ald-option-item:hover {
    background: var(--ald-bg-white);
    border-color: #022f7c;
}

.ald-accordion-content .ald-option-item.ald-selected {
    background: #022f7c;
    color: var(--ald-text-white);
    border-color: #022f7c;
}

/* スクロールバーカスタマイズ */
.ald-accordion-content::-webkit-scrollbar {
    width: 6px;
}

.ald-accordion-content::-webkit-scrollbar-track {
    background: var(--ald-gray-100);
}

.ald-accordion-content::-webkit-scrollbar-thumb {
    background: var(--ald-gray-400);
    border-radius: 3px;
}

.ald-accordion-content::-webkit-scrollbar-thumb:hover {
    background: var(--ald-gray-500);
}

/* グリッドボタン */
.ald-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 6px;
    margin-bottom: 0;
}

.ald-options-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .ald-options-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ald-options-grid-3 {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .ald-options-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 雇用形態: PC 4列(2行×4列), SP 2列(4行×2列) */
.ald-grid-employment {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .ald-grid-employment {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 居住形態: PC 3列(2行×3列), SP 2列(3行×2列) */
.ald-grid-residence-type {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .ald-grid-residence-type {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 資金使途: PC 3列(2行×3列), SP 2列(3行×2列) */
.ald-grid-purpose {
    grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 768px) {
    .ald-grid-purpose {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 480px) {
    .ald-options-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }
}

.ald-option-btn {
    padding: 10px 8px;
    background: var(--ald-bg-white);
    border: 2px solid var(--ald-gray-300);
    border-radius: var(--ald-border-radius);
    font-size: 14px;
    font-weight: 500;
    color: var(--ald-text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    position: relative;
    overflow: hidden;
}

.ald-option-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.ald-option-btn:active::before {
    width: 100%;
    height: 100%;
}

.ald-option-btn:hover {
    border-color: #022f7c;
    background: var(--ald-gray-50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.ald-option-btn.ald-selected {
    background: #022f7c;
    border-color: #022f7c;
    color: var(--ald-text-white);
    font-weight: 600;
    transform: scale(1.02);
}

.ald-option-btn.ald-selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: var(--ald-bg-white);
    color: #022f7c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: ald-check-pop 0.3s ease;
}

@keyframes ald-check-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* リスト形式 */
.ald-options-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 0;
}

.ald-option-item {
    padding: 10px 16px;
    background: var(--ald-bg-white);
    border: 2px solid var(--ald-gray-200);
    border-radius: 12px;
    font-size: 14px;
    color: var(--ald-text-primary);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 44px;
    line-height: 1.2;
}

.ald-option-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: #022f7c;
    transform: scaleY(0);
    transition: transform 0.2s;
}

.ald-option-item:hover {
    border-color: #022f7c;
    background: var(--ald-gray-50);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ald-option-item:hover::before {
    transform: scaleY(1);
}

.ald-option-item.ald-selected {
    background: linear-gradient(135deg, #022f7c, #0356b8);
    border-color: #022f7c;
    color: var(--ald-text-white);
    box-shadow: 0 4px 12px rgba(2, 47, 124, 0.3);
}

.ald-option-item.ald-selected::after {
    content: "✓";
    font-size: 18px;
    animation: ald-check-slide 0.3s ease;
}

@keyframes ald-check-slide {
    from {
        transform: translateX(10px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ================================
   ナビゲーション
   ================================ */
.ald-navigation {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 8px;
}

/* 戻るリンク */
.ald-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ald-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 6px;
}

.ald-back-link:hover {
    color: #022f7c;
    background: var(--ald-gray-50);
    transform: translateX(-2px);
}

.ald-back-link:active {
    transform: translateX(-4px);
}

.ald-back-arrow {
    font-size: 16px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.ald-back-link:hover .ald-back-arrow {
    transform: translateX(-2px);
}

/* ================================
   計算中画面
   ================================ */
.ald-calculating-screen {
    text-align: center;
    padding: 60px 20px;
}

.ald-spinner {
    width: 48px;
    height: 48px;
    position: relative;
    margin: 0 auto 24px;
}

.ald-spinner::before,
.ald-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--ald-primary);
    animation: ald-spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.ald-spinner::after {
    animation-delay: 0.3s;
    border-top-color: var(--ald-primary-light);
}

@keyframes ald-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ald-calculating-text {
    color: var(--ald-text-secondary);
    font-size: 16px;
    font-weight: 500;
    position: relative;
}

.ald-calculating-text::after {
    content: '...';
    position: absolute;
    margin-left: 2px;
    animation: ald-dots 1.4s infinite;
}

@keyframes ald-dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%, 100% {
        content: '...';
    }
}

/* ================================
   結果画面
   ================================ */
.ald-result-container {
    max-width: 640px;
    margin: 0 auto;
}

/* 結果ヘッダー */
.ald-result-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 20px;
    position: relative;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(2, 47, 124, 0.03) 0%, rgba(59, 130, 246, 0.05) 100%);
    border-radius: 8px;
}

/* PR バッジ（結果全体） */
.ald-pr-badge-result {
    background: var(--ald-gray-200);
    color: var(--ald-text-secondary);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.ald-result-icon {
    display: none;
}

.ald-result-main-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--ald-text-primary) !important;
    text-align: left !important;
    margin: 0 !important;
    letter-spacing: -0.02em;
}

.ald-result-subtitle {
    display: none;
}

/* 推奨カード */
.ald-recommended-card {
    background: linear-gradient(135deg, #022f7c, #0356b8);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    position: relative;
    color: white;
    box-shadow: 0 4px 12px rgba(2, 47, 124, 0.25);
}

.ald-recommended-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
}

.ald-badge-star {
    color: #FCD34D;
    font-size: 16px;
}

.ald-badge-text {
    color: white;
}

.ald-recommended-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ald-recommended-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ald-recommended-name {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: white !important;
    -webkit-text-fill-color: white !important;
    margin: 0 !important;
}

.ald-recommended-score {
    font-size: 32px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ald-score-trend {
    font-size: 20px;
}

.ald-recommendation-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 8px 0;
}

.ald-reason-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 700;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    animation: ald-badge-pulse 2s ease-in-out infinite;
}

@keyframes ald-badge-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
    }
}

.ald-recommended-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 8px;
    overflow: hidden;
}

.ald-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 10px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    white-space: nowrap;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.ald-recommended-cta,
span.ald-recommended-cta {
    display: block;
    width: 100%;
    padding: 14px;
    background: white;
    color: #022f7c !important;
    text-align: center;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    margin-top: 12px;
    transition: all 0.2s;
    position: relative;
}

a.ald-recommended-cta:hover,
span.ald-recommended-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ald-cta-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    transition: transform 0.2s;
}

a.ald-recommended-cta:hover .ald-cta-arrow,
span.ald-recommended-cta:hover .ald-cta-arrow {
    transform: translateY(-50%) translateX(4px);
}

/* その他の選択肢 */
.ald-other-products {
    margin-bottom: 24px;
}

.ald-other-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--ald-text-secondary) !important;
    margin: 0 0 12px 0 !important;
}

.ald-other-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--ald-gray-200);
    border-radius: 12px;
    overflow: hidden;
}

.ald-other-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: white;
    transition: background 0.2s;
    position: relative;
}

.ald-other-item:hover {
    background: var(--ald-gray-50);
}

/* PR バッジ（その他の選択肢用・小） */
.ald-pr-badge-small {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--ald-gray-200);
    color: var(--ald-text-secondary);
    font-size: 9px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.ald-other-left {
    flex: 1;
}

.ald-other-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.ald-other-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--ald-text-primary);
}

.ald-other-score {
    font-size: 18px;
    font-weight: 700;
    color: #022f7c;
}

.ald-other-features {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.ald-other-feature {
    font-size: 10px;
    color: var(--ald-text-secondary);
    background: var(--ald-gray-50);
    padding: 3px 8px;
    border-radius: 10px;
    border: 1px solid var(--ald-gray-300);
    white-space: nowrap;
    flex-shrink: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.ald-other-cta,
span.ald-other-cta {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #022f7c;
    color: white !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    border-radius: 6px;
    justify-content: center;
    line-height: 1.2;
    white-space: nowrap;
}

a.ald-other-cta:hover,
span.ald-other-cta:hover {
    background: #021f52;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(2, 47, 124, 0.2);
}

.ald-cta-text {
    font-size: 13px;
}

.ald-other-arrow {
    font-size: 14px;
    transition: transform 0.2s;
    display: inline-block;
}

a.ald-other-cta:hover .ald-other-arrow,
span.ald-other-cta:hover .ald-other-arrow {
    transform: translateX(3px);
}

/* 免責文（小） */
.ald-disclaimer-small {
    font-size: 11px;
    color: var(--ald-text-light);
    text-align: center;
    margin: 20px 0;
    line-height: 1.5;
}


/* 再診断ボタン */
.ald-restart-container {
    text-align: center;
    padding: 20px 0;
}

.ald-restart-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--ald-bg-white);
    color: var(--ald-text-primary);
    border: 2px solid var(--ald-gray-300);
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ald-restart-btn:hover {
    background: var(--ald-gray-50);
    border-color: #022f7c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ================================
   レスポンシブ
   ================================ */
@media (max-width: 480px) {
    .ald-diagnosis-container {
        padding: 12px;
    }
    
    .ald-card {
        padding: 12px;
    }
    
    .ald-progress-title {
        font-size: 16px !important;
    }
    
    .ald-question-label {
        font-size: 16px;
    }
    
    .ald-back-link {
        font-size: 13px;
        padding: 4px 8px;
    }
    
    /* 結果画面のモバイル調整 */
    .ald-recommended-card {
        padding: 16px;
    }
    
    .ald-recommended-name {
        font-size: 20px !important;
    }
    
    .ald-recommended-score {
        font-size: 28px;
    }
    
    .ald-tag {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .ald-other-item {
        padding: 12px;
    }
    
    .ald-other-name {
        font-size: 14px;
    }
    
    .ald-other-score {
        font-size: 16px;
    }
}

/* ================================
   スタート画面（コンパクト版）
   ================================ */
.ald-start-card {
    background: var(--ald-bg-white);
    border: 1px solid var(--ald-gray-200);
    border-radius: var(--ald-border-radius);
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    position: relative;
}

/* コンパクトなヘッダー */
.ald-start-header-compact {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ald-gray-200);
}

.ald-ai-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--ald-primary), var(--ald-blue-accent));
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

.ald-ai-icon {
    font-size: 14px;
}

.ald-start-title-compact {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--ald-text-primary) !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.4 !important;
}

.ald-accent-text {
    color: var(--ald-primary);
    background: linear-gradient(135deg, var(--ald-primary), var(--ald-blue-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* インライン特徴 */
.ald-feature-inline {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 12px;
    color: var(--ald-text-secondary);
}

.ald-feature-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ald-feature-check {
    color: var(--ald-blue-accent);
    font-weight: 600;
    font-size: 14px;
}

/* 最初の質問スタイル */
.ald-first-question {
    margin-top: 8px;
}

.ald-first-question .ald-question-label {
    font-size: 16px;
    margin-bottom: 10px;
}

/* 注記 */
.ald-start-note-compact {
    font-size: 11px;
    color: var(--ald-text-light);
    margin: 12px 0 0 0;
    text-align: center;
}

/* AI要素を質問画面にも追加 */
.ald-ai-icon-small {
    font-size: 18px;
    margin-right: 6px;
    vertical-align: middle;
}

.ald-progress-title {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* モバイル対応 */
@media (max-width: 480px) {
    .ald-start-card {
        padding: 12px;
    }
    
    .ald-start-title-compact {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
    
    .ald-feature-inline {
        gap: 10px;
        font-size: 10px;
        flex-wrap: wrap;
    }
    
    .ald-first-question .ald-question-label {
        font-size: 15px;
    }
}

/* ================================
   PR枠セクション
   ================================ */
.ald-pr-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--ald-gray-200);
}

.ald-pr-header {
    text-align: center;
    margin-bottom: 20px;
}

.ald-pr-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--ald-text-secondary) !important;
    margin: 0 0 8px 0 !important;
}

.ald-pr-disclaimer {
    font-size: 11px;
    color: var(--ald-text-light);
    margin: 0;
}

.ald-pr-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.ald-pr-card {
    background: var(--ald-bg-white);
    border: 1px solid var(--ald-gray-200);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.ald-pr-card:hover {
    border-color: var(--ald-primary);
    box-shadow: 0 4px 12px rgba(2, 47, 124, 0.1);
    transform: translateY(-2px);
}

.ald-pr-card-body {
    padding: 16px;
}

.ald-pr-product-name {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--ald-text-primary) !important;
    margin: 0 0 8px 0 !important;
}

.ald-pr-description {
    font-size: 13px;
    color: var(--ald-text-secondary);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.ald-pr-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ald-pr-info-item {
    font-size: 12px;
    color: var(--ald-text-secondary);
    padding: 4px 8px;
    background: var(--ald-gray-50);
    border-radius: 4px;
}

.ald-pr-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.ald-pr-feature {
    font-size: 11px;
    color: var(--ald-primary);
    padding: 4px 8px;
    background: var(--ald-primary-light);
    border-radius: 4px;
    font-weight: 500;
}

.ald-pr-cta {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--ald-gray-100);
    color: var(--ald-text-primary);
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-top: 1px solid var(--ald-gray-200);
    transition: all 0.2s ease;
}

.ald-pr-cta:hover {
    background: var(--ald-primary-light);
    color: var(--ald-primary);
}

/* モバイル対応 */
@media (max-width: 768px) {
    .ald-pr-list {
        grid-template-columns: 1fr;
    }
    
    .ald-pr-card-body {
        padding: 14px;
    }
}

/* ================================
   追加アニメーション
   ================================ */
.ald-pulse {
    animation: ald-pulse 2s infinite;
}

.ald-score-complete {
    animation: ald-bounce 0.5s ease;
}

@keyframes ald-bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes ald-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(74, 144, 226, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 144, 226, 0);
    }
}

/* スムーズなトランジション */
.ald-question-container {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ald-progress-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ald-progress-counter {
    font-size: 14px;
    font-weight: 600;
    color: var(--ald-primary);
}

/* ツールチップ */
.ald-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.ald-tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--ald-gray-900);
    color: var(--ald-text-white);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    margin-bottom: 8px;
}

.ald-tooltip:hover::after {
    opacity: 1;
}

/* より洗練されたボックスシャドウ */
.ald-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 
                0 1px 2px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease;
}

.ald-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 
                0 2px 4px rgba(0, 0, 0, 0.08);
}

/* タッチデバイス用の改善 */
@media (hover: none) {
    .ald-option-btn:active {
        background: var(--ald-gray-100);
    }
    
    .ald-btn-nav:active {
        transform: scale(0.98);
    }
}

/* ================================
   アクセシビリティ
   ================================ */
.ald-btn-nav:focus-visible,
.ald-option-btn:focus-visible,
.ald-option-item:focus-visible,
.ald-select:focus-visible {
    outline: 2px solid var(--ald-text-primary);
    outline-offset: 2px;
}

/* スクリーンリーダー用 */
.ald-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}