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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    padding: 0;
    color: #202124;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background: white;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
    zoom: 0.7;
}

/* ヘッダー */
header {
    background: white;
    color: #202124;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

header h1 {
    font-size: 22px;
    font-weight: 400;
}

.header-actions {
    display: flex;
    gap: 8px;
}

/* タブ */
.tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 400;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #f8f9fa;
}

.tab-btn.active {
    background: white;
    color: #1a73e8;
    border-bottom: 2px solid #1a73e8;
    font-weight: 500;
}

/* タブコンテンツ */
.tab-content {
    display: none;
    padding: 16px;
}

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

/* カード */
.card {
    background: white;
    border-radius: 0;
    padding: 16px;
    margin-bottom: 0;
    box-shadow: none;
}

.card h2 {
    margin-bottom: 10px;
    color: #202124;
    font-size: 14px;
    font-weight: 500;
}

/* フォーム */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 4px;
    font-weight: 400;
    color: #5f6368;
    font-size: 12px;
}

.form-group input,
.form-group select {
    padding: 8px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    transition: border 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #1a73e8;
}

/* ボタン */
.btn {
    padding: 6px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    color: #202124;
}

.btn:hover {
    background: #f8f9fa;
    border-color: #dadce0;
}

.btn-primary {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

.btn-primary:hover {
    background: #1765cc;
    border-color: #1765cc;
}

.btn-secondary {
    background: white;
    color: #5f6368;
    border: 1px solid #dadce0;
}

.btn-secondary:hover {
    background: #f8f9fa;
}

.btn-danger {
    background: white;
    color: #d93025;
    border: 1px solid #dadce0;
}

.btn-danger:hover {
    background: #fce8e6;
}

.btn-edit {
    background: white;
    color: #1a73e8;
    border: 1px solid #dadce0;
}

.btn-edit:hover {
    background: #e8f0fe;
}

/* テーブル */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.list-header h2 {
    font-size: 14px;
    font-weight: 500;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-group label {
    font-size: 11px;
    color: #5f6368;
}

.filter-group input,
.filter-group .filter-select {
    padding: 4px 6px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 12px;
}

.filter-group .filter-search {
    min-width: 200px;
    padding: 4px 6px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 12px;
}

.filter-group #savedReports {
    min-width: 150px;
}

.total-display {
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 6px;
    border: 1px solid #dadce0;
}

.total-display h3 {
    color: #202124;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}

.total-display span {
    color: #d93025;
    font-weight: 500;
}

.table-container {
    overflow-x: auto;
    border: 1px solid #dadce0;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

th {
    padding: 4px 6px;
    text-align: left;
    font-weight: 500;
    color: #202124;
    border-bottom: 1px solid #dadce0;
    border-right: 1px solid #dadce0;
    font-size: 11px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    line-height: 1.2;
}

th:hover {
    background: #e8eaed;
}

th.sortable::after {
    content: ' ⇅';
    opacity: 0.3;
    font-size: 9px;
}

th.sort-asc::after {
    content: ' ▲';
    opacity: 1;
    color: #1a73e8;
}

th.sort-desc::after {
    content: ' ▼';
    opacity: 1;
    color: #1a73e8;
}

td {
    padding: 4px 6px;
    border-bottom: 1px solid #dadce0;
    border-right: 1px solid #dadce0;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* 一覧の金額列を少し大きく */
#expenseTable tbody tr td:nth-child(4) {
    font-size: 14px;
    font-weight: 500;
}

td.action-buttons {
    white-space: nowrap;
    overflow: visible;
    padding: 2px 4px;
}

tbody tr:hover {
    background: #f8f9fa;
}

.action-buttons button {
    padding: 2px 6px;
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    margin-right: 2px;
    display: inline-block;
    vertical-align: middle;
}

.action-buttons button:last-child {
    margin-right: 0;
}

/* カテゴリバッジ */
.badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 500;
    white-space: nowrap;
    line-height: 1.4;
}

/* カテゴリごとの色分け */
.badge[data-category="食品"] {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge[data-category="日用品"] {
    background: #e3f2fd;
    color: #1565c0;
}

.badge[data-category="外食費"] {
    background: #fff3e0;
    color: #e65100;
}

.badge[data-category="衣類"] {
    background: #f3e5f5;
    color: #6a1b9a;
}

.badge[data-category="家具・家電"] {
    background: #e0f2f1;
    color: #00695c;
}

.badge[data-category="美容"] {
    background: #fce4ec;
    color: #c2185b;
}

.badge[data-category="医療費"] {
    background: #ffebee;
    color: #c62828;
}

.badge[data-category="交際費"] {
    background: #fff8e1;
    color: #f57f17;
}

.badge[data-category="レジャー"] {
    background: #e1f5fe;
    color: #0277bd;
}

.badge[data-category="ガソリン・ETC"] {
    background: #efebe9;
    color: #4e342e;
}

.badge[data-category="光熱費"] {
    background: #fbe9e7;
    color: #bf360c;
}

.badge[data-category="通信費"] {
    background: #e8eaf6;
    color: #283593;
}

.badge[data-category="保険"] {
    background: #e0f7fa;
    color: #006064;
}

.badge[data-category="車関連【車検・税金・積立】"] {
    background: #f1f8e9;
    color: #558b2f;
}

.badge[data-category="税金"] {
    background: #fce4ec;
    color: #ad1457;
}

.badge[data-category="経費"] {
    background: #e0f2f1;
    color: #004d40;
}

.badge[data-category="ローン"] {
    background: #ede7f6;
    color: #4527a0;
}

.badge[data-category="その他"] {
    background: #f5f5f5;
    color: #616161;
}

/* 分析タブ */
.analysis-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 0;
    flex-wrap: wrap;
}

.analysis-controls label {
    font-weight: 400;
    color: #5f6368;
    font-size: 11px;
    white-space: nowrap;
}

.analysis-controls select,
.analysis-controls input[type="date"] {
    padding: 4px 6px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 12px;
    max-width: 150px;
}

#categoryStats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.category-stat {
    background: white;
    padding: 12px;
    border-radius: 0;
    border: 1px solid #dadce0;
    border-left: 3px solid #1a73e8;
}

.category-stat h4 {
    color: #5f6368;
    font-size: 12px;
    margin-bottom: 4px;
    font-weight: 400;
}

.category-stat .amount {
    color: #202124;
    font-size: 16px;
    font-weight: 500;
}

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

.charts-container .card {
    border: 1px solid #dadce0;
    padding: 16px;
}

/* カテゴリ統計の色分け */
.category-stat[data-category="食品"] { border-left-color: #2e7d32; }
.category-stat[data-category="日用品"] { border-left-color: #1565c0; }
.category-stat[data-category="外食費"] { border-left-color: #e65100; }
.category-stat[data-category="衣類"] { border-left-color: #6a1b9a; }
.category-stat[data-category="家具・家電"] { border-left-color: #00695c; }
.category-stat[data-category="美容"] { border-left-color: #c2185b; }
.category-stat[data-category="医療費"] { border-left-color: #c62828; }
.category-stat[data-category="交際費"] { border-left-color: #f57f17; }
.category-stat[data-category="レジャー"] { border-left-color: #0277bd; }
.category-stat[data-category="ガソリン・ETC"] { border-left-color: #4e342e; }
.category-stat[data-category="光熱費"] { border-left-color: #bf360c; }
.category-stat[data-category="通信費"] { border-left-color: #283593; }
.category-stat[data-category="保険"] { border-left-color: #006064; }
.category-stat[data-category="車関連【車検・税金・積立】"] { border-left-color: #558b2f; }
.category-stat[data-category="税金"] { border-left-color: #ad1457; }
.category-stat[data-category="経費"] { border-left-color: #004d40; }
.category-stat[data-category="ローン"] { border-left-color: #4527a0; }
.category-stat[data-category="その他"] { border-left-color: #616161; }

/* 推移タブ */
.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-controls label {
    font-size: 12px;
    color: #5f6368;
}

.timeline-controls select {
    padding: 6px 8px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 13px;
}

.timeline-table-wrapper {
    overflow-x: auto;
    border: 1px solid #dadce0;
    max-height: 600px;
    overflow-y: auto;
}

.timeline-table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

/* 分析タブの年別テーブル（1年分・横スクロールなし） */
.yearly-table-wrapper {
    overflow-x: hidden;
    border: 1px solid #dadce0;
    max-height: 600px;
    overflow-y: auto;
}

.yearly-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: fixed;
}

.timeline-table th,
.yearly-table th {
    background: #f8f9fa;
    padding: 6px 4px;
    border: 1px solid #dadce0;
    font-weight: 500;
    color: #202124;
    text-align: center;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-table .sticky-col,
.yearly-table .sticky-col {
    position: sticky;
    left: 0;
    background: white;
    z-index: 11;
    font-weight: 500;
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    text-align: left;
}

.timeline-table thead th.sticky-col,
.yearly-table thead th.sticky-col {
    background: #f8f9fa;
    z-index: 12;
}

.timeline-table td,
.yearly-table td {
    padding: 4px 6px;
    border: 1px solid #dadce0;
    text-align: right;
    white-space: nowrap;
    font-size: 11px;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-table tbody tr:hover,
.yearly-table tbody tr:hover {
    background: #f8f9fa;
}

/* 出来事行のスタイル */
.timeline-memo-row {
    background: #fff8e1;
    border-top: 1px solid #dadce0;
    height: 48px;
}

.timeline-memo-row .memo-label {
    font-weight: 500;
    color: #202124;
    background: #fff8e1;
    height: 48px;
    vertical-align: top;
    min-width: 100px !important;
    max-width: 100px !important;
    width: 100px !important;
}

/* より具体的なセレクター */
td.sticky-col.memo-label {
    min-width: 100px !important;
    max-width: 100px !important;
    width: 100px !important;
}

.timeline-memo-row .memo-cell {
    font-size: 11px;
    color: #202124;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
    width: 80px;
    cursor: pointer;
    padding: 4px 6px;
    transition: background-color 0.2s;
    height: 48px;
    vertical-align: top;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.timeline-memo-row .memo-cell:not(:empty):hover {
    background: #fff3cd;
    color: #856404;
}

.timeline-memo-row .memo-cell:empty {
    background: white;
    cursor: default;
}

/* メモセクション */
.memo-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.memo-controls label {
    font-size: 12px;
    color: #5f6368;
}

.memo-controls input {
    padding: 6px 8px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 13px;
}

.memo-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.memo-item {
    display: flex;
    flex-direction: column;
}

.memo-item h3 {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #202124;
}

.memo-item textarea {
    width: 100%;
    min-height: 150px;
    padding: 8px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
}

.memo-section > button {
    grid-column: 1 / -1;
    justify-self: start;
}

/* モーダル */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #dadce0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.modal-content h2 {
    font-size: 18px;
    font-weight: 500;
    color: #202124;
    margin-bottom: 16px;
}

.close {
    color: #5f6368;
    float: right;
    font-size: 24px;
    font-weight: 400;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #202124;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .charts-container {
        grid-template-columns: 1fr;
    }

    header {
        flex-direction: column;
        gap: 15px;
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .analysis-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 通常入力テーブル */
.normal-input-table-wrapper {
    overflow-x: auto;
    border: 1px solid #dadce0;
    margin-top: 8px;
}

.normal-input-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.normal-input-table th {
    background: #f8f9fa;
    padding: 8px;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: #202124;
    border-bottom: 1px solid #dadce0;
    border-right: 1px solid #dadce0;
    white-space: nowrap;
}

.normal-input-table td {
    padding: 4px;
    border-bottom: 1px solid #dadce0;
    border-right: 1px solid #dadce0;
}

.normal-input-table input[type="date"],
.normal-input-table input[type="text"],
.normal-input-table input[type="number"],
.normal-input-table select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #dadce0;
    border-radius: 2px;
    font-size: 13px;
}

.normal-input-table input[type="number"] {
    text-align: right;
}

.normal-input-table .tax-btn {
    padding: 4px 8px;
    background: white;
    color: #1a73e8;
    border: 1px solid #dadce0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
}

.normal-input-table .tax-btn:hover {
    background: #e8f0fe;
}

/* モード切り替え */
.mode-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #dadce0;
}

.mode-btn {
    padding: 6px 12px;
    border: 1px solid #dadce0;
    background: white;
    color: #5f6368;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: #f8f9fa;
}

.mode-btn.active {
    background: #1a73e8;
    color: white;
    border-color: #1a73e8;
}

/* 一括入力テーブル */
.bulk-common-inputs {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    padding: 12px;
    background: white;
    border: 1px solid #dadce0;
    margin-bottom: 12px;
}

.bulk-common-inputs .form-group {
    flex: 1;
    margin-bottom: 0;
}

.bulk-common-inputs label {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #5f6368;
    margin-bottom: 4px;
}

.bulk-common-inputs input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 13px;
}

.bulk-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.bulk-actions button {
    white-space: nowrap;
}

.bulk-input-table-wrapper {
    overflow-x: auto;
    margin-bottom: 12px;
    border: 1px solid #dadce0;
}

.bulk-input-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.bulk-input-table th {
    background: #f8f9fa;
    padding: 8px;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: #202124;
    border-bottom: 1px solid #dadce0;
    border-right: 1px solid #dadce0;
    white-space: nowrap;
}

.bulk-input-table td {
    padding: 4px;
    border-bottom: 1px solid #dadce0;
    border-right: 1px solid #dadce0;
}

.bulk-input-table input[type="date"],
.bulk-input-table input[type="text"],
.bulk-input-table input[type="number"],
.bulk-input-table select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #dadce0;
    border-radius: 2px;
    font-size: 13px;
}

.bulk-input-table input[type="number"] {
    text-align: right;
}

.bulk-input-table .tax-btn {
    padding: 4px 8px;
    background: white;
    color: #1a73e8;
    border: 1px solid #dadce0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
}

.bulk-input-table .tax-btn:hover {
    background: #e8f0fe;
}

.bulk-input-table .delete-row-btn {
    padding: 4px 8px;
    background: white;
    color: #d93025;
    border: 1px solid #dadce0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
}

.bulk-input-table .delete-row-btn:hover {
    background: #fce8e6;
}

/* レスポンシブ対応 - 一括入力 */
@media (max-width: 768px) {
    .mode-switch {
        padding: 10px;
        padding-top: 15px;
    }

    .bulk-input-table-wrapper {
        overflow-x: scroll;
    }
}

/* 月別データ一覧テーブル */
.monthly-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.monthly-data-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.monthly-data-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dadce0;
    font-size: 12px;
}

.monthly-data-table th:first-child {
    width: 60px;
}

.monthly-data-table th:nth-child(2) {
    width: 70px;
}

.monthly-data-table th:nth-child(3),
.monthly-data-table th:nth-child(4) {
    text-align: right;
}

.monthly-data-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e0e0e0;
}

.monthly-data-table td:first-child {
    font-weight: 500;
    color: #5f6368;
}

.monthly-data-table td:nth-child(3),
.monthly-data-table td:nth-child(4) {
    text-align: right;
    font-family: 'Monaco', 'Menlo', monospace;
}

.monthly-data-table tbody tr:hover {
    background: #f8f9fa;
}

#monthlyDataTable {
    max-height: 400px;
    overflow-y: auto;
}

/* 小項目別取引明細テーブル */
.subcategory-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.subcategory-details-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.subcategory-details-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dadce0;
    font-size: 11px;
    white-space: nowrap;
}

.subcategory-details-table th:nth-child(1) {
    width: 100px;
}

.subcategory-details-table th:nth-child(2) {
    width: 120px;
}

.subcategory-details-table th:nth-child(3) {
    width: 120px;
}

.subcategory-details-table th:nth-child(4) {
    width: 100px;
    text-align: right;
}

.subcategory-details-table th:nth-child(5) {
    width: 150px;
}

.subcategory-details-table th:nth-child(6) {
    min-width: 200px;
}

.subcategory-details-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #e0e0e0;
}

.subcategory-details-table td:nth-child(1) {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 11px;
    color: #5f6368;
}

.subcategory-details-table tbody tr:hover {
    background: #f8f9fa;
}

#subcategoryDetailsTable {
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
}

/* 円グラフのサイズ調整 */
#categoryChart {
    max-width: 300px;
    max-height: 300px;
    margin: 0 auto;
}

/* ソート可能なヘッダー */
.sortable-header {
    cursor: pointer;
    transition: background-color 0.2s;
}

.sortable-header:hover {
    background: #e8f0fe !important;
    color: #1a73e8;
}

/* ========================================
   ふるさと納税タブ
   ======================================== */

#furusato-tab {
    padding: 12px 16px;
    min-height: calc(100vh - 110px);
}

#furusato-tab .card {
    padding: 0;
    margin: 0;
}

.furusato-header {
    margin-bottom: 10px;
}

.furusato-header h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.furusato-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.furusato-controls label {
    font-weight: 500;
    font-size: 13px;
}

.furusato-controls select {
    padding: 6px 10px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 13px;
}

.furusato-controls input[type="text"] {
    padding: 6px 10px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 13px;
    min-width: 200px;
}

.furusato-summary {
    padding: 8px 12px;
    background: #e8f0fe;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 14px;
}

.furusato-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.furusato-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.furusato-table th {
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dadce0;
    font-size: 11px;
    white-space: nowrap;
}

.furusato-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #e0e0e0;
}

.furusato-table tbody tr:hover {
    background: #f8f9fa;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    margin: 0 1px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.btn-icon:hover {
    background: #e0e0e0;
}

.furusato-controls .btn {
    padding: 6px 12px;
    font-size: 13px;
}

#furusatoTableContainer {
    width: 100%;
}

/* Topix編集モーダル */
.topix-modal-content {
    max-width: 600px;
    max-height: 80vh;
}

.topix-month-info {
    padding: 12px;
    background: #e3f2fd;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    color: #1a73e8;
}

.topix-list {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.topix-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

.topix-item:hover {
    background: #f8f9fa;
}

.topix-item-text {
    flex: 1;
    font-size: 14px;
    color: #202124;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    word-wrap: break-word;
    transition: border-color 0.2s;
}

.topix-item-text:hover {
    border-color: #e0e0e0;
    background: #fafafa;
}

.topix-item-text.editing {
    border-color: #1a73e8;
    background: white;
    cursor: text;
}

.topix-item-actions {
    display: flex;
    gap: 4px;
}

.topix-delete-btn {
    background: none;
    border: none;
    color: #5f6368;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 16px;
    border-radius: 3px;
    transition: all 0.2s;
}

.topix-delete-btn:hover {
    background: #ffebee;
    color: #d32f2f;
}

.topix-add-section {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

#newTopixInput {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

#newTopixInput:focus {
    outline: none;
    border-color: #1a73e8;
}

.topix-empty-message {
    padding: 40px;
    text-align: center;
    color: #5f6368;
    font-size: 14px;
}

/* Topixセルのホバー効果 */
.memo-cell {
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}

.memo-cell:hover {
    background-color: #f0f7ff !important;
}

.memo-cell::after {
    content: '✏️';
    position: absolute;
    right: 4px;
    top: 4px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.memo-cell:hover::after {
    opacity: 0.5;
}
