:root { 
    --primary: #3498db;
    --primary-hover: #2980b9;
    --primary-light: #ebf5fb;
    --secondary: #636e72;
    --accent: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --bg: #edf2f7;
    --card-bg: #ffffff;
    --border: #dfe6e9;
    --radius: 12px;
    --radius-sm: 8px;
    --error: #e17055;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 10px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --badge-balance: #27ae60;
    --badge-near: #e74c3c;
    --badge-quality: #f39c12;
    --badge-mono: #95a5a6;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif; background: var(--bg); color: var(--text); line-height: 1.7; min-height: 100vh; display: flex; flex-direction: column; font-size: 16px; }
.app-container { max-width: 800px; margin: 0 auto; width: 100%; flex-grow: 1; padding: 20px; display: flex; flex-direction: column; }

.app-header { text-align: center; margin-bottom: 30px; padding: 20px 10px; }
.app-title { font-size: 1.8rem; font-weight: 800; color: var(--text); margin: 0 0 8px 0; letter-spacing: 0.02em; }
.app-subtitle { font-size: 1rem; color: var(--text-light); margin: 0; }

.wizard-card { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; display: flex; flex-direction: column; }

.progress-container { background: #f1f2f6; height: 8px; width: 100%; position: relative; }
.progress-bar { background: linear-gradient(90deg, var(--primary), var(--success)); height: 100%; width: 20%; transition: width 0.4s ease; border-radius: 0 3px 3px 0; }

/* パンくずリスト改善 (#10) */
.step-breadcrumbs {
    display: flex;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    gap: 8px;
}
.step-breadcrumb {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    font-size: 0.85rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    min-width: 65px;
    position: relative;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 2px solid transparent;
}
.step-breadcrumb:hover { background: var(--primary-light); border-color: var(--primary); }

/* ステップ完了の視覚フィードバック強化 (#6) */
.step-breadcrumb.completed { 
    color: var(--success); 
    font-weight: 600; 
    background: #e8f8f0;
    border-color: var(--success);
}
.step-breadcrumb.completed::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.8rem;
    color: white;
    background: var(--success);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    line-height: 16px;
    text-align: center;
}
.step-breadcrumb.active { color: var(--primary); font-weight: 700; background: var(--primary-light); border-color: var(--primary); }
.step-breadcrumb-number { display: block; font-size: 1.1rem; font-weight: 700; margin-bottom: 2px; }

.step-indicator { padding: 15px 24px; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--primary); font-size: 1rem; display: flex; justify-content: space-between; align-items: center; }
.step-count { background: var(--primary); color: white; padding: 4px 12px; border-radius: 12px; font-size: 0.85rem; margin-right: 10px; font-weight: 700; }

.step-content { padding: 30px 24px; animation: fadeIn 0.5s ease; min-height: 300px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.step-section { display: none; }
.step-section.active { display: block; }

.question-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 30px; text-align: center; color: var(--text); }
.question-title::after { content: ''; display: block; width: 50px; height: 4px; background: var(--primary); margin: 15px auto 0; border-radius: 2px; }

.form-group { margin-bottom: 28px; position: relative; }
.form-label { font-weight: 600; display: block; margin-bottom: 10px; font-size: 1rem; color: var(--text); }
.form-label .required { color: var(--error); margin-left: 4px; font-weight: bold; }
.form-label .optional { color: var(--text-light); font-weight: 400; font-size: 0.9rem; margin-left: 6px; }

/* 入力例の追加 (#7) */
.input-hint {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 6px;
    display: block;
}

.help-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 0.8rem;
    cursor: help;
    margin-left: 6px;
    vertical-align: middle;
    min-width: 44px;
    min-height: 44px;
    margin: -11px 0 -11px 6px;
    background-clip: content-box;
    padding: 11px;
}
.help-tooltip {
    position: absolute;
    background: #2c3e50;
    color: white;
    padding: 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 400;
    z-index: 1000;
    max-width: 300px;
    box-shadow: var(--shadow-lg);
    display: none;
    line-height: 1.6;
    top: 100%;
    left: 0;
}
.help-icon:hover + .help-tooltip { display: block; }

/* フォームコントロールの改善 (#3, #4) */
.form-control { width: 100%; padding: 16px 18px; font-size: 1rem; border: 2px solid var(--border); border-radius: var(--radius-sm); background: #fff; transition: all 0.2s; -webkit-appearance: none; appearance: none; font-family: inherit; min-height: 52px; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-control.error { border-color: var(--error); background-color: #fff8f8; }
.form-control.valid { border-color: var(--success); }
select.form-control { background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23636e72' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 1rem center; background-size: 1em; padding-right: 3rem; }

/* エラーメッセージの親切化 (#8) */
.error-message { color: var(--error); font-size: 0.9rem; margin-top: 8px; display: none; animation: slideDown 0.2s ease; padding: 10px 14px; background: #fff0f0; border-radius: 6px; border-left: 4px solid var(--error); line-height: 1.5; }
.error-message.show { display: block; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

#detailCorrectionGroup { margin-top: 16px; padding: 16px; border-left: 4px solid var(--primary); background-color: var(--primary-light); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.wizard-nav { padding: 20px 24px; background: #f9fafb; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* タブレット・スマホ時のナビゲーションボタン配置 */
@media (max-width: 768px) {
    .wizard-nav {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        grid-template-areas: 
            "prev next"
            "save save"
            "submit submit";
        gap: 10px;
        padding: 15px;
    }
    .wizard-nav .btn-prev { grid-area: prev; justify-self: start; }
    .wizard-nav .btn-next { grid-area: next; justify-self: end; }
    .wizard-nav .btn-save-draft { grid-area: save; justify-self: center; }
    .wizard-nav .btn-submit { grid-area: submit; justify-self: center; width: 80%; }
    .wizard-nav > div[style*="flex-grow"] { display: none; }
}
.btn { padding: 16px 28px; border: none; border-radius: 50px; font-weight: 600; cursor: pointer; font-size: 1rem; transition: all 0.2s; min-width: 120px; text-align: center; font-family: inherit; min-height: 52px; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-prev { background: var(--border); color: var(--secondary); }
.btn-prev:hover:not(:disabled) { background: #b2bec3; }
.btn-next { background: var(--primary); color: white; box-shadow: var(--shadow-md); }
.btn-next:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-2px); }
.btn-submit { background: var(--success); color: white; box-shadow: var(--shadow-md); display: none; }
.btn-submit:hover:not(:disabled) { background: #229954; transform: translateY(-2px); }
.btn-save-draft { background: white; color: var(--secondary); border: 2px solid var(--border); padding: 12px 20px; font-size: 0.95rem; min-width: auto; min-height: 48px; }
.btn-save-draft:hover { border-color: var(--primary); color: var(--primary); }

/* 性格チェック - タップ領域改善 (#4) */
.personality-container { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 5px 0; }
.personality-label { cursor: pointer; flex-shrink: 0; }
.personality-checkbox { display: none; }
.personality-badge { display: inline-block; padding: 14px 20px; border: 2px solid var(--border); border-radius: 30px; color: var(--secondary); font-weight: 600; transition: all 0.2s; background: #fff; user-select: none; white-space: nowrap; font-size: 1rem; min-height: 48px; }
.personality-badge:hover { border-color: var(--primary); transform: translateY(-2px); }
.personality-checkbox:checked + .personality-badge { border-color: var(--primary); background: var(--primary); color: white; transform: scale(1.05); box-shadow: var(--shadow-md); }

.priority-list { display: flex; flex-direction: column; gap: 12px; max-width: 600px; margin: 0 auto; }
.priority-item { background: white; border: 2px solid var(--border); padding: 14px 18px; border-radius: var(--radius-sm); display: flex; align-items: center; font-weight: 600; font-size: 1rem; color: var(--text); transition: all 0.2s; position: relative; cursor: grab; min-height: 56px; }
.priority-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.priority-item.dragging { opacity: 0.5; border-color: var(--primary); box-shadow: var(--shadow-md); }
.priority-rank { background: var(--secondary); color: white; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-right: 14px; font-size: 1rem; transition: background 0.3s; font-weight: 700; flex-shrink: 0; }
.priority-item:nth-child(1) .priority-rank { background: var(--primary); }
.priority-item:nth-child(2) .priority-rank { background: var(--success); }
.priority-item:nth-child(3) .priority-rank { background: var(--accent); }
.priority-controls { margin-left: auto; display: flex; gap: 8px; }
.priority-controls button { background: var(--border); border: none; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; color: var(--secondary); font-weight: bold; font-size: 1.1rem; }
.priority-controls button:hover:not(:disabled) { background: var(--primary); color: white; transform: scale(1.1); }
.priority-controls button:disabled { opacity: 0.3; cursor: not-allowed; }
.priority-hint { text-align: center; font-size: 0.9rem; color: var(--text-light); margin-top: 12px; background: #f8f9fa; padding: 10px 12px; border-radius: var(--radius-sm); }

.slider-section { background: white; padding: 24px; border-radius: var(--radius); border: 2px solid var(--border); }

/* プリセットボタン誘導テキスト (#5) */
.preset-guide {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 600;
}
.preset-guide-sub {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 400;
}

.preset-buttons { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 28px; padding: 16px; background: #f8f9fa; border-radius: var(--radius-sm); }
.preset-btn { padding: 12px 22px; border: 2px solid var(--border); background: white; border-radius: 25px; cursor: pointer; font-size: 1rem; font-weight: 600; color: var(--secondary); transition: all 0.2s; min-height: 48px; }
.preset-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.preset-btn.active { background: var(--primary); border-color: var(--primary); color: white; box-shadow: var(--shadow-md); }
.preset-btn[data-preset="equal"]::before { content: '📊 '; }
.preset-btn[data-preset="far"]::before { content: '🚗 '; }
.preset-btn[data-preset="intermediate"]::before { content: '💻 '; }
.preset-btn[data-preset="near"]::before { content: '📖 '; }

/* スライダー説明ツールチップ (#1) */
.slider-item-tooltip {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
    margin-top: 4px;
    line-height: 1.4;
}

.slider-group { margin: 40px 0 20px; padding: 0 10px; }
.iol-app-slider { height: 60px; background: #dfe6e9; border-radius: 30px; position: relative; margin: 0 20px; touch-action: none; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.iol-app-bg { position: absolute; inset: 0; border-radius: 30px; overflow: hidden; }
.iol-app-handle { width: 44px; height: 44px; background: white; border: 4px solid var(--primary); border-radius: 50%; position: absolute; top: 50%; transform: translate(-50%, -50%); cursor: grab; z-index: 2; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: transform 0.1s, border-color 0.2s; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: var(--primary); user-select: none; }
.iol-app-handle:hover { transform: translate(-50%, -50%) scale(1.1); }
.iol-app-handle.active { transform: translate(-50%, -50%) scale(1.2); border-color: var(--accent); cursor: grabbing; color: var(--accent); }

.slider-labels { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; font-size: 0.85rem; font-weight: 700; gap: 8px; margin-top: 24px; }
.slider-labels > div { padding: 12px 8px; border-radius: var(--radius-sm); background: var(--primary-light); }

.slider-val-wrapper { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 8px; }

/* 右寄せ・幅広め */
.slider-input { 
    width: 60px; 
    padding: 6px 4px; 
    font-size: 1.1rem; 
    text-align: right; 
    border: 2px solid var(--primary); 
    border-radius: 6px; 
    font-weight: 700; 
    color: var(--primary); 
    display: inline-block; 
    background: #fff; 
}

/* 表示切り替え用クラス */
.print-text { display: none; }
.screen-text { display: inline; }
.dot { display: none; }

.exclude-section-wrapper { margin-top: 30px; border-top: 2px dashed var(--border); padding-top: 24px; background-color: #fffbf0; border-radius: var(--radius-sm); padding: 20px; text-align: center; }
.exclude-title-label { font-weight: 700; color: var(--warning); margin-bottom: 16px; display: block; font-size: 1rem; }

.loading-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.9); z-index: 2000; justify-content: center; align-items: center; flex-direction: column; }
.loading-overlay.show { display: flex; }
.spinner { width: 50px; height: 50px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-text { margin-top: 15px; font-weight: 600; color: var(--text); }

/* Toast notification - Top Center */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: var(--success); color: white; padding: 16px 24px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 3000; display: none; font-weight: 600; animation: slideInDown 0.3s ease; }
.toast.show { display: block; }
.toast.error { background: var(--error); }
@keyframes slideInDown { from { transform: translateX(-50%) translateY(-100%); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; justify-content: center; align-items: center; }
.modal-overlay.open { display: flex; }
.modal-content { background: white; padding: 32px; border-radius: var(--radius); max-width: 500px; width: 90%; text-align: center; box-shadow: var(--shadow-lg); }
.modal-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
.modal-body { text-align: left; background: #fff3cd; padding: 16px; border-radius: var(--radius-sm); color: #856404; margin-bottom: 20px; line-height: 1.6; }

.iol-app-results { display: none; animation: fadeIn 0.5s ease; padding-bottom: 50px; }
.iol-app-results.show { display: block; }

.patient-summary-box { background-color: #e8f5e9; border: 2px solid var(--primary); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.iol-app-lens { background: white; border-radius: var(--radius-sm); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: all 0.2s; }
.iol-app-lens:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.iol-app-lens-header { display: flex; align-items: center; margin-bottom: 10px; }
.iol-app-lens-name { font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.iol-app-lens-score { color: var(--success); font-weight: 700; font-size: 1.1rem; }
.iol-app-rank { width: 36px; height: 36px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; margin-right: 15px; font-size: 1.1rem; color: white; flex-shrink: 0; }

.lens-category-badge { color: white; padding: 6px 14px; border-radius: 20px; font-size: 0.8rem; margin-left: 10px; vertical-align: middle; display: inline-block; font-weight: 700; }
.badge-balance { background-color: var(--badge-balance) !important; }
.badge-near { background-color: var(--badge-near) !important; }
.badge-quality { background-color: var(--badge-quality) !important; }
.badge-mono { background-color: var(--badge-mono) !important; }

.stacked-bar-track { display: flex; height: 20px; background: var(--border); border-radius: 10px; overflow: hidden; margin-top: 12px; }
/* 白い線を追加 */
.stacked-bar-track > div:not(:last-child) { border-right: 1px solid #fff; }

.seg-clarity { background: #27ae60; } .seg-driving { background: #3498db; } .seg-computer { background: #f39c12; } .seg-reading { background: #e74c3c; }
.breakdown-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; font-size: 0.85rem; background: #f8f9fa; padding: 12px; border-radius: var(--radius-sm); }
.breakdown-total { grid-column: 1/-1; text-align: right; font-weight: 700; margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }

.score-explanation { background: #e8f4fd; padding: 12px 15px; border-radius: var(--radius-sm); margin: 15px 0; font-size: 0.9rem; color: var(--text); line-height: 1.6; text-align: left; border-left: 4px solid var(--primary); }

#personalized-comment-container { background: #f0f8ff; border: 2px solid var(--primary); padding: 20px; margin-bottom: 25px; border-radius: var(--radius); font-size: 0.95rem; line-height: 1.7; display: none; }
.comment-title { font-weight: 700; color: var(--primary); margin-bottom: 12px; font-size: 1.1rem; display: flex; align-items: center; }
.comment-title::before { content: '💡'; margin-right: 8px; font-size: 1.2rem; }
#personalized-comment-container .highlight-val { color: #c0392b !important; font-weight: 900 !important; background: rgba(255, 230, 0, 0.15); padding: 0 2px; border-radius: 2px; }

/* Results Lifestyle Bar - No handles, No Numbers */
#lifestyle-visual-clone { margin-bottom: 20px; padding: 20px; background: #fff; border-radius: var(--radius); border: 2px solid #e2e8f0; }
#lifestyle-visual-clone .slider-input { border: none; background: transparent; font-size: 1.1rem; pointer-events: none; }
#lifestyle-visual-clone .slider-val-wrapper { margin-top: 0; }
#lifestyle-visual-clone .iol-app-handle { display: none !important; }

.iol-app-results-header { text-align: center; margin-bottom: 30px; padding: 20px; background: #f8f9fa; border-top: 5px solid var(--primary); border-radius: 0 0 var(--radius) var(--radius); }
.iol-app-results-title { font-size: 1.8rem; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.iol-app-results-note { font-size: 1rem; color: var(--text-light); font-weight: 600; }
.iol-app-section-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 20px; color: var(--text); display: flex; align-items: center; border-bottom: 2px solid #edf2f7; padding-bottom: 10px; }
.iol-app-section-title::before { content: ''; width: 6px; height: 24px; background: var(--primary); margin-right: 12px; border-radius: 3px; }

.print-disclaimer-box, .print-footer-container, .only-print { display: none; }

@media (max-width: 768px) {
    .app-container { padding: 10px; }
    .app-title { font-size: 1.5rem; }
    .step-content { padding: 20px 15px; }
    .question-title { font-size: 1.2rem; }
    .form-control { padding: 14px 15px; font-size: 16px; }
    .btn { padding: 14px 20px; min-height: 48px; }
    .wizard-nav { padding: 15px; }
    .personality-container { justify-content: flex-start; }
    .personality-badge { padding: 10px 14px; font-size: 0.9rem; }
    .priority-controls button { width: 36px; height: 36px; }
    .slider-labels { font-size: 0.75rem; gap: 4px; }
    .slider-input { width: 50px; font-size: 1rem; }
    .iol-app-handle { width: 38px; height: 38px; font-size: 0.7rem; }
    .step-breadcrumb { font-size: 0.7rem; min-width: 60px; padding: 6px 2px; }
    .step-breadcrumb-number { font-size: 0.9rem; }
    .breakdown-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    div[style*="grid-template-columns: 1fr 1fr"] { 
        display: flex !important; 
        flex-direction: column !important; 
        gap: 15px !important; 
    }
}

@media print {
    @page { margin: 6mm; size: A4 portrait; }
    
    body { 
        background-color: white !important; 
        -webkit-print-color-adjust: exact !important; 
        print-color-adjust: exact !important; 
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .app-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .no-print, .wizard-card, .app-header, .score-explanation { display: none !important; }
    .iol-app-results { display: block !important; padding: 0 !important; }
    .only-print { display: block !important; }
    .print-disclaimer-box { display: block !important; padding: 5px; border: 1px solid #666; font-size: 8pt; margin-bottom: 10px; }
    
    /* ページ制御: レンズリストの前で必ず改ページ */
    .iol-app-results-header { 
        page-break-before: always !important; 
        break-before: page !important;
        margin-top: 0 !important;
        padding: 10px !important;
        background: white !important;
        border-top: none !important;
        border-radius: 0 !important;
    }
    
    .iol-app-results-title {
        font-size: 1.3rem !important;
        margin-bottom: 5px !important;
    }
    
    .iol-app-results-note {
        font-size: 0.85rem !important;
    }
    
    .print-disclaimer-box {
        font-size: 7pt !important;
        padding: 4px !important;
        margin-bottom: 8px !important;
    }

    /* レンズカードのみ分割を避ける（1ページ目のボックスは分割許可） */
    .iol-app-lens { 
        break-inside: avoid !important; 
        page-break-inside: avoid !important;
    }

    .patient-summary-box { 
        border: 1px solid var(--primary) !important; 
        padding: 8px 12px !important; 
        margin-bottom: 8px !important;
    }
    
    /* 患者情報の行間を狭める */
    .patient-summary-box .iol-app-lens-name {
        padding-bottom: 5px !important;
        margin-bottom: 8px !important;
    }
    .patient-summary-box div[style*="grid"] {
        gap: 4px 15px !important;
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }
    
    #lifestyle-visual-clone { 
        border: 1px solid var(--primary) !important; 
        padding: 8px 12px !important; 
        margin-bottom: 8px !important;
    }
    
    /* ライフスタイルセクションタイトルをコンパクトに */
    #lifestyle-visual-clone .iol-app-section-title {
        font-size: 1.1rem !important;
        margin-bottom: 10px !important;
        padding-bottom: 5px !important;
    }
    
    #personalized-comment-container {
        margin-top: 0 !important;
        margin-bottom: 8px !important;
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }
    
    #personalized-comment-container .comment-title {
        font-size: 1rem !important;
        margin-bottom: 8px !important;
    }
    
    /* 結果コンテンツグループ - break-inside避けない */
    #results-content-group {
        display: block !important;
    }
    #results-content-group > div {
        margin-bottom: 8px !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
    }
    
    /* アドバイスボックスのみ分割を避けない設定を解除 */
    #personalized-comment-container {
        page-break-inside: auto !important;
        break-inside: auto !important;
    }
    
    /* スライダー印刷調整 - 画面表示と同じレイアウトを維持 */
    .iol-app-slider { height: 24px !important; margin: 0 8px !important; } 
    
    .slider-labels { 
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 2px !important;
        margin-top: 6px !important;
    }
    
    .slider-labels > div { 
        background: var(--primary-light) !important;
        padding: 4px 4px 2px 4px !important;
        text-align: center !important;
        font-size: 8pt !important;
        border-radius: 4px !important;
    }
    
    .slider-val-wrapper {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 1px !important;
        margin-top: 1px !important;
        margin-bottom: 0 !important;
    }
    
    .slider-input { 
        border: 1px solid var(--primary) !important; 
        width: auto !important; 
        max-width: 35px !important;
        padding: 1px 2px !important;
        font-size: 10pt !important; 
        font-weight: 700 !important;
        background: #fff !important;
        text-align: right !important;
        border-radius: 4px !important;
    }
    
    .slider-val-wrapper > span {
        font-size: 8pt !important;
    }
    
    .slider-group {
        margin: 5px 0 3px !important;
        padding: 0 8px !important;
    }

    /* 印刷時も画面表示のまま（切り替えなし） */
    .print-text { display: none !important; }
    .screen-text { display: inline !important; }
    .dot { display: none !important; }
    .slider-item-tooltip { display: none !important; }

    .iol-app-lens { 
        border: 1px solid #ccc !important; 
        margin-bottom: 6px !important;
        padding: 8px 12px !important;
    }
    
    .iol-app-lens-header {
        margin-bottom: 4px !important;
    }
    
    .iol-app-lens-name {
        font-size: 1rem !important;
        margin-bottom: 2px !important;
    }
    
    .iol-app-lens-score {
        font-size: 0.9rem !important;
    }
    
    .iol-app-rank {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.9rem !important;
        margin-right: 10px !important;
    }
    
    .lens-category-badge {
        padding: 3px 8px !important;
        font-size: 0.7rem !important;
    }
    
    /* レンズ説明文をコンパクトに */
    .iol-app-lens > div[style*="font-size:0.9rem"] {
        font-size: 0.8rem !important;
        margin-bottom: 8px !important;
        line-height: 1.4 !important;
    }
    
    .stacked-bar-track {
        height: 14px !important;
        margin-top: 6px !important;
    }
    
    .breakdown-grid {
        padding: 6px 8px !important;
        gap: 3px !important;
        margin-top: 6px !important;
        font-size: 0.75rem !important;
    }
    
    .breakdown-total {
        margin-top: 4px !important;
        padding-top: 4px !important;
    }
    
    /* Breakdown Layout for Print: 1行目に%を均等、2行目に合計 */
    .breakdown-grid { 
        display: flex !important; 
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        grid-template-columns: none !important;
        gap: 5px;
    }
    .breakdown-grid > div:not(.breakdown-total) { 
        flex: 1 0 20% !important; 
        text-align: center !important;
        font-size: 9pt; 
        white-space: nowrap; 
    }
    .breakdown-total { 
        flex: 1 0 100% !important; 
        width: 100% !important;
        border-top: 1px solid #ccc !important;
        margin-top: 5px !important; 
        padding-top: 5px !important; 
        border-left: none !important;
        text-align: right !important;
    }

    .print-footer-container { display: block !important; border-top: 1px solid #ccc; text-align: center; font-size: 8pt; padding-top: 10px; margin-top: 20px; }
}