body {
    background: #1a1a2e;
    font-family: 'Zen Maru Gothic', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 10px;
    color: #fff;
    min-height: 100vh;
    overscroll-behavior: none;
}

.back-btn {
    align-self: flex-start;
    text-decoration: none;
    color: #ccc;
    background: #16213e;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 5px;
    border: 1px solid #0f3460;
}

.tool-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

h1 {
    margin: 0;
    color: #4ecca3;
    font-size: 1.25rem;
}

/* タブメニュー（スクロール対応） */
.tab-menu {
    width: 100%;
    display: flex;
    gap: 4px;
    background: #16213e;
    padding: 6px;
    border-radius: 14px;
    border: 2px solid #0f3460;
    overflow-x: auto;
    box-sizing: border-box;
}

.tab-btn {
    flex: 0 0 auto;
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: bold;
    font-family: inherit;
    background: transparent;
    color: #aaa;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn.active {
    background: #4ecca3;
    color: #1a1a2e;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 計算パネル */
.calc-panel {
    width: 100%;
    background: #16213e;
    border-radius: 15px;
    padding: 18px;
    box-sizing: border-box;
    border: 2px solid #0f3460;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calc-panel h2 {
    margin: 0 0 4px 0;
    font-size: 1rem;
    color: #fff;
    border-bottom: 1px solid #0f3460;
    padding-bottom: 6px;
}

.hidden {
    display: none !important;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-size: 0.8rem;
    color: #aaa;
    font-weight: bold;
}

.input-with-btn {
    display: flex;
    gap: 6px;
}

.input-with-btn input {
    flex: 1;
}

input[type="date"], input[type="number"], select {
    width: 100%;
    padding: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: #0f3460;
    color: #fff;
    border: 1px solid #1a1a2e;
    border-radius: 10px;
    box-sizing: border-box;
}

input:focus, select:focus {
    outline: none;
    border-color: #4ecca3;
}

.today-btn {
    padding: 0 12px;
    background: #0f3460;
    color: #4ecca3;
    border: 1px solid #1a1a2e;
    border-radius: 10px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    font-size: 0.85rem;
}

.today-btn:active {
    background: #4ecca3;
    color: #1a1a2e;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.action-btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    font-family: inherit;
    background: #4ecca3;
    color: #1a1a2e;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    margin-top: 4px;
}

.action-btn:active {
    transform: scale(0.98);
}

/* 結果表示ボックス */
.result-box {
    background: #0f3460;
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border: 1px solid #1a1a2e;
}

.result-label {
    font-size: 0.75rem;
    color: #aaa;
}

.result-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #4ecca3;
    text-align: center;
}

.result-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    padding: 3px 0;
}

.result-row strong {
    color: #4ecca3;
}

.copy-btn {
    background: transparent;
    color: #aaa;
    border: 1px dashed #0f3460;
    padding: 8px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    color: #fff;
    border-color: #4ecca3;
}

/* 履歴セクション */
.history-box {
    width: 100%;
    background: #16213e;
    border-radius: 15px;
    padding: 15px;
    box-sizing: border-box;
    border: 2px solid #0f3460;
}

.history-box h3 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #aaa;
}

#history-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 120px;
    overflow-y: auto;
}

#history-list li {
    background: #0f3460;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #ddd;
    border-left: 3px solid #4ecca3;
}

.empty-history {
    color: #777;
    text-align: center;
    border-left: none !important;
}

/* SEO用テキストボックス */
.seo-text-box {
    margin-top: 10px;
    background-color: #16213e;
    padding: 15px 20px;
    border-radius: 15px;
    border: 1px solid #0f3460;
    max-width: 440px;
    width: 100%;
    box-sizing: border-box;
    color: #aaa;
    font-size: 0.85rem;
    line-height: 1.6;
}
.seo-text-box h2 {
    font-size: 1rem;
    color: #fff;
    margin-top: 0;
    margin-bottom: 8px;
    border-bottom: 1px solid #0f3460;
    padding-bottom: 4px;
}
