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

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    background-color: #fffde7; /* 初期設定の薄い黄色 */
    color: #333333;
    line-height: 1.4;
    padding: 10px;
    transition: background-color 0.3s ease;
}

/* レスポンシブコンテナ：スマホ横向きおよびPCで画面いっぱいに */
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: #ffffff;
    padding: 15px;
    border-radius: 18px; /* 丸みを帯びたデザイン */
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* スマホ横向き時の両端フィット */
@media (max-width: 900px) and (orientation: landscape) {
    body {
        padding: 0;
    }
    .container {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }
}

/* タイトルエリア */
header {
    margin-bottom: 15px;
    text-align: center;
}

h1 {
    font-size: 1.5rem;
    color: #e91e63; /* カラフル色 */
    margin-bottom: 10px;
}

.main-title-input {
    width: 100%;
    font-size: 1.3rem;
    font-weight: bold;
    padding: 8px;
    border: 2px solid #ffb74d;
    border-radius: 10px;
    text-align: center;
    background-color: #fff9c4;
}

/* テーブルデザイン（上下のスペース幅は狭く） */
.profit-table {
    display: flex;
    flex-direction: column;
    gap: 4px; /* 月と月の間の上下スペースを狭く */
    margin-bottom: 15px;
}

.table-header, .table-row, .table-footer {
    display: grid;
    grid-template-columns: 2fr 5fr 5fr;
    align-items: center;
    gap: 6px;
}

.table-header {
    background-color: #00bcd4; /* カラフル色 */
    color: white;
    padding: 6px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
}

.header-input {
    width: 100%;
    background: transparent;
    border: 1px dashed white;
    color: white;
    text-align: center;
    font-weight: bold;
    padding: 4px;
    border-radius: 6px;
}

.table-row {
    background: #f9f9f9;
    padding: 4px 6px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.month-label {
    font-weight: bold;
    text-align: center;
    font-size: 0.95rem;
}

/* 入力欄と符号反転ボタンのグループ */
.input-group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.amount-input {
    width: 100%;
    padding: 6px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    text-align: right;
}

.toggle-sign-btn {
    padding: 6px 4px;
    font-size: 0.8rem;
    background-color: #e0e0e0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

/* 合計金額欄 */
.table-footer {
    background-color: #ff5722; /* カラフル色 */
    color: white;
    padding: 8px 6px;
    border-radius: 8px;
    font-weight: bold;
}

.total-label {
    text-align: center;
}

.total-value {
    text-align: right;
    padding-right: 25px; /* ボタン分の余白調整 */
    font-size: 1.1rem;
}

/* カラーコントロールパネル */
.control-panel {
    background: #f3e5f5;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 15px;
    border: 2px solid #ab47bc;
}

.control-panel h2 {
    font-size: 1.1rem;
    color: #4a148c;
    margin-bottom: 8px;
    text-align: center;
}

.color-picker-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.85rem;
}

.color-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.color-label {
    min-width: 110px;
    font-weight: bold;
}

.palette-box {
    display: flex;
    gap: 3px;
}

.color-btn, .bg-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #666;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.6rem;
    text-align: center;
    padding: 0;
}

.color-btn.black { background: #000000; }
.color-btn.red { background: #ff0000; }
.color-btn.blue { background: #0000ff; }
.color-btn.green { background: #008000; }
.color-btn.orange { background: #ffa500; }

.bg-btn.black { background: #333333; color: white; }
.bg-btn.lightred { background: #ffebee; }
.bg-btn.lightblue { background: #e3f2fd; }
.bg-btn.lightgreen { background: #e8f5e9; }
.bg-btn.lightorange { background: #fff3e0; }

.custom-picker {
    width: 30px;
    height: 24px;
    border: none;
    cursor: pointer;
    background: transparent;
}

/* 操作・シェアボタン */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: center;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.btn:hover { opacity: 0.9; }
.btn-danger { background-color: #d32f2f; }
.btn-success { background-color: #2e7d32; }

.share-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #e8eaf6;
    border-radius: 12px;
}

.share-btn {
    padding: 8px 12px;
    border-radius: 6px;
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
}

.share-x { background-color: #000000; }
.share-line { background-color: #06c755; }
.share-insta { background-color: #e1306c; }
.share-email { background-color: #78909c; }

/* SEOコンテンツ・下部リンク */
.seo-content {
    background: #fafafa;
    padding: 15px;
    border-radius: 12px;
    margin-top: 20px;
    border-top: 4px solid #4caf50;
}

.seo-content h2 {
    font-size: 1.2rem;
    color: #2e7d32;
    margin-top: 15px;
    margin-bottom: 5px;
}

.seo-content h3 {
    font-size: 1rem;
    color: #1b5e20;
    margin-top: 10px;
    margin-bottom: 5px;
}

.seo-content p {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 10px;
    text-align: justify;
}

.footer-links {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    text-align: center;
    font-size: 0.9rem;
}

.footer-links a {
    color: #0000ff; /* リンクの色は青色 */
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
}
