body {
    font-family: 'Meiryo', sans-serif;
    background-color: #f0f4f8;
    color: #333;
    text-align: center;
    padding: 20px;
    margin: 0;
}
h2 { margin-bottom: 10px; }

/* --- タブ切り替えUI --- */
.tabs {
    display: flex;
    justify-content: center;
    margin: 20px auto 30px;
    flex-wrap: wrap;
}
.tab {
    padding: 12px 30px;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid #ccc;
    background-color: #e0e0e0;
    transition: all 0.2s;
    color: #555;
}
.tab:first-child { border-radius: 8px 0 0 8px; }
.tab:last-child { border-radius: 0 8px 8px 0; }
.tab:not(:first-child) { border-left: none; }
.tab:hover { background-color: #d5d5d5; }
.tab.active {
    background-color: #fff;
    font-weight: bold;
    color: #1976d2;
    border-bottom: 3px solid #1976d2;
    box-shadow: 0 -3px 5px rgba(0,0,0,0.05);
}
.tab-content { display: none; max-width: 1100px; margin: 0 auto; }
.tab-content.active { display: block; animation: fadeIn 0.3s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- 共通ボックス・ドロップゾーン --- */
.container {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}
.step-box {
    flex: 1;
    min-width: 340px;
    background-color: #fff;
    padding: 24px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.08);
    box-sizing: border-box;
}
.step-box.full {
    width: 100%;
    flex: none;
    margin-bottom: 24px;
    text-align: left;
}
.step-box.single {
    max-width: 660px;
    margin: 0 auto;
}
.drop-zone {
    width: 90%;
    margin: 0 auto;
    padding: 32px 12px;
    background-color: #fafafa;
    border: 3px dashed #888;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s;
    text-align: center;
}
.drop-zone.dragover { background-color: #e3f2fd; border-color: #2196f3; }
.drop-zone.success-zone { background-color: #e8f5e9; border-color: #4CAF50; }
.drop-zone.warn-zone { background-color: #fff8e1; border-color: #ff9800; }

.message {
    margin-top: 15px;
    font-size: 14px;
    font-weight: bold;
    min-height: 20px;
    white-space: pre-line;
    text-align: left;
    padding: 0 4%;
    line-height: 1.6;
}
.error { color: #d32f2f; }
.success { color: #388e3c; }
.info { color: #0277bd; }
.warning { color: #e65100; }

/* --- 月選択コントロール --- */
.month-selector-box {
    background: #e3f2fd;
    border: 2px solid #90caf9;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 0 auto 18px;
    width: 90%;
    box-sizing: border-box;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.month-selector-box label {
    font-weight: bold;
    font-size: 14px;
    color: #0d47a1;
}
.month-input, .month-select {
    padding: 8px 12px;
    font-size: 15px;
    font-weight: bold;
    border: 1px solid #1976d2;
    border-radius: 6px;
    background: #fff;
    color: #333;
}
.month-select { min-width: 240px; }

/* --- ボタン・バッジ --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    background-color: #1976d2;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}
.btn:hover { background-color: #1565c0; }
.btn-save { background-color: #2e7d32; font-size: 16px; padding: 12px 28px; }
.btn-save:hover { background-color: #1b5e20; }
.btn-secondary { background-color: #546e7a; }
.btn-secondary:hover { background-color: #37474f; }
.btn-danger { background-color: #d32f2f; padding: 5px 10px; font-size: 12px; }
.btn-danger:hover { background-color: #b71c1c; }

.download-btn {
    display: none;
    margin: 25px auto 10px;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background-color: #e91e63;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(233,30,99,0.3);
    max-width: 340px;
}
.download-btn:hover { background-color: #c2185b; }

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background-color: #9e9e9e;
    color: #fff;
    font-size: 13px;
    margin-bottom: 8px;
    font-weight: bold;
}
.status-badge.active { background-color: #4CAF50; }
.status-badge.memory { background-color: #0288d1; }
.status-badge.warn { background-color: #f57c00; }

/* --- ステータス要約バー --- */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 14px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    margin-bottom: 24px;
    text-align: left;
    flex-wrap: wrap;
    gap: 12px;
}
.status-bar-item { font-size: 13px; line-height: 1.5; }

/* --- テーブル --- */
table.map-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}
table.map-table th, table.map-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
    vertical-align: middle;
}
table.map-table th {
    background-color: #f5f7fa;
    font-weight: bold;
}
.tag-unmapped {
    display: inline-block;
    background: #ffebee;
    color: #c62828;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}
.tag-broken {
    display: inline-block;
    background: #fff3e0;
    color: #e65100;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}
.af-input {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    border: 2px solid #bbb;
    border-radius: 5px;
    box-sizing: border-box;
}
.af-input.valid { border-color: #4CAF50; background-color: #f1f8e9; }
.af-input.invalid { border-color: #d32f2f; background-color: #ffebee; }
.cd-preview {
    font-family: monospace;
    font-size: 13px;
    color: #555;
}

.dict-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.dict-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.scrollable-table {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.scrollable-table table.map-table { margin-top: 0; }
.summary-pills {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0;
}
.pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    background: #eceff1;
}
.pill.ok { background: #e8f5e9; color: #2e7d32; }
.pill.ng { background: #ffebee; color: #c62828; }