:root {
    --primary-color: #01894d;
    /* Brand Green */
    --primary-hover: #00703e;
    --brand-green: #01894d;
    --brand-orange: #f39800;
    --bg-color: #f8fafb;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-sub: #666666;
    --border-color: #e5e7eb;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --font-family: 'Noto Sans JP', 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    padding-bottom: 40px;
}

.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header Design (Brand Style) */
.main-header {
    background-color: var(--brand-green);
    border-bottom: 2px solid var(--brand-orange);
    padding: 15px 0;
    color: #ffffff;
}

.main-header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.title-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    margin-right: 10px;
}

.brand-logo {
    font-weight: 800;
    font-size: 1.3rem;
    color: #ffffff;
}

.site-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.btn-home,
.btn-print {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-home:hover,
.btn-print:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: #fff;
}

.main-header-inner nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 32px;
    margin-bottom: 24px;
}

section {
    /* Deprecated: using .card instead */
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 32px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: #111;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-number {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    background-color: var(--brand-green);
    color: #fff;
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 24px;
}

/* Input Styles */
.input-group {
    margin-bottom: 20px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 600px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

label {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

input[type="number"],
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background: #f9fafb;
    transition: all 0.2s;
    font-family: inherit;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(1, 137, 77, 0.1);
}

.calculate-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--brand-orange);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #c27a00;
    margin-top: 20px;
}

.calculate-btn:hover {
    background-color: #e68a00;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c27a00;
}

.calculate-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.help-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    background-color: #9ca3af;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-left: 6px;
    cursor: pointer;
    vertical-align: middle;
}

.help-btn:hover {
    background-color: var(--brand-green);
}

.help-text {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-top: 6px;
}

/* Result Card UI */
.result-card {
    background: #f8fafc;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    text-align: center;
    margin-bottom: 16px;
}

.result-card.year-1.highlight {
    background: linear-gradient(to bottom right, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
}

/* Info Section (Collapsible) */
.info-section {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.info-header {
    padding: 15px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background-color: #f8fafb;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.info-header:hover {
    background-color: #f1f3f5;
}

.info-header h2 {
    font-size: 1.1rem;
    color: var(--brand-green);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: none;
    /* Reset H2 border */
}

.toggle-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
    fill: #666;
}

.info-content {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: block;
}

.info-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 16px;
}

.usage-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.usage-step {
    background-color: #f8fafb;
    padding: 15px;
    border-radius: 6px;
    position: relative;
    padding-left: 45px;
}

.usage-step::before {
    content: attr(data-step);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background-color: var(--brand-green);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Collapsed state */
.info-section.collapsed .info-content {
    display: none;
}

.info-section.collapsed .toggle-icon {
    transform: rotate(-180deg);
}

.result-card .value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--brand-green);
}

.result-card .value.small {
    font-size: 1.8rem;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-card .value {
        font-size: 2rem;
    }

    .result-card .value.small {
        font-size: 1.5rem;
    }

    /* Mobile Header Adjustments */
    .main-header-inner {
        padding: 0 12px;
    }

    .logo-area {
        gap: 8px;
    }

    .title-icon {
        width: 20px;
        height: 20px;
        margin-right: 0;
    }

    .brand-logo {
        font-size: 1rem;
        white-space: nowrap;
    }

    .btn-home,
    .btn-print {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .main-header-inner nav {
        gap: 6px;
    }
}

.benefit-breakdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.selling {
    background-color: var(--brand-orange);
}

.dot.saving {
    background-color: var(--brand-green);
}

.highlight-payback {
    background: #fffdf5 !important;
    border-color: #fef08a !important;
}

.highlight-payback .value {
    color: #b45309 !important;
}

.status-positive {
    color: #166534;
    font-weight: 700;
}

.status-negative {
    color: #991b1b;
    font-weight: 700;
}

/* Modal Style */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    position: relative;
    line-height: 1.6;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: black;
}

#modal-title {
    font-size: 1.2rem;
    color: var(--brand-green);
    margin-bottom: 12px;
    border-bottom: 2px solid var(--brand-orange);
    padding-bottom: 5px;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 10px;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 650px;
    background-color: #fff;
}

.result-table th,
.result-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

.result-table th:first-child,
.result-table td:first-child {
    text-align: left;
}

.result-table th {
    background-color: #f1f5f9;
    color: var(--text-main);
    font-weight: 700;
}

.result-table tr:nth-child(even) {
    background-color: #f8fafc;
}

.result-table tr:hover {
    background-color: #f1fbf6;
}