/* ===================================
 * Grant Single Page - Clean Newspaper Style
 * 補助金詳細ページ - 新聞スタイル
 * =================================== */

:root {
    /* === カラーパレット（シンプル・クリーン） === */
    --gi-black: #333333;
    --gi-dark: #444444;
    --gi-gray-900: #555555;
    --gi-gray-800: #666666;
    --gi-gray-700: #888888;
    --gi-gray-600: #aaaaaa;
    --gi-gray-500: #cccccc;
    --gi-gray-400: #dddddd;
    --gi-gray-300: #eeeeee;
    --gi-gray-200: #f5f5f5;
    --gi-gray-100: #fafafa;
    --gi-gray-50: #fcfcfc;
    --gi-white: #ffffff;
    
    /* 背景色 */
    --gi-bg: #ffffff;
    --gi-bg-section: #f8f8f8;
    
    /* プライマリカラー（控えめな青） */
    --gi-primary: #0066cc;
    --gi-primary-dark: #004499;
    --gi-primary-light: #e8f4fc;
    
    /* アクセントカラー（赤系 - 重要な情報用） */
    --gi-accent: #cc0000;
    --gi-accent-light: #fff5f5;
    
    /* セマンティックカラー */
    --gi-success: #2e7d32;
    --gi-success-light: #e8f5e9;
    --gi-warning: #ed6c02;
    --gi-warning-light: #fff4e5;
    --gi-error: #d32f2f;
    --gi-error-light: #ffebee;
    --gi-info: #0288d1;
    --gi-info-light: #e1f5fe;
    
    /* タイポグラフィ */
    --gi-font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
    --gi-font-serif: "Hiragino Mincho ProN", "Noto Serif JP", "Yu Mincho", serif;
    
    /* レイアウト */
    --gi-container: 1100px;
    --gi-sidebar: 300px;
    --gi-gap: 40px;
    
    /* トランジション */
    --gi-transition: 0.15s ease;
}

/* === リセット & ベース === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--gi-font);
    font-size: 15px;
    line-height: 1.8;
    color: var(--gi-black);
    background: var(--gi-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--gi-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

/* === レイアウト === */
.gi-container {
    max-width: var(--gi-container);
    margin: 0 auto;
    padding: 0 20px;
}

.gi-page {
    background: var(--gi-bg);
}

.gi-layout {
    display: grid;
    grid-template-columns: 1fr var(--gi-sidebar);
    gap: var(--gi-gap);
    padding: 30px 0 60px;
    align-items: start;
}

.gi-main {
    min-width: 0;
}

.gi-sidebar {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (max-width: 900px) {
    .gi-layout {
        grid-template-columns: 1fr;
    }
    
    .gi-sidebar {
        display: none;
    }
}

/* === プログレスバー === */
.gi-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gi-accent);
    z-index: 9999;
}

/* === パンくずリスト === */
.gi-breadcrumb {
    padding: 12px 0;
    border-bottom: 1px solid var(--gi-gray-400);
    font-size: 12px;
}

.gi-breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    color: var(--gi-gray-700);
    max-width: var(--gi-container);
    margin: 0 auto;
    padding: 0 20px;
}

.gi-breadcrumb-link {
    color: var(--gi-gray-700);
}

.gi-breadcrumb-link:hover {
    color: var(--gi-primary);
}

.gi-breadcrumb-sep {
    color: var(--gi-gray-600);
}

.gi-breadcrumb-current {
    color: var(--gi-black);
}

/* === ヒーローセクション === */
.gi-hero {
    padding: 24px 0 20px;
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.gi-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid;
}

.gi-badge-open {
    background: var(--gi-white);
    border-color: var(--gi-success);
    color: var(--gi-success);
}

.gi-badge-closed {
    background: var(--gi-gray-300);
    border-color: var(--gi-gray-500);
    color: var(--gi-gray-800);
}

.gi-badge-upcoming {
    background: var(--gi-info-light);
    border-color: var(--gi-info);
    color: var(--gi-info);
}

.gi-badge-critical {
    background: var(--gi-accent);
    border-color: var(--gi-accent);
    color: var(--gi-white);
}

.gi-badge-urgent {
    background: var(--gi-accent-light);
    border-color: var(--gi-accent);
    color: var(--gi-accent);
}

.gi-badge-warning {
    background: var(--gi-warning-light);
    border-color: var(--gi-warning);
    color: var(--gi-warning);
}

.gi-badge-featured {
    background: var(--gi-accent);
    border-color: var(--gi-accent);
    color: var(--gi-white);
}

.gi-badge-new {
    background: var(--gi-primary);
    border-color: var(--gi-primary);
    color: var(--gi-white);
}

.gi-hero-title {
    font-family: var(--gi-font-serif);
    font-size: 28px;
    font-weight: bold;
    line-height: 1.4;
    color: var(--gi-black);
    margin-bottom: 16px;
}

@media (max-width: 768px) {
    .gi-hero-title {
        font-size: 22px;
    }
}

.gi-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--gi-gray-800);
}

.gi-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gi-hero-meta-item svg {
    width: 14px;
    height: 14px;
    color: var(--gi-gray-700);
}

/* === メトリクスカード === */
.gi-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--gi-gray-400);
    border: 1px solid var(--gi-gray-400);
    margin: 24px 0;
}

.gi-metric {
    padding: 16px 12px;
    text-align: center;
    background: var(--gi-white);
}

.gi-metric-label {
    font-size: 11px;
    font-weight: bold;
    color: var(--gi-gray-800);
    margin-bottom: 6px;
}

.gi-metric-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--gi-black);
}

.gi-metric-value.highlight {
    color: var(--gi-primary);
}

.gi-metric-value.urgent {
    color: var(--gi-accent);
}

.gi-metric-sub {
    font-size: 11px;
    color: var(--gi-gray-700);
    margin-top: 4px;
}

.gi-metric-stars {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-top: 6px;
}

.gi-metric-star {
    width: 12px;
    height: 12px;
    fill: var(--gi-gray-500);
}

.gi-metric-star.active {
    fill: var(--gi-warning);
}

@media (max-width: 640px) {
    .gi-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === セクション === */
.gi-section {
    margin-bottom: 40px;
}

.gi-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gi-black);
    margin-bottom: 20px;
}

.gi-section-icon {
    display: none;
}

.gi-section-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--gi-black);
}

.gi-section-en {
    display: none;
}

/* === AI要約 === */
.gi-summary {
    background: var(--gi-gray-200);
    padding: 20px 24px;
    margin-bottom: 30px;
    border-left: 4px solid var(--gi-primary);
}

.gi-summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.gi-summary-icon {
    width: 32px;
    height: 32px;
    background: var(--gi-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.gi-summary-icon svg {
    width: 18px;
    height: 18px;
    color: var(--gi-white);
}

.gi-summary-label {
    font-size: 12px;
    font-weight: bold;
    color: var(--gi-primary);
}

.gi-summary-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--gi-white);
    border: 1px solid var(--gi-gray-500);
    font-size: 11px;
    color: var(--gi-gray-800);
}

.gi-summary-text {
    font-size: 15px;
    line-height: 1.9;
    color: var(--gi-black);
}

/* === 詳細グループ === */
.gi-details-group {
    margin-bottom: 24px;
}

.gi-details-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--gi-gray-200);
    border-left: 3px solid var(--gi-black);
    font-size: 14px;
    font-weight: bold;
    color: var(--gi-black);
}

.gi-details-group-icon {
    display: none;
}

/* === テーブル === */
.gi-table {
    width: 100%;
    border: 1px solid var(--gi-gray-400);
    border-top: none;
}

.gi-table-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-table-row:last-child {
    border-bottom: none;
}

.gi-table-key {
    padding: 12px 14px;
    font-size: 13px;
    font-weight: bold;
    color: var(--gi-gray-900);
    background: var(--gi-gray-100);
    border-right: 1px solid var(--gi-gray-400);
}

.gi-table-value {
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--gi-black);
    background: var(--gi-white);
}

@media (max-width: 640px) {
    .gi-table-row {
        grid-template-columns: 1fr;
    }
    
    .gi-table-key {
        border-right: none;
        border-bottom: 1px solid var(--gi-gray-300);
        padding: 10px 12px;
    }
    
    .gi-table-value {
        padding: 10px 12px;
    }
}

.gi-value-highlight {
    color: var(--gi-primary);
    font-weight: bold;
}

.gi-value-large {
    font-size: 18px;
    font-weight: bold;
}

/* === タグ === */
.gi-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gi-tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--gi-gray-200);
    border: 1px solid var(--gi-gray-400);
    font-size: 12px;
    color: var(--gi-gray-900);
}

.gi-tag:hover {
    background: var(--gi-gray-300);
    text-decoration: none;
}

.gi-tag-success {
    background: var(--gi-success-light);
    border-color: var(--gi-success);
    color: var(--gi-success);
}

.gi-tag-info {
    background: var(--gi-info-light);
    border-color: var(--gi-info);
    color: var(--gi-info);
}

/* === チェックリスト === */
.gi-checklist {
    border: 1px solid var(--gi-gray-400);
    background: var(--gi-white);
}

.gi-checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--gi-gray-200);
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-checklist-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: bold;
    color: var(--gi-black);
    margin: 0;
}

.gi-checklist-title svg {
    width: 18px;
    height: 18px;
    color: var(--gi-black);
}

.gi-checklist-actions {
    display: flex;
    gap: 6px;
}

.gi-checklist-action {
    padding: 5px 10px;
    background: var(--gi-white);
    border: 1px solid var(--gi-gray-500);
    color: var(--gi-gray-900);
    font-size: 11px;
    font-weight: bold;
}

.gi-checklist-action:hover {
    background: var(--gi-gray-100);
}

.gi-checklist-progress {
    padding: 14px 18px;
    background: var(--gi-white);
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-checklist-progress-bar {
    height: 6px;
    background: var(--gi-gray-300);
    margin-bottom: 8px;
}

.gi-checklist-progress-fill {
    height: 100%;
    background: var(--gi-success);
    width: 0;
    transition: width 0.3s ease;
}

.gi-checklist-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gi-gray-800);
}

.gi-checklist-progress-percent {
    font-weight: bold;
    color: var(--gi-success);
}

.gi-checklist-category {
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-checklist-category:last-child {
    border-bottom: none;
}

.gi-checklist-category-header {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--gi-gray-100);
    font-size: 13px;
    font-weight: bold;
    color: var(--gi-gray-900);
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-checklist-items {
    padding: 0;
}

.gi-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--gi-gray-300);
    cursor: pointer;
    transition: var(--gi-transition);
}

.gi-checklist-item:last-child {
    border-bottom: none;
}

.gi-checklist-item:hover {
    background: var(--gi-gray-100);
}

.gi-checklist-item.checked {
    background: var(--gi-success-light);
}

.gi-checklist-checkbox {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid var(--gi-gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    background: var(--gi-white);
}

.gi-checklist-item.checked .gi-checklist-checkbox {
    background: var(--gi-success);
    border-color: var(--gi-success);
}

.gi-checklist-checkbox svg {
    width: 12px;
    height: 12px;
    color: var(--gi-white);
    opacity: 0;
}

.gi-checklist-item.checked .gi-checklist-checkbox svg {
    opacity: 1;
}

.gi-checklist-content {
    flex: 1;
    min-width: 0;
}

.gi-checklist-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gi-black);
    line-height: 1.5;
}

.gi-checklist-item.checked .gi-checklist-label {
    color: var(--gi-success);
}

.gi-checklist-desc {
    font-size: 12px;
    color: var(--gi-gray-800);
    margin-top: 4px;
    line-height: 1.5;
}

.gi-checklist-help {
    display: none;
    font-size: 12px;
    color: var(--gi-gray-900);
    padding: 10px 12px;
    background: var(--gi-gray-200);
    margin-top: 8px;
    border-left: 2px solid var(--gi-gray-500);
}

.gi-checklist-item.show-help .gi-checklist-help {
    display: block;
}

.gi-checklist-required {
    display: inline-block;
    padding: 1px 6px;
    background: var(--gi-accent);
    color: var(--gi-white);
    font-size: 10px;
    font-weight: bold;
    margin-left: 6px;
}

.gi-checklist-optional {
    display: inline-block;
    padding: 1px 6px;
    background: var(--gi-gray-500);
    color: var(--gi-white);
    font-size: 10px;
    font-weight: bold;
    margin-left: 6px;
}

.gi-checklist-help-btn {
    padding: 4px;
    color: var(--gi-gray-600);
}

.gi-checklist-help-btn:hover {
    color: var(--gi-black);
}

.gi-checklist-help-btn svg {
    width: 16px;
    height: 16px;
}

.gi-checklist-result {
    padding: 20px 18px;
    background: var(--gi-gray-100);
    text-align: center;
}

.gi-checklist-result-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gi-gray-300);
    color: var(--gi-gray-700);
    border-radius: 50%;
}

.gi-checklist-result.complete .gi-checklist-result-icon {
    background: var(--gi-success);
    color: var(--gi-white);
}

.gi-checklist-result-icon svg {
    width: 24px;
    height: 24px;
}

.gi-checklist-result-text {
    font-size: 16px;
    font-weight: bold;
    color: var(--gi-gray-800);
    margin-bottom: 6px;
}

.gi-checklist-result.complete .gi-checklist-result-text {
    color: var(--gi-success);
}

.gi-checklist-result-sub {
    font-size: 13px;
    color: var(--gi-gray-700);
}

.gi-checklist-cta {
    display: none;
    margin-top: 14px;
}

.gi-checklist-result.complete .gi-checklist-cta {
    display: block;
}

/* === コンテンツ === */
.gi-content {
    font-size: 15px;
    line-height: 2;
    color: var(--gi-black);
}

.gi-content h2 {
    font-size: 18px;
    font-weight: bold;
    color: var(--gi-black);
    margin: 36px 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gi-black);
}

.gi-content h3 {
    font-size: 16px;
    font-weight: bold;
    color: var(--gi-black);
    margin: 28px 0 12px;
}

.gi-content p {
    margin-bottom: 16px;
}

.gi-content ul,
.gi-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.gi-content li {
    margin-bottom: 8px;
    list-style: disc;
}

.gi-content ol li {
    list-style: decimal;
}

.gi-content strong {
    font-weight: bold;
}

.gi-content a {
    color: var(--gi-primary);
    text-decoration: underline;
}

/* === フロー === */
.gi-flow {
    display: flex;
    flex-direction: column;
}

.gi-flow-step {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-flow-step:last-child {
    border-bottom: none;
}

.gi-flow-num {
    width: 50px;
    height: 50px;
    background: var(--gi-black);
    color: var(--gi-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.gi-flow-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gi-flow-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--gi-black);
    margin-bottom: 4px;
}

.gi-flow-desc {
    font-size: 14px;
    color: var(--gi-gray-800);
    line-height: 1.6;
}

/* === 比較表 === */
.gi-compare {
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--gi-gray-400);
}

.gi-compare-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 13px;
}

.gi-compare-table th,
.gi-compare-table td {
    padding: 10px 12px;
    text-align: center;
    border: 1px solid var(--gi-gray-400);
}

.gi-compare-table thead th {
    background: var(--gi-gray-200);
    color: var(--gi-black);
    font-weight: bold;
    font-size: 12px;
}

.gi-compare-table thead th:first-child {
    text-align: left;
}

.gi-compare-table tbody th {
    background: var(--gi-gray-100);
    font-weight: bold;
    text-align: left;
    color: var(--gi-gray-900);
}

.gi-compare-table tbody td {
    background: var(--gi-white);
}

.gi-compare-current {
    background: var(--gi-primary-light);
}

.gi-compare-current-header {
    background: var(--gi-primary);
    color: var(--gi-white);
}

.gi-compare-grant-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    min-width: 120px;
}

.gi-compare-grant-name {
    font-size: 12px;
    font-weight: bold;
    line-height: 1.3;
}

.gi-compare-grant-org {
    font-size: 10px;
    font-weight: normal;
    opacity: 0.8;
}

.gi-compare-value {
    font-weight: 600;
}

.gi-compare-value.highlight {
    color: var(--gi-primary);
    font-weight: bold;
}

.gi-compare-link {
    color: var(--gi-primary);
    font-weight: 600;
}

.gi-compare-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: bold;
}

.gi-compare-badge.yes {
    background: var(--gi-success);
    color: var(--gi-white);
}

.gi-compare-badge.no {
    background: var(--gi-gray-400);
    color: var(--gi-gray-800);
}

.gi-compare-stars {
    display: flex;
    justify-content: center;
    gap: 1px;
}

.gi-compare-star {
    width: 12px;
    height: 12px;
    fill: var(--gi-gray-400);
}

.gi-compare-star.active {
    fill: var(--gi-warning);
}

/* === FAQ === */
.gi-faq-list {
    display: flex;
    flex-direction: column;
}

.gi-faq-item {
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-faq-item:last-child {
    border-bottom: none;
}

.gi-faq-question {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    font-size: 14px;
    font-weight: bold;
    color: var(--gi-black);
    cursor: pointer;
    list-style: none;
}

.gi-faq-question::-webkit-details-marker {
    display: none;
}

.gi-faq-question:hover {
    color: var(--gi-primary);
}

.gi-faq-q-mark {
    width: 24px;
    height: 24px;
    background: var(--gi-primary);
    color: var(--gi-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.gi-faq-question-text {
    flex: 1;
}

.gi-faq-icon {
    width: 16px;
    height: 16px;
    color: var(--gi-gray-600);
    transition: transform 0.2s ease;
}

.gi-faq-item[open] .gi-faq-icon {
    transform: rotate(45deg);
}

.gi-faq-answer {
    padding: 0 0 16px;
    padding-left: 36px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--gi-gray-900);
}

/* === お問い合わせ === */
.gi-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.gi-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--gi-gray-100);
    border: 1px solid var(--gi-gray-400);
}

.gi-contact-item:hover {
    background: var(--gi-gray-200);
}

.gi-contact-icon {
    width: 40px;
    height: 40px;
    background: var(--gi-black);
    color: var(--gi-white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gi-contact-icon svg {
    width: 18px;
    height: 18px;
}

.gi-contact-label {
    font-size: 11px;
    color: var(--gi-gray-700);
    margin-bottom: 2px;
}

.gi-contact-value {
    font-size: 14px;
    font-weight: bold;
    color: var(--gi-black);
}

/* === 情報ソース === */
.gi-source-card {
    border: 1px solid var(--gi-gray-400);
    background: var(--gi-white);
    margin: 30px 0;
}

.gi-source-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--gi-gray-200);
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-source-header svg {
    width: 16px;
    height: 16px;
    color: var(--gi-gray-700);
}

.gi-source-label {
    font-size: 11px;
    font-weight: bold;
    color: var(--gi-gray-700);
}

.gi-source-body {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.gi-source-info {
    flex: 1;
    min-width: 180px;
}

.gi-source-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--gi-black);
    margin-bottom: 4px;
}

.gi-source-verified {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--gi-success);
}

.gi-source-verified svg {
    width: 14px;
    height: 14px;
}

.gi-source-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--gi-primary);
    color: var(--gi-white);
    font-size: 13px;
    font-weight: bold;
}

.gi-source-link:hover {
    background: var(--gi-primary-dark);
    text-decoration: none;
}

.gi-source-link svg {
    width: 12px;
    height: 12px;
}

.gi-source-footer {
    padding: 10px 14px;
    background: var(--gi-gray-100);
    border-top: 1px solid var(--gi-gray-400);
    font-size: 12px;
    color: var(--gi-gray-700);
}

/* === 監修者 === */
.gi-supervisor {
    background: var(--gi-gray-100);
    border: 1px solid var(--gi-gray-400);
    padding: 20px;
    margin: 36px 0;
}

.gi-supervisor-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: bold;
    color: var(--gi-gray-700);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-supervisor-label svg {
    width: 14px;
    height: 14px;
}

.gi-supervisor-content {
    display: flex;
    gap: 16px;
}

.gi-supervisor-avatar {
    width: 60px;
    height: 60px;
    background: var(--gi-gray-300);
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 50%;
}

.gi-supervisor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gi-supervisor-avatar svg {
    width: 28px;
    height: 28px;
    color: var(--gi-gray-600);
}

.gi-supervisor-info {
    flex: 1;
}

.gi-supervisor-name {
    font-size: 16px;
    font-weight: bold;
    color: var(--gi-black);
    margin-bottom: 2px;
}

.gi-supervisor-title {
    font-size: 12px;
    color: var(--gi-gray-700);
    margin-bottom: 8px;
}

.gi-supervisor-bio {
    font-size: 13px;
    color: var(--gi-gray-900);
    line-height: 1.6;
    margin-bottom: 10px;
}

.gi-supervisor-credentials {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gi-supervisor-credential {
    padding: 3px 10px;
    background: var(--gi-white);
    border: 1px solid var(--gi-gray-400);
    font-size: 11px;
    font-weight: 600;
    color: var(--gi-gray-900);
}

/* === サイドバー === */
.gi-sidebar-section {
    border: 1px solid var(--gi-gray-400);
    background: var(--gi-white);
}

.gi-sidebar-header {
    padding: 12px 14px;
    background: var(--gi-gray-200);
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-sidebar-title {
    font-size: 13px;
    font-weight: bold;
    color: var(--gi-black);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gi-sidebar-title svg {
    width: 16px;
    height: 16px;
    color: var(--gi-gray-700);
}

.gi-sidebar-body {
    padding: 14px;
}

/* === CTAボタン === */
.gi-cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gi-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: bold;
    border: 1px solid;
    text-align: center;
}

.gi-btn svg {
    width: 16px;
    height: 16px;
}

.gi-btn-primary {
    background: var(--gi-primary);
    border-color: var(--gi-primary);
    color: var(--gi-white);
}

.gi-btn-primary:hover {
    background: var(--gi-primary-dark);
    text-decoration: none;
}

.gi-btn-accent {
    background: var(--gi-accent);
    border-color: var(--gi-accent);
    color: var(--gi-white);
}

.gi-btn-accent:hover {
    background: #aa0000;
    text-decoration: none;
}

.gi-btn-secondary {
    background: var(--gi-white);
    border-color: var(--gi-gray-500);
    color: var(--gi-black);
}

.gi-btn-secondary:hover {
    background: var(--gi-gray-100);
    text-decoration: none;
}

.gi-btn-full {
    width: 100%;
}

/* === AIアシスタント === */
.gi-ai-section {
    border: 1px solid var(--gi-primary);
}

.gi-ai-section .gi-sidebar-header {
    background: var(--gi-primary);
    border-bottom: none;
}

.gi-ai-section .gi-sidebar-title {
    color: var(--gi-white);
}

.gi-ai-section .gi-sidebar-title svg {
    color: var(--gi-white);
}

.gi-ai-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: 420px;
}

.gi-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--gi-gray-100);
}

.gi-ai-msg {
    display: flex;
    gap: 10px;
    max-width: 90%;
}

.gi-ai-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.gi-ai-avatar {
    width: 32px;
    height: 32px;
    background: var(--gi-primary);
    color: var(--gi-white);
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gi-ai-msg.user .gi-ai-avatar {
    background: var(--gi-gray-600);
}

.gi-ai-bubble {
    padding: 10px 14px;
    background: var(--gi-white);
    border: 1px solid var(--gi-gray-400);
    color: var(--gi-black);
    font-size: 13px;
    line-height: 1.6;
}

.gi-ai-msg.user .gi-ai-bubble {
    background: var(--gi-primary);
    border-color: var(--gi-primary);
    color: var(--gi-white);
}

.gi-ai-input-area {
    padding: 12px 14px;
    border-top: 1px solid var(--gi-gray-400);
    background: var(--gi-white);
}

.gi-ai-input-wrap {
    display: flex;
    gap: 8px;
}

.gi-ai-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--gi-white);
    border: 1px solid var(--gi-gray-500);
    color: var(--gi-black);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    min-height: 40px;
    max-height: 80px;
}

.gi-ai-input:focus {
    outline: none;
    border-color: var(--gi-primary);
}

.gi-ai-send {
    width: 40px;
    height: 40px;
    background: var(--gi-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gi-ai-send:hover {
    background: var(--gi-primary-dark);
}

.gi-ai-send:disabled {
    opacity: 0.5;
}

.gi-ai-send svg {
    width: 16px;
    height: 16px;
    color: var(--gi-white);
}

.gi-ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.gi-ai-chip {
    padding: 6px 10px;
    background: var(--gi-white);
    border: 1px solid var(--gi-gray-500);
    color: var(--gi-gray-900);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.gi-ai-chip:hover {
    background: var(--gi-primary);
    border-color: var(--gi-primary);
    color: var(--gi-white);
}

/* === サイドバーリスト === */
.gi-sidebar-list {
    display: flex;
    flex-direction: column;
}

.gi-sidebar-list-item {
    border-bottom: 1px solid var(--gi-gray-300);
}

.gi-sidebar-list-item:last-child {
    border-bottom: none;
}

.gi-sidebar-list-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: var(--gi-black);
}

.gi-sidebar-list-link:hover {
    color: var(--gi-primary);
    text-decoration: none;
}

.gi-sidebar-rank {
    width: 24px;
    height: 24px;
    background: var(--gi-gray-300);
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--gi-gray-800);
}

.gi-sidebar-rank.rank-1 {
    background: #ffd700;
    color: var(--gi-black);
}

.gi-sidebar-rank.rank-2 {
    background: #c0c0c0;
    color: var(--gi-black);
}

.gi-sidebar-rank.rank-3 {
    background: #cd7f32;
    color: var(--gi-white);
}

.gi-sidebar-rank.urgent {
    background: var(--gi-accent);
    color: var(--gi-white);
}

.gi-sidebar-rank.warning {
    background: var(--gi-warning);
    color: var(--gi-white);
}

.gi-sidebar-list-content {
    flex: 1;
    min-width: 0;
}

.gi-sidebar-list-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gi-sidebar-list-meta {
    font-size: 11px;
    color: var(--gi-gray-700);
    margin-top: 2px;
}

/* === コラムカード === */
.gi-column-card {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gi-gray-300);
    color: var(--gi-black);
}

.gi-column-card:last-child {
    border-bottom: none;
}

.gi-column-card:hover {
    text-decoration: none;
}

.gi-column-card:hover .gi-column-title {
    color: var(--gi-primary);
}

.gi-column-thumb {
    width: 60px;
    height: 60px;
    background: var(--gi-gray-300);
    flex-shrink: 0;
    overflow: hidden;
}

.gi-column-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gi-column-content {
    flex: 1;
    min-width: 0;
}

.gi-column-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

.gi-column-date {
    font-size: 11px;
    color: var(--gi-gray-700);
}

/* === 広告枠 === */
.gi-ad-section {
    background: var(--gi-gray-100);
    border: 1px dashed var(--gi-gray-500);
}

.gi-ad-section .gi-sidebar-header {
    background: transparent;
    border-bottom: 1px dashed var(--gi-gray-500);
}

.gi-ad-section .gi-sidebar-title {
    color: var(--gi-gray-600);
    font-size: 11px;
}

.gi-ad-placeholder {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gi-gray-600);
    font-size: 13px;
}

/* === 関連補助金 === */
.gi-related {
    padding: 40px 0;
    background: var(--gi-gray-100);
    border-top: 1px solid var(--gi-gray-400);
    margin-top: 40px;
}

.gi-related-header {
    text-align: center;
    margin-bottom: 28px;
}

.gi-related-en {
    display: none;
}

.gi-related-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--gi-black);
}

.gi-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .gi-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .gi-related-grid {
        grid-template-columns: 1fr;
    }
}

.gi-related-card {
    background: var(--gi-white);
    border: 1px solid var(--gi-gray-400);
    padding: 16px;
    color: var(--gi-black);
}

.gi-related-card:hover {
    border-color: var(--gi-primary);
    text-decoration: none;
}

.gi-related-card-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--gi-success-light);
    border: 1px solid var(--gi-success);
    color: var(--gi-success);
    font-size: 10px;
    font-weight: bold;
    margin-bottom: 8px;
}

.gi-related-card-title {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gi-related-card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--gi-gray-800);
}

.gi-related-card-meta strong {
    color: var(--gi-primary);
}

/* === モバイルFAB === */
.gi-mobile-fab {
    display: none;
    position: fixed;
    bottom: calc(var(--gi-mobile-banner, 60px) + 16px);
    right: 16px;
    z-index: 100;
}

@media (max-width: 900px) {
    .gi-mobile-fab {
        display: block;
    }
}

.gi-fab-btn {
    width: 56px;
    height: 56px;
    background: var(--gi-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

.gi-fab-btn svg {
    width: 22px;
    height: 22px;
    color: var(--gi-white);
}

.gi-fab-btn span {
    font-size: 9px;
    font-weight: bold;
    color: var(--gi-white);
}

/* === モバイルパネル === */
.gi-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: var(--gi-transition);
}

.gi-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 900px) {
    .gi-mobile-overlay {
        display: block;
    }
}

.gi-mobile-panel {
    display: none;
    position: fixed;
    bottom: var(--gi-mobile-banner, 60px);
    left: 0;
    right: 0;
    background: var(--gi-white);
    max-height: calc(80vh - var(--gi-mobile-banner, 60px));
    z-index: 999;
    transform: translateY(100%);
    visibility: hidden;
    transition: 0.3s ease;
    flex-direction: column;
    border-top: 1px solid var(--gi-gray-400);
}

.gi-mobile-panel.active {
    transform: translateY(0);
    visibility: visible;
}

@media (max-width: 900px) {
    .gi-mobile-panel {
        display: flex;
    }
}

.gi-panel-handle {
    width: 36px;
    height: 4px;
    background: var(--gi-gray-500);
    margin: 10px auto;
    border-radius: 2px;
}

.gi-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-panel-title {
    font-size: 16px;
    font-weight: bold;
}

.gi-panel-close {
    width: 32px;
    height: 32px;
    background: var(--gi-gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.gi-panel-close svg {
    width: 18px;
    height: 18px;
    color: var(--gi-gray-700);
}

.gi-panel-tabs {
    display: flex;
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-panel-tab {
    flex: 1;
    padding: 12px;
    font-size: 13px;
    font-weight: bold;
    color: var(--gi-gray-700);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.gi-panel-tab.active {
    color: var(--gi-primary);
    border-bottom-color: var(--gi-primary);
}

.gi-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.gi-panel-content-tab {
    display: none;
}

.gi-panel-content-tab.active {
    display: block;
}

/* === モバイルAI === */
.gi-mobile-ai-messages {
    min-height: 160px;
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    padding: 14px;
    background: var(--gi-gray-100);
    border: 1px solid var(--gi-gray-400);
}

.gi-mobile-ai-input-wrap {
    display: flex;
    gap: 8px;
}

.gi-mobile-ai-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--gi-gray-500);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 44px;
}

.gi-mobile-ai-input:focus {
    outline: none;
    border-color: var(--gi-primary);
}

.gi-mobile-ai-send {
    width: 44px;
    height: 44px;
    background: var(--gi-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gi-mobile-ai-send svg {
    width: 18px;
    height: 18px;
    color: var(--gi-white);
}

.gi-mobile-ai-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.gi-mobile-ai-chip {
    padding: 8px 14px;
    background: var(--gi-white);
    border: 1px solid var(--gi-gray-500);
    font-size: 13px;
    font-weight: 600;
}

.gi-mobile-ai-chip:hover {
    background: var(--gi-primary);
    border-color: var(--gi-primary);
    color: var(--gi-white);
}

/* === トースト === */
.gi-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gi-black);
    color: var(--gi-white);
    padding: 12px 20px;
    font-size: 13px;
    font-weight: bold;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
}

.gi-toast.show {
    opacity: 1;
    visibility: visible;
    bottom: 40px;
}

/* === 印刷スタイル === */
@media print {
    .gi-sidebar,
    .gi-mobile-fab,
    .gi-mobile-overlay,
    .gi-mobile-panel,
    .gi-progress,
    .gi-related,
    .gi-ad-section,
    .gi-ai-section {
        display: none;
    }
    
    .gi-layout {
        grid-template-columns: 1fr;
    }
    
    .gi-page {
        background: white;
    }
}

/* === アクセシビリティ === */
@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0.01ms;
    }
}

:focus-visible {
    outline: 2px solid var(--gi-primary);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.gi-skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--gi-primary);
    color: var(--gi-white);
    padding: 10px 16px;
    z-index: 10000;
}

.gi-skip-link:focus {
    top: 0;
}

/* === チェックリスト追加スタイル（競合回避） === */
.gi-grant-page .gi-checklist {
    display: block;
    visibility: visible;
    opacity: 1;
    position: relative;
    z-index: 1;
}

.gi-grant-page .gi-checklist-header {
    display: flex;
    visibility: visible;
}

.gi-grant-page .gi-checklist-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: bold;
    color: var(--gi-black);
    margin: 0;
}

.gi-grant-page .gi-checklist-title svg {
    width: 18px;
    height: 18px;
    color: var(--gi-black);
    display: inline-block;
}

.gi-grant-page .gi-checklist-category-header {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--gi-gray-100);
    font-size: 13px;
    font-weight: bold;
    color: var(--gi-gray-900);
    border-bottom: 1px solid var(--gi-gray-400);
}

.gi-grant-page .gi-checklist-item {
    display: flex;
    visibility: visible;
    opacity: 1;
}

.gi-grant-page .gi-checklist-checkbox {
    display: flex;
    visibility: visible;
}

.gi-grant-page .gi-checklist-label {
    display: block;
    visibility: visible;
}
