/* ==========================================================================
   家計の羅針盤 - デザインシステム & スタイルシート
   ========================================================================== */

/* 変数定義（フォレストグリーン ＆ ソフトゴールド） */
:root {
    --primary-color: #1a4d2e;      /* フォレストグリーン */
    --primary-light: #e8f0eb;      /* フォレストグリーン淡い背景 */
    --primary-rgb: 26, 77, 46;
    
    --secondary-color: #e2b04c;    /* ソフトゴールド */
    --secondary-light: #fff9e6;    
    
    --bg-color: #f7f9f6;           /* 温かみのあるオフホワイト */
    --text-color: #2c3531;         /* チャコール */
    --text-light: #6e7a74;
    
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-border: rgba(26, 77, 46, 0.08);
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
    
    --success-color: #2e7d32;
    --danger-color: #c62828;
    --warning-color: #ef6c00;
    --info-color: #1565c0;
    
    --border-radius: 16px;
    --border-radius-sm: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* 基本リセットと共通設定 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* アプリケーションシェル（スクロールの破綻を防ぎ、ボトムナビを常に固定） */
html {
    height: 100%;
    height: 100dvh;
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    
    /* 画面のスクロールバグ対策：画面サイズを固定し、はみ出しを防ぐ */
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ヘッダーデザイン */
.app-header {
    background-color: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* ヘッダーが縮むのを防止 */
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    color: var(--primary-color);
    width: 24px;
    height: 24px;
}

.logo-text h1 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.1;
}

.logo-sub {
    font-size: 0.65rem;
    color: var(--text-light);
    display: block;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 同期インジケーター */
.sync-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    transition: var(--transition);
}

.sync-indicator.local { background-color: #ededed; color: #555; }
.sync-indicator.synced { background-color: #e8f5e9; color: var(--success-color); }
.sync-indicator.error { background-color: #ffebee; color: var(--danger-color); }
.sync-indicator.syncing {
    background-color: #e3f2fd;
    color: var(--info-color);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.sync-indicator i {
    width: 12px;
    height: 12px;
}

/* アイコンボタン */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--primary-color);
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background-color: var(--primary-light);
}

/* メイン表示領域（スクロールをここに移譲する） */
.app-main {
    flex: 1;
    overflow-y: auto; /* メイン領域のみスクロール可能にする */
    -webkit-overflow-scrolling: touch; /* iOSのスクロールを滑らかに */
    padding: 16px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* タブコンテンツ切り替え */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* セクション見出し */
.section-header {
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 700;
}

.section-desc {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* プレミアムガラスカードデザイン */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 16px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.card-header.border-b {
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 8px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

.card-title i {
    width: 18px;
    height: 18px;
}

/* 口座、保険、サブスクの一覧上部アクションヘッダー */
.list-action-header {
    display: flex;
    justify-content: flex-start;
}

/* グリッドレイアウト & ユーティリティ */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }

.grid-2 > *, .grid-3 > *, .grid-4 > *, .grid-5 > * {
    min-width: 0;
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; gap: 10px; }
}

.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.p-0 { padding: 0 !important; }
.text-center { text-align: center; }

/* ボタンコンポーネント */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background-color: #123620;
    box-shadow: 0 4px 10px rgba(26, 77, 46, 0.15);
}

.btn-secondary {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background-color: rgba(var(--primary-rgb), 0.15);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #b71c1c;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
}

.btn-group {
    display: flex;
    gap: 8px;
}

.btn-file-label {
    position: relative;
    cursor: pointer;
}

/* フォーム部品 */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--card-border);
    background-color: white;
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    color: var(--text-color);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 77, 46, 0.08);
}

.form-control-sm {
    padding: 6px 10px;
    font-size: 0.8rem;
}

textarea.form-control {
    resize: vertical;
    font-family: inherit;
}

/* バッジとラベル */
.badge {
    background-color: var(--secondary-light);
    color: #9c6c10;
    border: 1px solid rgba(226, 176, 76, 0.3);
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: rgba(26, 77, 46, 0.2);
}

.badge.badge-warning {
    background-color: rgba(226, 176, 76, 0.15);
    color: #9c6c10;
    border-color: rgba(226, 176, 76, 0.4);
}

/* テーブルスタイル */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    table-layout: auto;
}

.custom-table th, .custom-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
    word-break: break-all;
}

.custom-table th {
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 480px) {
    .custom-table th, .custom-table td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }
}

.custom-table tbody tr:hover {
    background-color: rgba(26, 77, 46, 0.02);
}

/* 1. ダッシュボード画面固有 */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.summary-card.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.summary-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(26, 77, 46, 0.08);
    border-color: var(--primary-color);
}

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

.summary-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 14px;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
}

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

.summary-card .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.summary-card.asset .card-icon { background-color: #e8f5e9; color: var(--success-color); }
.summary-card.budget .card-icon { background-color: #fff3e0; color: var(--warning-color); }
.summary-card.subsc .card-icon { background-color: #e3f2fd; color: var(--info-color); }

.summary-card .card-info h3 {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 2px;
}

.summary-card .card-info .value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
}

.summary-card .card-info .value .unit {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
}

.summary-card .card-info .subtext {
    font-size: 0.65rem;
    color: var(--text-light);
    display: block;
}

.value-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar-mini {
    width: 50px;
    height: 5px;
    background-color: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    background-color: var(--warning-color);
    width: 0%;
    transition: var(--transition);
}

/* もしも緊急バナー */
.emergency-banner {
    background: linear-gradient(135deg, #d32f2f, #b71c1c);
    color: white;
    border-radius: var(--border-radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(183, 28, 28, 0.2);
    transition: var(--transition);
}

.emergency-banner:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(183, 28, 28, 0.3);
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.banner-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-icon i {
    width: 18px;
    height: 18px;
}

.banner-text h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.banner-text p {
    font-size: 0.7rem;
    opacity: 0.85;
}

.banner-arrow {
    width: 18px;
    height: 18px;
    opacity: 0.8;
}

.dashboard-row {
    display: flex;
    gap: 16px;
}

@media (max-width: 768px) {
    .dashboard-row { flex-direction: column; gap: 0; }
}

.meeting-reminder-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
}

/* 会議日程スケジューラー */
.meeting-scheduler-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--primary-light);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
}

.scheduler-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    white-space: nowrap;
}

.meeting-scheduler-box input[type="date"] {
    flex: 1;
    font-weight: 600;
    color: var(--primary-color);
}

.meeting-desc {
    color: var(--text-light);
}

/* ダッシュボードの貯蓄サマリー */
.savings-summary-dashboard {
    background-color: var(--primary-light);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.savings-summary-dashboard strong {
    color: var(--primary-color);
}

.clear-90-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 6px;
}

.clear-90-badge.success { background-color: #e8f5e9; color: var(--success-color); }
.clear-90-badge.fail { background-color: #ffebee; color: var(--danger-color); }

/* 2. 家計会議ハブ */
.meeting-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
}

.meeting-layout > * {
    min-width: 0;
}

@media (max-width: 992px) {
    .meeting-layout { grid-template-columns: 1fr; }
}

.meeting-meta-inputs {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    background-color: var(--primary-light);
    padding: 12px;
    border-radius: var(--border-radius-sm);
}

.meeting-meta-inputs .form-group {
    flex: 1;
    min-width: 0;
}

@media (max-width: 576px) {
    .meeting-meta-inputs { flex-direction: column; gap: 10px; }
}

.meeting-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.meeting-step {
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    background-color: white;
    transition: var(--transition);
}

.step-header {
    background-color: #fafbfc;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.step-number {
    width: 22px;
    height: 22px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.step-header h4 {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.step-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-light);
    transition: var(--transition);
}

.step-body {
    display: none;
    padding: 16px;
    border-top: 1px solid var(--card-border);
}

.meeting-step.active .step-body {
    display: block;
}

.meeting-step.active .step-header {
    background-color: var(--primary-light);
}

.meeting-step.active .step-arrow {
    transform: rotate(180deg);
}

.step-instruction {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 12px;
    background-color: #fffde7;
    border-left: 3px solid var(--secondary-color);
    padding: 6px 10px;
    border-radius: 4px;
}

/* 過去の会議録一覧 */
.meeting-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 2px;
}

.history-card {
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
    background-color: white;
    cursor: pointer;
    transition: var(--transition);
    min-width: 0;
}

.history-card:hover {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
}

.history-card.active {
    border-color: var(--primary-color);
    background-color: var(--primary-light);
    box-shadow: 0 2px 6px rgba(26, 77, 46, 0.08);
}

.history-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}

.history-date {
    font-weight: 600;
    font-size: 0.8rem;
}

.history-month {
    font-size: 0.7rem;
    color: var(--text-light);
}

.history-summary {
    font-size: 0.7rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    padding: 30px 0;
    gap: 6px;
}

.empty-state i {
    width: 24px;
    height: 24px;
    opacity: 0.5;
}

/* 3. 家計簿・予算画面 */
.budget-goal-banner {
    background-color: #e8f5e9;
    border: 1px solid rgba(46, 125, 80, 0.15);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.goal-banner-icon {
    color: var(--success-color);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.goal-banner-text h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--success-color);
}

.goal-banner-text p {
    font-size: 0.75rem;
    color: #388e3c;
    margin-top: 1px;
}

.budget-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 16px;
}

@media (max-width: 992px) {
    .budget-layout { grid-template-columns: 1fr; }
}

.budget-settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group-category {
    background-color: #fafbfc;
    border: 1.5px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    transition: var(--transition);
}

.form-group-category:focus-within {
    border-color: var(--primary-color);
    background-color: white;
}

.category-header {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cat-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.cat-title .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.fixed-m .cat-title .dot { background-color: var(--primary-color); }
.variable-m .cat-title .dot { background-color: var(--success-color); }
.fixed-i .cat-title .dot { background-color: var(--info-color); }
.variable-i .cat-title .dot { background-color: var(--warning-color); }

.cat-desc {
    font-size: 0.65rem;
    color: var(--text-light);
    margin-top: 2px;
}

.form-group-category input {
    width: 110px;
    text-align: right;
    font-size: 1rem;
    font-weight: 700;
}

.diff-positive { color: var(--success-color); font-weight: 600; }
.diff-negative { color: var(--danger-color); font-weight: 600; }

.savings-ratio-status-box {
    background-color: var(--primary-light);
    border-radius: var(--border-radius-sm);
    padding: 10px 14px;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-left: 3.5px solid var(--primary-color);
}

/* 4. ⏳ ライフプラン（将来設計）アコーディオン等 */
.sim-summary-strip {
    background-color: #fafbfc;
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 12px;
}

.glass-details {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--card-shadow);
    margin-bottom: 12px;
    overflow: hidden;
}

.details-summary-btn {
    padding: 12px 16px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.85rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.details-summary-btn::-webkit-details-marker {
    display: none;
}

.details-arrow {
    width: 16px;
    height: 16px;
    color: var(--primary-color);
    transition: var(--transition);
}

.glass-details[open] .details-arrow {
    transform: rotate(180deg);
}

.details-expanded-content {
    padding: 16px;
    border-top: 1px solid var(--card-border);
    background-color: white;
}

.event-add-layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lifeplan-detailed-grid {
    display: grid;
    grid-template-columns: 1fr; /* 横幅を最大にして見やすく */
    gap: 16px;
}

.lp-table-card {
    max-height: 550px;
    display: flex;
    flex-direction: column;
}

.lp-table-card .card-body {
    flex: 1;
    overflow: auto;
}

.lp-table th {
    position: sticky;
    top: 0;
    z-index: 10;
}

.lp-table td {
    white-space: nowrap;
}

.lp-age-sub {
    font-size: 0.65rem;
    color: var(--text-light);
    display: block;
}

.event-cell {
    position: relative;
}

.lp-event-tag {
    display: inline-block;
    background-color: var(--primary-light);
    color: var(--primary-color);
    font-size: 0.7rem;
    padding: 1px 4px;
    border-radius: 4px;
    margin-bottom: 2px;
}

.lp-event-tag.edu {
    background-color: #e3f2fd;
    color: var(--info-color);
    border-left: 2px solid var(--info-color);
}

.lp-event-tag.custom-evt {
    background-color: var(--secondary-light);
    color: #9c6c10;
    border-left: 2px solid var(--secondary-color);
}

.lp-events-list {
    max-height: 200px;
    overflow-y: auto;
}

.compact-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* allow wrapping on narrow mobile screen */
    gap: 4px 8px;
    padding: 6px 8px;
    background-color: #fafbfc;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.75rem;
}

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

.item-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--danger-color);
    opacity: 0.6;
    transition: var(--transition);
}

.item-delete-btn:hover {
    opacity: 1;
}

/* 5. 資産・保険・サブスク */
.subtab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.subtab-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.subtab-btn i {
    width: 16px;
    height: 16px;
}

.subtab-btn:hover {
    color: var(--primary-color);
}

.subtab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 700;
}

.subtab-content {
    display: none;
}

.subtab-content.active {
    display: block;
}

/* 保有口座一覧 */
.assets-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
}

@media (max-width: 992px) {
    .assets-layout { grid-template-columns: 1fr; }
}

.asset-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 450px;
    overflow-y: auto;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fafbfc;
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
    transition: var(--transition);
}

.list-item:hover {
    border-color: rgba(26, 77, 46, 0.2);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
}

.item-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.item-title-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-title-row strong {
    font-size: 0.85rem;
    color: var(--text-color);
}

.item-meta-row {
    display: flex;
    gap: 6px;
    font-size: 0.65rem;
    color: var(--text-light);
}

.item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-value {
    font-weight: 700;
    color: var(--text-color);
    font-size: 0.95rem;
}

/* 保険・逆引きお助けガイド */
.insurance-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.insurance-toggle {
    flex: 1;
    padding: 10px;
    background-color: white;
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.insurance-toggle:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.insurance-toggle.active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(26, 77, 46, 0.1);
}

.insurance-view {
    display: none;
}

.insurance-view.active {
    display: block;
}

.guide-intro {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.intro-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.intro-text strong {
    font-size: 0.8rem;
    display: block;
    margin-bottom: 2px;
}

.intro-text p {
    font-size: 0.75rem;
    line-height: 1.4;
}

/* 逆引きアコーディオン */
.lookup-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.lookup-card {
    background-color: white;
    border: 1.5px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.lookup-card:hover {
    border-color: var(--secondary-color);
}

.lookup-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.lookup-hdr-icon {
    width: 28px;
    height: 28px;
    background-color: #feebee;
    color: var(--danger-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lookup-header h4 {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.lookup-body {
    display: none;
    padding: 16px;
    background-color: #fafbfc;
    border-top: 1px solid var(--card-border);
}

.lookup-card.active .lookup-body {
    display: block;
}

.lookup-card.active {
    border-color: var(--primary-color);
}

.lookup-card.active .lookup-hdr-icon {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.lookup-card.active .step-arrow {
    transform: rotate(180deg);
}

.guide-step-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guide-step {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.g-step-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.g-step-content {
    font-size: 0.8rem;
    color: var(--text-color);
}

.g-step-content strong {
    color: var(--primary-color);
}

.related-ins-box {
    margin-top: 12px;
    background-color: white;
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 10px 12px;
}

.related-ins-box h5 {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.related-ins-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ins-mini-card {
    border: 1.5px dashed var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 8px 12px;
    background-color: var(--primary-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ins-m-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--primary-color);
}

.ins-m-meta {
    font-size: 0.65rem;
    color: var(--text-light);
}

.insurance-detail-item {
    font-size: 0.65rem;
    color: var(--text-light);
    background-color: #f0f3f1;
    padding: 2px 4px;
    border-radius: 4px;
}

/* デジタル証券リンク */
.cert-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 600;
}

.cert-link i {
    width: 12px;
    height: 12px;
}

/* 5-3. サブスク管理 */
.necessity-badge {
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

.necessity-badge.essential { background-color: #e8f5e9; color: var(--success-color); }
.necessity-badge.review { background-color: #fff3e0; color: var(--warning-color); }
.necessity-badge.cancel { background-color: #ffebee; color: var(--danger-color); }


/* モバイル表示時のメインコンテンツの底上げ（ボトムナビと重ならないようにする） */
@media (max-width: 767px) {
    .app-main {
        padding-bottom: calc(100px + var(--safe-area-bottom)) !important;
    }
}

/* モバイル用ボトムナビゲーション (画面最下部にぴったり固定) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + var(--safe-area-bottom));
    background-color: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--card-border);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.02);
    z-index: 100;
    flex-shrink: 0; /* これにより、フレックスコンテナ内で縮むのを防ぐ */
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.6rem;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    transition: var(--transition);
}

.nav-item i {
    width: 20px;
    height: 20px;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    font-weight: 700;
}

.nav-item.active i {
    transform: scale(1.05);
    color: var(--primary-color);
}


/* 設定・入力モーダル共通（dialog） */
.glass-modal {
    margin: auto;
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 16px;
    width: 92%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    outline: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: zoomIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.glass-modal::backdrop {
    background-color: rgba(26, 77, 46, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
}

.modal-header h3 {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: var(--transition);
}

.close-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.modal-hr {
    border: 0;
    height: 1px;
    background-color: var(--card-border);
    margin: 16px 0;
}

.desc-text {
    font-size: 0.8rem;
    color: var(--text-light);
}

.text-sm {
    font-size: 0.7rem;
}

.setup-help-box {
    background-color: rgba(var(--primary-rgb), 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-sm);
    padding: 10px;
}

.setup-help-box h5 {
    font-size: 0.75rem;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.setup-help-box ol {
    margin-left: 16px;
    font-size: 0.7rem;
    color: var(--text-color);
}

.setup-help-box li {
    margin-bottom: 4px;
}

.code-block {
    background-color: #272822;
    color: #f8f8f2;
    padding: 8px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.65rem;
    overflow-x: auto;
    max-height: 140px;
    margin-top: 4px;
    white-space: pre;
}

.gas-code-details summary {
    font-size: 0.75rem;
    color: var(--primary-color);
    cursor: pointer;
}


/* ==========================================================================
   PC用レスポンシブ表示（768px以上はボトムナビをサイドナビに変換）
   ========================================================================== */
@media (min-width: 768px) {
    .app-container {
        flex-direction: row;
    }
    
    .app-header {
        display: none; /* PCでは左サイドナビに統合 */
    }
    
    /* PC用左サイドナビ */
    .bottom-nav {
        position: sticky;
        top: 0;
        bottom: auto;
        left: auto;
        width: 200px;
        height: 100vh;
        flex-direction: column;
        justify-content: flex-start;
        padding: 30px 12px;
        gap: 12px;
        border-top: none;
        border-right: 1px solid var(--card-border);
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.01);
    }
    
    .bottom-nav::before {
        content: "家計の羅針盤";
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--primary-color);
        margin-bottom: 24px;
        padding-left: 8px;
        display: block;
    }
    
    .nav-item {
        flex-direction: row;
        gap: 10px;
        width: 100%;
        padding: 10px 12px;
        border-radius: var(--border-radius-sm);
        font-size: 0.85rem;
        flex: none;
    }
    
    .nav-item.active {
        background-color: var(--primary-light);
    }
    
    .nav-item.active i {
        transform: none;
    }
    
    .app-main {
        padding: 30px;
        height: 100vh;
        overflow-y: auto;
    }
}

/* 予算内訳項目用のスタイル */
.budget-items-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.budget-item-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.4);
    padding: 4px;
    border-radius: var(--border-radius-sm);
}

.budget-item-row .item-name-input {
    flex: 2;
}

.budget-item-row .item-amount-input {
    flex: 1.2;
}

.budget-item-row .btn-delete-item {
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--danger-color);
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.budget-item-row .btn-delete-item:hover {
    background-color: #ffebee;
    border-color: #ffcdd2;
}

.btn-add-budget-item {
    font-size: 0.75rem;
    padding: 6px 12px;
}

@media (max-width: 480px) {
    .budget-item-row {
        flex-wrap: wrap;
        gap: 6px;
        padding: 8px;
        background: rgba(255, 255, 255, 0.6);
        border: 1px solid var(--card-border);
    }
    .budget-item-row .item-name-input {
        flex: 1 0 100%;
        width: 100%;
    }
    .budget-item-row .item-amount-input {
        flex: 1;
        min-width: 80px;
    }
    .budget-item-row .item-cycle-select {
        flex: 0 0 100px;
        width: 100px;
    }
    .budget-item-row .btn-delete-item {
        flex-shrink: 0;
    }
    .budget-item-row .form-control-sm {
        padding: 6px 8px;
        font-size: 0.75rem;
        height: 32px;
    }
}

/* ==========================================================================
   警告オンボーディングカード（GAS未同期アラート）
   ========================================================================== */
.warning-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: linear-gradient(135deg, #fffaf0 0%, #fff5e6 100%);
    border: 1px solid #ffe3b3;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.05);
    animation: fadeIn 0.4s ease-out;
}

.warning-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #ffe3b3;
    color: #d97706;
    padding: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.warning-card-icon i {
    width: 20px;
    height: 20px;
}

.warning-card-content {
    flex: 1;
}

.warning-card-content h3 {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #b45309;
}

.warning-card-content p {
    margin: 0 0 12px 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #78350f;
}

.warning-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #d97706;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.warning-btn:hover {
    background-color: #b45309;
}

.warning-btn:active {
    transform: scale(0.97);
}

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

/* 🛡️ 保険ステータスバッジ (払込完了) */
.ins-status-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}
.ins-status-badge.paid-off {
    background-color: #e8f5e9;
    color: var(--success-color);
    border: 1px solid rgba(76, 175, 80, 0.3);
}

/* 🏛️ 公的保障セクション */
.public-insurance-overview {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.public-insurance-overview h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--primary-light);
    font-size: 1rem;
}

.public-ins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.public-ins-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s ease;
}

.public-ins-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.public-ins-card h5 {
    font-size: 0.85rem;
    margin-bottom: 6px;
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.public-ins-card p {
    font-size: 0.75rem;
    color: var(--text-light);
    line-height: 1.4;
}

/* シナリオ内公的保障枠 */
.public-ins-box {
    background: rgba(21, 101, 192, 0.08);
    border: 1px solid rgba(21, 101, 192, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

.public-ins-box h5 {
    color: #42a5f5;
    font-size: 0.8rem;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.public-ins-box p {
    font-size: 0.75rem;
    color: var(--text-color);
    line-height: 1.4;
}

/* 🛠️ 独自のもしもガイド追加ボタンとアクション */
.lookup-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.custom-sc-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

/* AI ローディング */
.ai-loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 🛡️ 被保険者バッジ */
.insured-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    border: 1px solid transparent;
}

.insured-badge.husband {
    background-color: #e3f2fd;
    color: #0d47a1;
    border-color: rgba(13, 71, 161, 0.25);
}

.insured-badge.wife {
    background-color: #fce4ec;
    color: #c2185b;
    border-color: rgba(194, 24, 91, 0.25);
}

.insured-badge.family {
    background-color: #e8f5e9;
    color: #1b5e20;
    border-color: rgba(27, 94, 32, 0.25);
}

.insured-badge.other {
    background-color: #f5f5f5;
    color: #616161;
    border-color: rgba(97, 97, 97, 0.25);
}

/* 🏛️ 公的保障の申請詳細トグル & コンテンツ */
.public-ins-detail-toggle {
    margin-top: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(66, 165, 245, 0.3);
    border-radius: 6px;
    font-size: 0.75rem;
    color: #90caf9;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.public-ins-detail-toggle:hover {
    background: rgba(66, 165, 245, 0.1);
    color: #fff;
    border-style: solid;
}

.public-ins-detail-toggle .detail-arrow {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

.public-ins-detail-toggle.active .detail-arrow {
    transform: rotate(180deg);
}

.public-ins-detail-content {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.public-ins-detail-content .detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.public-ins-detail-content .detail-label {
    font-size: 0.7rem;
    font-weight: bold;
    color: #90caf9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.public-ins-detail-content .detail-label i {
    width: 12px;
    height: 12px;
}

.public-ins-detail-content .detail-value {
    font-size: 0.75rem;
    color: var(--text-color);
    line-height: 1.4;
    padding-left: 16px;
}


/* --- 家計会議 役割分担バッジ & ガイド用スタイル --- */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 12px;
    vertical-align: middle;
    margin-left: 8px;
}

.role-badge.badge-husband {
    background-color: rgba(33, 150, 243, 0.08);
    color: #1565c0;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.role-badge.badge-wife {
    background-color: rgba(233, 30, 99, 0.08);
    color: #c2185b;
    border: 1px solid rgba(233, 30, 99, 0.2);
}

/* ステップ別折りたたみヒント */
.step-guide-details {
    background: rgba(26, 77, 46, 0.04);
    border: 1px dashed rgba(26, 77, 46, 0.15);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.step-guide-details[open] {
    background: rgba(26, 77, 46, 0.07);
    border: 1px solid rgba(26, 77, 46, 0.2);
}

.step-guide-details summary {
    font-weight: 600;
    color: var(--primary-color);
}

.step-guide-details .details-expanded-content {
    background: transparent;
    padding: 10px 12px;
}

.step-guide-text-list {
    margin: 0;
    padding-left: 16px;
    font-size: 0.76rem;
    color: var(--text-dark);
}

.step-guide-text-list li {
    margin-bottom: 6px;
    line-height: 1.4;
}

.step-guide-text-list li:last-child {
    margin-bottom: 0;
}

/* 全体ガイドモーダル内のレイアウト */
.guide-modal-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.guide-section-card {
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius-sm);
    padding: 15px;
}

.guide-section-card h4 {
    font-size: 0.88rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1.5px solid var(--primary-light);
    padding-bottom: 6px;
}

.guide-role-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 576px) {
    .guide-role-box {
        grid-template-columns: 1fr;
    }
}

.guide-role-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 12px;
}

.guide-role-title {
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.guide-role-desc {
    font-size: 0.75rem;
    color: var(--text-dark);
    line-height: 1.4;
}

.guide-tips-list {
    margin: 0;
    padding-left: 18px;
    font-size: 0.78rem;
}

.guide-tips-list li {
    margin-bottom: 8px;
    line-height: 1.45;
}

/* ==========================================================================
   家計会議サブスク連携用の新規追加スタイル
   ========================================================================== */
.meeting-subsc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    margin-bottom: 8px;
}

.meeting-subsc-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 4px;
}

.necessity-select {
    padding: 2px 20px 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 8px 8px;
    appearance: none;
    -webkit-appearance: none;
    height: 20px;
    line-height: 1;
}

.necessity-select.essential {
    background-color: #e8f5e9;
    color: var(--success-color);
    border-color: #c8e6c9;
    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='%232e7d32' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.necessity-select.review {
    background-color: #fff3e0;
    color: var(--warning-color);
    border-color: #ffe0b2;
    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='%23ef6c00' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.necessity-select.cancel {
    background-color: #ffebee;
    color: var(--danger-color);
    border-color: #ffcdd2;
    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='%23c62828' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.btn-xs {
    padding: 2px 6px;
    font-size: 0.65rem;
    border-radius: 4px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    border: none;
    cursor: pointer;
    font-weight: 500;
}

