:root {
    --primary-color: #e17055;
    --primary-hover: #d63031;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #2d3436;
    --text-muted: #636e72;
    --border-color: #dfe6e9;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
    line-height: 1.6;
}

.app-container {
    width: 100%;
    max-width: 900px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-weight: 600;
    font-size: 2.2rem;
    color: var(--text-main);
    margin-bottom: 5px;
}

p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 12px 24px;
    font-size: 1.05rem;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
    padding-top: 20px;
}

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

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

/* Layout for Main Tab */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

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

.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

h2 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.input-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

input, select {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus, select:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(225, 112, 85, 0.1);
}

.btn {
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.primary-btn {
    background: var(--primary-color);
    color: #fff;
    width: 100%;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(225, 112, 85, 0.3);
}

.secondary-btn {
    background: var(--bg-color);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.secondary-btn:hover {
    background: #e9ecef;
    border-color: #cbd3d9;
}

.list-container ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item, .calc-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.calc-list-item {
    border-left: 4px solid var(--primary-color);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-name {
    font-weight: 600;
    font-size: 1.05rem;
}

.item-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.delete-btn {
    background: transparent;
    color: #ff7675;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
}

.delete-btn:hover {
    background: rgba(255, 118, 117, 0.1);
    transform: scale(1.1);
}

/* Calculator specific */
.multiplier-control {
    text-align: center;
    padding: 10px 0;
}

.multiplier-control label {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--text-muted);
}

#multiplier-value {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.8rem;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    margin-bottom: 24px;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary-color);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 8px;
    cursor: pointer;
    background: var(--border-color);
    border-radius: 4px;
}

.preset-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.summary-card {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 24px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-sub-value {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.calc-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}
