:root {
    --brand-green: #01894d;
    --brand-orange: #f39800;
    --bg-color: #f8fafb;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-sub: #666666;
    --border-color: #e5e7eb;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --font-family: 'Inter', 'Noto Sans JP', 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);
    line-height: 1.5;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Header */
.main-header {
    background-color: var(--brand-green);
    border-bottom: 2px solid var(--brand-orange);
    padding: 15px 0;
    color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
}

.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;
}

.title-icon {
    width: 24px;
    height: 24px;
    color: #ffffff;
}

nav {
    display: flex;
    gap: 10px;
}

.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;
}

.btn-home:hover,
.btn-print:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: #fff;
}

/* Card Style */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    border: 1px solid var(--border-color);
}

.form-title {
    font-size: 1.25rem;
    color: var(--text-main);
    padding-bottom: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-number {
    background-color: var(--brand-green);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-sub);
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

/* 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;
}

.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);
}

.info-section.collapsed .info-content {
    display: none;
}

.info-section.collapsed .toggle-icon {
    transform: rotate(-180deg);
}

.usage-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 16px;
}

.usage-step {
    flex: 1;
    min-width: 250px;
    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;
}

/* Form */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

input[type="number"] {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background-color: #f8fafb;
    width: 100%;
}

input:focus {
    outline: none;
    border-color: var(--brand-green);
    background-color: #fff;
}

.help-btn {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #cbd5e1;
    color: white;
    border: none;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-btn:hover {
    background-color: var(--brand-green);
}

.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;
}

.calculate-btn:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #c27a00;
}

/* Result Area */
.result-display {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: right;
}

th {
    background-color: #f8fafb;
    padding: 12px 16px;
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
    text-align: right;
}

th:first-child {
    text-align: left;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

td:first-child {
    text-align: left;
}

/* Diagram */
.diagram-section h3 {
    font-size: 1rem;
    color: var(--brand-green);
    margin-bottom: 16px;
    border-left: 4px solid var(--brand-orange);
    padding-left: 10px;
}

.svg-wrapper {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    overflow-x: auto;
    display: flex;
    justify-content: center;
}

.legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-item.summer {
    color: red;
}

.legend-item.equinox {
    color: orange;
}

.legend-item.winter {
    color: blue;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 24px;
    border-radius: var(--radius);
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-sub);
}

.hidden {
    display: none !important;
}

@media (max-width: 640px) {
    .container {
        padding: 16px;
    }

    .card {
        padding: 16px;
    }
}

@media print {

    .main-header,
    .btn-print,
    .calculate-btn,
    .info-section,
    .card-subtitle {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        border: none;
        box-shadow: none;
        padding: 0;
    }

    #result-area {
        display: block !important;
    }
}