: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);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
    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;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    padding: 32px;
}

/* 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;
}

.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;
    /* Reset default h1 margins */
}

.title-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    margin-right: 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;
}

.info-section {
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0;
    /* Padding will be on header and content */
    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;
}

.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;
}

/* Usage Steps internal layout */
.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(250px, 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);
}

.info-section.collapsed .info-header {
    border-bottom-color: transparent;
}

.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;
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: #111;
    text-align: center;
}

p.subtitle {
    font-size: 1rem;
    color: var(--text-sub);
    text-align: center;
    margin-bottom: 2rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    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;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
}

.helper-text {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-top: 6px;
}

button.calculate-btn {
    width: 100%;
    padding: 16px;
    background-color: var(--brand-orange);
    color: white;
    border: none;
    border-radius: 30px;
    /* Rounded button */
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 0 #c27a00;
    margin-top: 10px;
}

button.calculate-btn:hover {
    background-color: #e68a00;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c27a00;
}

/* Results Area */
.result-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.summary-card {
    background: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.summary-card h3 {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 8px;
    font-weight: 600;
}

.summary-card .value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2937;
}

.chart-container {
    width: 100%;
    height: 300px;
    margin-bottom: 32px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 600px;
}

th {
    background: #f3f4f6;
    color: var(--text-sub);
    font-weight: 600;
    text-align: right;
    padding: 12px 16px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

th:first-child {
    text-align: left;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
    color: var(--text-main);
}

td:first-child {
    text-align: left;
}

tr:last-child td {
    border-bottom: none;
}

/* Radio Button Group (Simple Tabs) */
.radio-group {
    display: flex;
    gap: 4px;
    background: #e5e7eb;
    padding: 4px;
    border-radius: 6px;
    display: inline-flex;
}

.radio-group input[type="radio"] {
    display: none;
}

.radio-group label {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 500;
    color: var(--text-sub);
    transition: all 0.2s;
    background: transparent;
    border: none;
}

.radio-group input[type="radio"]:checked+label {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.input-section-title {
    color: #111;
    font-weight: 700;
    margin-bottom: 20px;
    margin-top: 24px;
    padding-left: 12px;
    border-left: 6px solid var(--brand-green);
}

/* Mobile Responsive adjustment for navigation */
@media (max-width: 768px) {
    .top-bar {
        display: none;
    }

    .nav-item {
        font-size: 0.8rem;
    }

    .nav-item a {
        padding: 12px 5px;
    }

    .brand-logo {
        font-size: 1.1rem;
    }

    .site-title {
        font-size: 1rem;
    }

    .card {
        padding: 20px;
    }
}

@media (max-width: 600px) {

    /* 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;
    }
}

/* Help Icon */
.help-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    background-color: #9ca3af;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-left: 6px;
    cursor: pointer;
    vertical-align: middle;
}

.help-icon:hover {
    background-color: var(--primary-color);
}

/* Modal */
.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: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    line-height: 1.6;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: black;
}