/* =========================================
   result_standard.css
   評価結果レポートページ専用スタイル
   ========================================= */

/* --- General Body & Font Styles --- */
body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background-color: #f8fafc;
    /* slate-50 */
    margin: 0;
}

html {
    scroll-behavior: smooth;
}

/* --- Layout Containers --- */
.container {
    margin-left: auto;
    margin-right: auto;
    padding: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding: 2rem;
    }
}

.content-wrapper {
    display: flex;
}

main {
    flex: 1;
    min-width: 0;
    margin-left: 1.5rem;
    transition: margin-left 0.3s ease-in-out;
}

/* --- Desktop Sidebar --- */
.desktop-sidebar {
    width: 16rem;
    /* 256px */
    flex-shrink: 0;
    display: none;
    /* Mobile default */
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

.sticky-nav {
    position: sticky;
    top: 2rem;
}

.sticky-nav h3 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #0f172a;
}

.sticky-nav ul {
    font-size: 0.9rem;
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sticky-nav a {
    display: block;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    padding: 0.25rem 0;
}

.sticky-nav a:hover {
    color: #2563eb;
    font-weight: 600;
}

/* --- Main Title & Section Styles --- */
.main-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.content-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    border: 1px solid #e2e8f0;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    color: #0f172a;
}

.section-subtitle {
    margin-bottom: 1rem;
    font-style: italic;
    color: #64748b;
    font-size: 1rem;
    line-height: 1.8;
}

.section-subtitle .status-cell {
    display: inline-block !important;
    width: 1.1em;
    height: 1.1em;
    vertical-align: -0.2em;
    margin: 0 0.2em;
    object-fit: contain;
}

/* --- Icons --- */
.icon {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: 0.75rem;
    color: #3b82f6;
}

.icon-sm {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}

.icon-check {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    color: #22c55e;
    flex-shrink: 0;
     display: inline-block;
}
.icon-check0 {
    color: #22c55e;
/*    color: #0ea5e9; */
}
.icon-check1 {
    color: #ef4444;
}
.icon-check2 {
    color: #64748b;
}

/* --- Buttons --- */
.btn-read-aloud {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.readspeaker-placeholder {
    display: flex;
    justify-content: flex-end;
    /* 右側に寄せる */
    margin-bottom: 0.5rem;
    /* タイトルとの間に少し余白を空ける */
}

.btn-read-aloud:hover {
    background-color: #f1f5f9;
    border-color: var(--primary-color);
}

.info-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: color 0.2s ease-in-out;
}

.info-btn:hover {
    color: #4b5563;
}

/* --- Accordion (Generic) --- */
.accordion-container,
.accordion-container-default {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.accordion-item {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: #ffffff;
}

.accordion-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background-color: #ffffff;
    border: none;
    cursor: pointer;
    text-align: left;
    font-weight: 500;
    transition: background-color 0.2s;
    gap: 1rem;
}

.accordion-header>span:first-child {
    flex: 1;
    min-width: 0;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
    background-color: #ffffff;
}

.accordion-content p {
    padding: 0.75rem;
    font-size: 1rem;
    color: #475569;
    border-top: 1px solid #e5e7eb;
    margin: 0;
}

/* アコーディオンボタンのテキスト（詳細を見る 等） */
.accordion-button-text {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    color: #374151;
    background-color: #e5e7eb;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

.accordion-button-text:hover {
    background-color: #d1d5db;
    border-color: #9ca3af;
}

/* 開いた状態のボタンスタイル */
.accordion-header[aria-expanded="true"] .accordion-button-text {
    background-color: #6b7280;
    border-color: #4b5563;
    color: #ffffff;
}

.accordion-header[aria-expanded="true"] .accordion-button-text:hover {
    background-color: #4b5563;
}

/* --- Summary Card Design (全体講評エリア) --- */
.summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.summary-card {
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.summary-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.6);
    padding-bottom: 1rem;
}

.summary-card-header h4 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
}

.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.icon-summary {
    width: 20px;
    height: 20px;
}

/* 特によいと思う点 */
.summary-card.type-good {
    background-color: #eff6ff;
    /* Very light blue */
    border-color: #dbeafe;
}

.summary-card.type-good .icon-summary {
    color: var(--primary-color);
}

.summary-card.type-good h4 {
    color: #1e3a8a;
}

.summary-card.type-good .icon-wrapper {
    color: var(--primary-color);
}

/* さらなる改善が望まれる点 */
.summary-card.type-improvement {
    background-color: #fff1f2;
    /* Very light pink */
    border-color: #ffe4e6;
}

.summary-card.type-improvement .icon-summary {
    color: #e11d48;
}

.summary-card.type-improvement h4 {
    color: #881337;
}

/* === Summary Item (One-Line Clean Design) === */
.summary-item {
    background-color: #ffffff !important;
    /* 常に白 */
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
    /* 左側に透明な線を引いて場所を確保 */
    border-left: 4px solid transparent;
    transition: border-left-color 0.3s ease;
}

/* 内部のヘッダー・コンテンツの枠線は削除（親の枠線のみ生かす） */
.summary-item .accordion-header,
.summary-item .accordion-content {
    border: none !important;
    background-color: transparent !important;
}

.summary-item .accordion-header {
    padding: 1rem;
    padding-left: 1rem;
    /* 線が親にあるのでパディングは固定 */
}

/* 開いた状態：親要素の左線の色だけを変える */
.type-good .summary-item:has(.accordion-header[aria-expanded="true"]) {
    border-left-color: var(--primary-color);
    /* 青 */
}

.type-improvement .summary-item:has(.accordion-header[aria-expanded="true"]) {
    border-left-color: #e11d48;
    /* ピンク */
}

/* --- Philosophy Content --- */
.philosophy-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.philosophy-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    background-color: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid #d1d5db;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    margin: 0;
    padding-bottom: 0.5rem;
}

.philosophy-content p {
    margin-top: 0.25rem;
    color: #475569;
    font-size: 1rem;
    padding-left: 1rem;
    border-left: 2px solid #e5e7eb;
}

/* --- Survey Results & Graphs --- */
.survey-section {
    margin-top: 2rem;
}

.survey-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.survey-summary {
    font-size: 1rem;
    list-style: disc;
    list-style-position: inside;
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: #374151;
}

.survey-summary span {
    font-weight: 600;
}

.questionnaire-results {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.question-item {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

/* Graph Bars */
.graph-bar {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
    height: 1.5rem;
    margin-top: 0.5rem;
    display: flex;
    font-size: 0.75rem;
    position: relative;
}

.graph-bar-segment {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: white;
    position: relative;
    cursor: pointer;
}

.graph-bar-segment:first-child {
    border-top-left-radius: 9999px;
    border-bottom-left-radius: 9999px;
}

.graph-bar-segment:last-child {
    border-top-right-radius: 9999px;
    border-bottom-right-radius: 9999px;
}

.graph-bar-segment span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0.5rem;
}

.bg-yes {
    background-color: #22c55e;
}

.bg-neutral {
    background-color: #0ea5e9;
}

.bg-no {
    background-color: #ef4444;
}

.bg-no-answer {
    background-color: #64748b;
}

/* Tooltip */
.graph-bar-segment::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b;
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 20;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.graph-bar-segment::before {
    content: "";
    position: absolute;
    bottom: 125%;
    margin-bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
    z-index: 20;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.graph-bar-segment:hover::after,
.graph-bar-segment:hover::before,
.graph-bar-segment.show-tooltip::after,
.graph-bar-segment.show-tooltip::before {
    visibility: visible;
    opacity: 1;
}

/* Survey Comment Small Accordion */
.accordion-item-sm {
    margin-top: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
    font-size: 0.8rem;
}

.accordion-item-sm .accordion-header {
    padding: 0.5rem 0.75rem;
    background-color: #f9fafb;
}

.accordion-item-sm .accordion-header .accordion-button-text {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Observation (場面観察) Styles */
.observation-result {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
}

.accordion-title-h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
}

.observation-text-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    background-color: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid #d1d5db;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    margin: 0;
    padding-bottom: 0.5rem;
}

.observation-title+.observation-text-title {
    border-top: none;
}

.observation-text-body {
    font-size: 1rem;
    color: #475569;
    padding: 0.75rem 0.75rem 1rem 1rem;
    border-top: none;
    margin: 0;
}

/* Provider Comment */
.provider-comment-wrapper {
    margin-top: 0;
}

.provider-comment-wrapper h5 {
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.provider-comment {
    margin-top: 0.25rem;
    padding: 1rem;
    background-color: #eff6ff;
    border-radius: 0.5rem;
    border-left: 4px solid #93c5fd;
    color: #475569;
}

.provider-comment-box {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 0.5rem;
    font-size: 1rem;
}

/* --- Organization & Service Analysis Styles --- */

/* Category Header (Static & Accordion) */
.static-category-header,
#organization-management button.org-category-header {
    background-color: #eef2ff;
    /* indigo-50 */
    padding: 0.75rem 1rem;
    border: 1px solid #dbeafe;
    align-items: center;
    gap: 0.5rem;
    display: flex;
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
}

/* Category Label Tag */
.static-category-header::before,
#organization-management button.org-category-header::before {
    content: 'カテゴリー';
    display: inline-block;
    background-color: #696969;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    line-height: 1.25;
}

.static-category-header>span:first-child,
#organization-management button.org-category-header>span:first-child {
    font-size: 1rem;
    font-weight: 700;
    color: #312e81;
    /* indigo-900 */
    line-height: 1.5;
}

/* Category Content Wrapper */
.static-category-content,
.org-category-content-wrapper {
    background-color: #ffffff;
    padding: 1rem;
    border: 1px solid #dbeafe;
    border-top: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-radius: 0 0 0.5rem 0.5rem;
    margin-bottom: 1rem;
}
#organization-management .org-category-content-wrapper {
	border: 0;
    margin-bottom: 0;
}

#organization-management>.accordion-content {
    border: 1px solid #dbeafe;
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

#organization-management button.org-category-header[aria-expanded="true"] {
    border-bottom: 1px solid #dbeafe;
}

/* Subcategory Block */
.subcategory-block {
    border-radius: 0.5rem;
    overflow: hidden;
    padding: 0;
    margin-bottom: 0;
    border-left: 5px solid #3b82f6;
    /* Static Blue Border */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Subcategory Header */
button.subcategory-accordion-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-size: 1rem;
    width: 100%;
    background-color: #f9fafb;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s;
}

button.subcategory-accordion-header[aria-expanded="true"] {
    border-bottom: none;
    border-left: none !important;
    /* 親の線があるので子は不要 */
    background-color: #eff6ff !important;
}

button.subcategory-accordion-header:hover {
    background-color: #f3f4f6;
}

button.subcategory-accordion-header::before {
    content: 'サブカテゴリー';
    display: inline-block;
    background-color: #a9a9a9;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

button.subcategory-accordion-header>span:first-child {
    font-weight: 600;
    color: #1f2937;
    flex: 1;
}

button.subcategory-accordion-header .analysis-status {
    align-self: center;
    margin: 0;
    padding-left: 1rem;
    flex-shrink: 0;
}

button.subcategory-accordion-header .accordion-button-text {
    margin-left: 0.5rem;
    flex-shrink: 0;
}

/* Subcategory Content */
.subcategory-content-wrapper.accordion-content {
    border-top: none;
    padding: 0;
}

.subcategory-content-wrapper.accordion-content>.commentary-block,
.subcategory-content-wrapper.accordion-content>.subcategory-content {
    padding: 1rem;
}

.subcategory-content-wrapper.accordion-content>.subcategory-content {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Commentary Block */
.commentary-block {
    border: 1px solid #dbeafe;
    border-radius: 0.5rem;
    padding: 1rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}

.commentary-block>h6 {
    display: inline-block;
    background-color: #1e40af;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.commentary-item-header {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    margin: 0;
    margin-top: 0.75rem;
}

.commentary-item-block:first-child .commentary-item-header {
    margin-top: 0;
}

.commentary-item-content p {
    font-size: 1rem;
    color: #475569;
    padding: 0.75rem 0.75rem 1rem 1rem;
    margin: 0;
}

/* Standard Items */
.standard-items-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0;
}

.standard-item-block {
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

h6.standard-item-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0 0 0.375rem 0;
    gap: 0.25rem;
}

h6.standard-item-header::before {
    content: '評価項目';
    display: inline-block;
    background-color: #A9A9A9;
    color: #f5f5f5;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}

h6.standard-item-header>span {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

/* Status Table */
.status-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-end;
    margin-top: 0.25rem;
}

.standard-item-status-table {
    display: flex;
    gap: 0;
    border: 1px solid #d1d5db;
    padding: 0.25rem;
    border-radius: 0.25rem;
    background-color: #f8fafc;
}

.status-cell {
    height: 1rem;
    width: 1rem;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.status-cell.completed {
    background-image: url('../hyouka/result_standard/0_blue.png');
}

.status-cell.incomplete {
    background-image: url('../hyouka/result_standard/1_red.png');
}

div.standard-item-content {
    border-left: 2px solid #e5e7eb;
    padding: 0.25rem 0 0.25rem 1rem;
}

div.standard-item-content.inner-level {
    padding: 0;
    border: none;
}

.analysis-content.inner-level::before {
    content: '標準項目';
    display: inline-block;
    background-color: #c0c0c0;
    color: #f5f5f5;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    margin-bottom: 0.5rem;
}

.standard-item-content.inner-level ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.analysis-status span {
    font-size: 0.875rem;
    font-weight: 700;
    color: #475569;
    white-space: nowrap;
}

/* Important Issue Box */
.important-issue-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    background-color: #f8fafc;
    padding: 0.5rem 0.75rem;
    border-left: 3px solid #d1d5db;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    margin: 0;
}

.important-issue-box>.standard-item-content>h6 {
    display: inline-block;
    background-color: #c0c0c0;
    color: #f5f5f5;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.evaluation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
}

.evaluation-table th,
.evaluation-table td {
    border: 1px solid #d1d5db;
    padding: 0.5rem;
    text-align: left;
    vertical-align: top;
}

.evaluation-table th {
    background-color: #f3f4f6;
    width: 30%;
    color: #374151;
}

/* --- Modals & Overlays --- */
.chart-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.chart-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background-color: #ffffff;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.chart-modal.is-visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.chart-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.chart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.chart-modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.chart-modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s;
}

.chart-modal-close-btn:hover {
    color: #111827;
}

.chart-modal-body {
    padding: 1rem;
    overflow-y: auto;
    flex-grow: 1;
    text-align: center;
}

.chart-modal-body img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

body.modal-open {
    overflow: hidden;
}

/* Info Modal Specifics */
#info-modal .chart-modal-body {
    padding: 1.5rem;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.6;
}

#info-modal .status-cell {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    margin: 0 0.1em;
    object-fit: contain;
    background: none;
    border: none;
}

#info-modal li {
    line-height: 1.8;
}

.info-modal-list {
    list-style-type: decimal;
    margin-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Radar Chart Trigger Button */
.modal-trigger-wrapper {
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.modal-trigger-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: gray;
    background-color: transparent;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.modal-trigger-btn .fa-chart-radar {
    font-size: 1rem;
    margin-right: 0.25rem;
    color: #2563eb;
}

.modal-trigger-btn:hover {
    background-color: #eff6ff;
    color: #1d4ed8;
}

/* --- Mobile Menu & Overlay --- */
#sidebar-toggle-btn {
    position: fixed;
    top: 5rem;
    left: 1rem;
    width: 40px;
    height: 40px;
    background-color: #ffffff;
    border-radius: 9999px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 110;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

#sidebar-toggle-btn svg {
    width: 20px;
    height: 20px;
    color: #374151;
}

#sidebar-toggle-btn .icon-close {
    display: none;
}

#sidebar-toggle-btn.is-active {
    transform: rotate(180deg);
}

#sidebar-toggle-btn.is-active .icon-open {
    display: none;
}

#sidebar-toggle-btn.is-active .icon-close {
    display: block;
}

#mobile-nav-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: #ffffff;
    z-index: 105;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    padding: 1.5rem;
    padding-top: 9rem;
    overflow-y: auto;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
}

#mobile-nav-panel.is-open {
    transform: translateX(0);
}

#mobile-nav-panel h3 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #0f172a;
}

#mobile-nav-panel nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

#mobile-nav-panel nav a {
    display: block;
    color: #475569;
    text-decoration: none;
    padding: 0.75rem 0;
    font-size: 0.8rem;
    border-bottom: 1px solid #f1f5f9;
}

#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

/* --- Download Section --- */
.download-section {
    text-align: center;
    padding: 3rem 1.5rem;
    background-color: #f1f5f9;
    border-radius: 0.75rem;
    margin-top: 3rem;
    border: 1px solid #e2e8f0;
}

.download-buttons-wrapper {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.pdf-icon {
    font-size: 1.2em;
    margin-right: 0.5rem;
}

/* --- Info Grid Cards --- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}

.info-card {
    background-color: #f8fafc;
    border-radius: 0.5rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 5px;
}

.info-card p:first-child {
    width: 10em;
    flex-shrink: 0;
    margin: 0;
    font-weight: 500;
    color: #475569;
}

.info-card .data {
    font-weight: 600;
    color: #1e293b;
}

/* =========================================
   パンくずリスト (Breadcrumbs)
   ========================================= */
.breadcrumb {
    font-size: 0.875rem;
    /* 14px */
    color: #64748b;
    /* slate-500 */
    margin-bottom: 1rem;
    overflow-x: auto;
    /* スマホで長くなっても崩れないように */
    white-space: nowrap;
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb li {
    display: inline-flex;
    align-items: center;
}

/* 区切り文字 (/) */
.breadcrumb li:not(:last-child)::after {
    content: "/";
    margin-left: 0.5rem;
    color: #cbd5e1;
    /* slate-300 */
    font-size: 0.75rem;
}

.breadcrumb a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.breadcrumb a:hover {
    color: var(--primary-color);
    /* ホバー時はブランドカラー */
    text-decoration: underline;
}

/* 現在のページ（リンクなし） */
.breadcrumb span[aria-current="page"] {
    color: #0f172a;
    /* slate-900 (濃い色で現在地を強調) */
    font-weight: 600;
    max-width: 200px;
    /* スマホなどで長すぎる場合に省略 */
    overflow: hidden;
    text-overflow: ellipsis;
}
/* --- Year Selection Dropdown Styling --- */

/* カード自体のレイアウト調整 */
.info-card.year-selection-card {
    flex-direction: column; /* スマホ・PC問わず縦積みに変更してレイアウト崩れを防ぐ */
    align-items: flex-start;
    gap: 0.5rem;
    position: relative;
    padding-bottom: 1rem; /* メッセージ表示用の余白 */
}

/* ラベルスタイル */
.info-card.year-selection-card label {
    width: auto;
    font-weight: 500;
    color: #475569;
    margin: 0;
}

/* --- Year Selection Dropdown Styling (Revised) --- */

/* カード自体の基本レイアウト（モバイルファースト：縦積み） */
.info-card.year-selection-card {
    display: flex;
    flex-direction: column; /* スマホは縦並び */
    align-items: flex-start;
    gap: 0.5rem;
    position: relative;
    padding-bottom: 0.5rem;
    flex-wrap: wrap; /* 折り返しを許可（PC表示でのレイアウト調整用） */
}

/* PC版（768px以上）でのレイアウト調整：横並び */
@media screen and (min-width: 768px) {
    .info-card.year-selection-card {
        flex-direction: row; /* 横並びにする */
        align-items: center; /* 垂直方向の中央揃え */
        gap: 1rem; /* ラベルとプルダウンの間隔 */
    }
}

/* --- Year Selection Dropdown Styling (Final Refined Version) --- */

/* カード自体の基本レイアウト（モバイルファースト：縦積み） */
.info-card.year-selection-card {
    display: flex;
    flex-direction: column; /* スマホは縦並び */
    align-items: flex-start;
    gap: 0.75rem; /* 間隔を少し広げて見やすく */
    position: relative;
    /* モバイル用パディング（上下は他のカードと合わせる想定） */
    padding: 1.25rem 1.5rem;
    flex-wrap: wrap; /* 折り返しを許可 */
}

/* PC版（768px以上）でのレイアウト調整：横並びと中央揃え */
@media screen and (min-width: 768px) {
    .info-card.year-selection-card {
        flex-direction: row; /* 横並びにする */
        /* 視覚的な上下中央揃えを実現する重要設定 */
        align-items: center;
        /* PCでの上下パディングを調整し、視覚的な中心バランスを整える */
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
        gap: 1.5rem; /* ラベルとプルダウンの間隔を広げる */
    }

    /* ラベルの位置を微調整してプルダウンのテキストと高さを合わせる */
    .info-card.year-selection-card label {
        /* 必要に応じて微調整。今回はalign-items: centerでほぼ合うはずですが念のため */
        position: relative;
        top: 1px;
    }
}

/* ラベルスタイル */
.info-card.year-selection-card label {
    font-weight: 700; /* 他の見出しに合わせて少し太く */
    color: #1e293b; /* より濃い色で視認性アップ */
    margin: 0;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 1.05rem; /* 少し大きく */
}

/* セレクトボックスのラッパー */
.select-wrapper {
    position: relative;
    width: 100%;
    /* PCでは幅を固定しすぎず、バランスを見る */
}
@media screen and (min-width: 768px) {
    .select-wrapper {
        width: auto; /* PCでは中身に合わせる */
        min-width: 240px; /* 最小幅を確保 */
    }
}

/* カスタムセレクトボックス */
.custom-select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    /* パディングを調整して高さのバランスを整える */
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500; /* 太すぎないウェイト */
    color: #334155;
    background-color: #f8fafc; /* 背景を少しグレーにして入力欄であることを強調 */
    border: 1px solid #cbd5e1;
    border-radius: 8px; /* 角丸を少し強く */
    cursor: pointer;
    transition: all 0.2s ease;
    /* 影を少しつけて立体感を出す */
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

.custom-select:hover {
    border-color: #94a3b8;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.custom-select:focus {
    outline: none;
    border-color: #3b82f6;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* セレクトボックスの矢印アイコン */
.select-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
    font-size: 0.9rem;
}

/* --- Past Year Notification Message --- */
.year-change-notice {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* より自然なアニメーション */
    width: 100%;
    flex-basis: 100%; /* 強制改行 */
}

.year-change-notice.is-visible {
    max-height: 100px;
    opacity: 1;
    /* メッセージ表示時の上部マージン。PCでは広めにとる */
    margin-top: 1rem;
}
@media screen and (min-width: 768px) {
    .year-change-notice.is-visible {
        margin-top: 1.5rem;
        /* メッセージが出た分、カードの下部パディングが詰まって見えるのを防ぐ */
        margin-bottom: -0.5rem;
    }
}

.notice-content {
    display: flex;
    align-items: center;
    /* 中央揃え */
    justify-content: center;
    gap: 0.75rem;
    background-color: #f0f9ff; /* 非常に薄い青 */
    border: 1px solid #bae6fd;
    color: #0369a1;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* 影をつけて浮かせる */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.notice-content i {
    font-size: 1.1rem;
    color: #0ea5e9;
}

@keyframes slideIn {
    from { transform: translateY(-15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* モバイル調整 */
@media (max-width: 640px) {
    .breadcrumb span[aria-current="page"] {
        max-width: 150px;
    }
}

/* --- パターンC：タイトル横配置スタイル --- */

/* タイトルとプルダウンを横並びにするコンテナ */
.section-header-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap; /* スマホでは縦に折り返す */
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0; /* 区切り線を引いて整える */
    padding-bottom: 1rem;
}

/* 既存のタイトルスタイルの上書き調整 */
.section-header-row .section-title {
    margin-bottom: 0; /* マージンをリセット */
    white-space: nowrap;
}

/* プルダウンエリア */
.year-select-compact {
    flex-grow: 0;
}

/* コンパクトなプルダウンデザイン */
.custom-select-compact {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.4rem 2rem 0.4rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 220px; /* 適切な幅を確保 */
}

.custom-select-compact:hover {
    background-color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* メッセージエリアの調整 */
.year-change-notice {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.year-change-notice.is-visible {
    max-height: 60px;
    opacity: 1;
    margin-bottom: 1.5rem; /* 表示された時だけ余白を作る */
}
/* --- ページタイトル横の年度選択スタイル --- */

/* タイトルエリア全体のコンテナ */
.page-header-container {
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0; /* 線はここに移動 */
    padding-bottom: 1rem;
}

/* タイトルとプルダウンの横並び設定 */
.page-title-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap; /* 画面が狭いときは折り返す */
    gap: 1rem;
}

/* 既存のh1スタイルの調整（線を消して余白を詰める） */
.main-title {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    /* 必要に応じてフォントサイズ調整 */
    line-height: 1.2;
}

/* プルダウン周りのラッパー */
.year-select-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.year-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #64748b;
}

/* プルダウンの箱 */
.select-box-container {
    position: relative;
    min-width: 240px;
}

/* ヘッダー用カスタムセレクトボックス */
.custom-select-header {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 1.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    background-color: #f1f5f9; /* 背景を薄いグレーにしてヘッダーに馴染ませる */
    border: 1px solid #cbd5e1;
    border-radius: 9999px; /* 丸みをつけてボタンっぽく */
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-select-header:hover {
    background-color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* アイコン位置 */
.select-box-container .select-icon {
    right: 1.2rem;
    color: #64748b;
}

/* メッセージエリア */
.year-change-notice {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.year-change-notice.is-visible {
    max-height: 60px;
    opacity: 1;
    margin-top: 1rem; /* 表示されたときだけ余白 */
}

/* Noticeの中身 */
.notice-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #eff6ff;
    border: 1px solid #dbeafe;
    color: #1d4ed8;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex; /* 文字量に合わせて幅を自動調整 */
}
/* =========================================
   評価方法バッジ（ヘッダー用）
   ========================================= */

.method-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem; /* プルダウンの高さに合わせて少し調整 */
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
    margin-left: 0.5rem; /* プルダウンとの距離 */
}

/* アイコンサイズ */
.flower-icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
}

/* --- パターンA: 標準の評価 (桜) --- */
.method-badge.standard {
    background-color: #fff0f5; /* 薄い桜色 */
    color: #be185d;           /* 濃いピンク文字 */
    border-color: #fbcfe8;    /* ピンクの枠線 */
}

/* --- パターンB: サービス項目中心 (白梅) --- */
.method-badge.service {
    background-color: #f8fafc; /* 白に近いグレー */
    color: #475569;           /* 濃いグレー文字 */
    border-color: #cbd5e1;    /* 銀鼠色の枠線 */
}

/* --- スマホ対応 (レスポンシブ) --- */
@media (max-width: 640px) {
    /* スマホではプルダウンの下に配置されるように調整 */
    .year-select-wrapper {
        flex-wrap: wrap; /* 折り返しを許可 */
    }

    .method-badge {
        margin-left: 0; /* 左マージンをリセット */
        width: 100%;    /* 横幅いっぱいに広げるか、もしくは inline-flex のままにする */
        justify-content: center; /* 中央揃え */
        margin-top: 0.25rem;
    }
}

/* スマホ対応 */
@media screen and (max-width: 640px) {
    .page-title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .year-select-wrapper {
        width: 100%;
        justify-content: space-between; /* ラベルとプルダウンを左右に */
    }

    .select-box-container {
        flex-grow: 1; /* プルダウンを可能な限り広げる */
        min-width: auto;
    }
}

/* スマホ表示時の調整 */
@media screen and (max-width: 640px) {
    .section-header-row {
        align-items: flex-start;
        flex-direction: column; /* スマホではタイトル→プルダウンの順に縦積み */
        gap: 0.75rem;
    }

    .year-select-compact,
    .select-wrapper,
    .custom-select-compact {
        width: 100%; /* スマホでは幅いっぱいに */
        max-width: none;
    }
}
/* =========================================
   Mobile Responsiveness (Consolidated)
   ========================================= */
@media (max-width: 1024px) {

    /* PCでは文字サイズを可変に（最低18px〜最大30pxの間で、画面幅の約1.8%に合わせて拡大） */
    body {
        /* clamp(最小値, 推奨値, 最大値) */
        font-size: clamp(18px, 1.8vw, 30px);
    }

    .info-grid.four-items,
    .summary-grid {
        gap: 2.5rem;
    }

    /* Summary & Initiatives Buttons: Full width on mobile */
    #summary .accordion-header,
    #initiatives .accordion-header,
    #user-survey .accordion-item .accordion-header,
    .static-category-header,
    #organization-management button.org-category-header,
    button.subcategory-accordion-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    #summary .accordion-header .accordion-button-text,
    #initiatives .accordion-header .accordion-button-text,
    #user-survey .accordion-item .accordion-header .accordion-button-text,
    #organization-management button.org-category-header .accordion-button-text,
    button.subcategory-accordion-header .accordion-button-text {
        width: 100%;
        margin-left: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0.75rem;
    }

    /* Subcategory Adjustments */
    button.subcategory-accordion-header .analysis-status {
        align-self: flex-start;
        padding-left: 0;
    }

    /* Info Cards Vertical Layout */
    #evaluator-info .info-grid,
    .info-grid.four-items {
        grid-template-columns: 1fr;
    }

    #evaluator-info .info-card,
    .info-grid.four-items .info-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    #evaluator-info .info-card p:first-child,
    .info-grid.four-items .info-card p:first-child {
        width: auto;
    }

    #evaluator-info .info-card .data,
    .info-grid.four-items .info-card .data {
        margin-left: 1em;
    }

    /* 1. カード内のレイアウトを「横並び」にしつつ、柔軟性を持たせる */
    #evaluator-info .info-card,
    .info-grid.four-items .info-card {
        gap: 0.75rem !important;
        /* 間隔 */
        padding: 0.75rem !important;
        /* 余白 */
        flex-wrap: nowrap !important;
        /* 折り返さず1行（項目名・データ）で並べる */
    }

    /* 2. 項目名（左側）の幅調整 */
    #evaluator-info .info-card p:first-child,
    .info-grid.four-items .info-card p:first-child {
        flex-shrink: 0 !important;
        margin-bottom: 0 !important;
        white-space: normal !important;
        /* 項目名自体が長すぎる場合は改行許可 */
    }

    /* 3. データ（右側）の「はみ出し防止」設定 ★ここが重要 */
    #evaluator-info .info-card .data,
    .info-grid.four-items .info-card .data {
        flex: 1 1 auto !important;
        /* 残りの幅を埋める */
        min-width: 0 !important;
        /* ★重要: これがないとフレックスアイテムは縮まずにはみ出す */

        /* 文字の折り返し設定 */
        overflow-wrap: anywhere !important;
        /* ★重要: URLや長い英数字も強制的に折り返す */
        word-break: break-word !important;
        /* 古いブラウザ向け */
        white-space: normal !important;
        /* 通常の折り返しを許可 */
    }
    /* =========================================
   モバイル表示の余白削減（画面を広く使う）
   ========================================= */

    /* 1. 外枠（コンテナ）の左右余白を最小限にする */
    /* 元々 1rem (16px) だったのを 0.5rem (8px) 程度まで縮小 */
    .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    /* 2. style.css 等で設定されている二重の余白を強制的に削除 */
    .content-wrapper {
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
    }

    /* 3. メインコンテンツの左余白を削除 */
    /* PC版でサイドバーとの間隔として設定されていた 1.5rem を 0 にします。
       これにより、コンテンツが画面左端（ボタンの下）まで広がります */
    main {
        margin-left: 0 !important;
    }
}