* {
    box-sizing: border-box;
}

:root {
    --ink: #2f2a24;
    --muted: #6c6258;
    --paper: #fbf7ef;
    --surface: #ffffff;
    --soft: #fff4df;
    --line: #eadfce;
    --accent: #d49335;
    --accent-dark: #a96d22;
    --green: #3e7c59;
    --red: #b54734;
    --shadow: 0 18px 44px rgba(70, 48, 24, 0.12);
    --radius: 8px;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 14% 10%, rgba(255, 233, 190, 0.85), transparent 30%),
        radial-gradient(circle at 88% 18%, rgba(211, 227, 205, 0.7), transparent 26%),
        linear-gradient(180deg, #fffaf1 0%, var(--paper) 48%, #f6efe4 100%);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    line-height: 1.75;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

a {
    color: inherit;
}

.hidden {
    display: none !important;
}

.site-header {
    background: rgba(255, 252, 246, 0.9);
    border-bottom: 1px solid rgba(234, 223, 206, 0.85);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav {
    max-width: 1120px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.brand,
.nav-link,
.eyebrow,
.primary-button,
.metrics-table,
.result-label,
.empty-kicker,
.footer {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.nav-link {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.hero {
    max-width: 1120px;
    margin: 0 auto;
    padding: 52px 20px 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    gap: 36px;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero > *,
.app-shell > * {
    min-width: 0;
}

.hero-copy {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 18px;
    font-size: clamp(2.1rem, 5vw, 4rem);
    line-height: 1.15;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.lead {
    max-width: 660px;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 1.06rem;
    overflow-wrap: anywhere;
}

.trial-note {
    display: inline-flex;
    margin: 0 0 14px;
    padding: 5px 12px;
    border: 1px solid #efd8b3;
    border-radius: 999px;
    background: #fff8ed;
    color: var(--accent-dark);
    font-size: 0.88rem;
    font-weight: 800;
}

.note {
    max-width: 620px;
    margin-bottom: 0;
    color: #7c6245;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.hero-visual {
    position: relative;
    z-index: 1;
    margin: 0;
}

.app-shell {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 20px 42px;
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: start;
}

.form-panel,
.result-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-panel,
.result-panel {
    padding: 24px;
    scroll-margin-top: 88px;
}

.section-heading h2 {
    margin-bottom: 18px;
    font-size: 1.55rem;
    line-height: 1.35;
}

.simulation-form {
    display: grid;
    gap: 16px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: var(--ink);
    font-weight: 800;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    border: 1px solid #dfd2bf;
    border-radius: var(--radius);
    background: #fffdf9;
    color: var(--ink);
    padding: 13px 14px;
    outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(212, 147, 53, 0.16);
}

.money-field {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
}

.money-field span,
.field-help {
    color: var(--muted);
    font-size: 0.9rem;
}

.primary-button {
    min-height: 54px;
    border: 0;
    border-radius: var(--radius);
    background: linear-gradient(180deg, #efaa49 0%, var(--accent) 100%);
    color: #ffffff;
    font-size: 1.04rem;
    font-weight: 900;
    box-shadow: 0 12px 26px rgba(169, 109, 34, 0.25);
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.secondary-button {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--accent-dark);
    padding: 0 18px;
    font-weight: 800;
}

.disclaimer {
    margin-top: 18px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--soft);
    color: #70532e;
    font-size: 0.9rem;
}

.disclaimer p {
    margin-bottom: 0;
}

.empty-state,
.loading-state,
.error-state {
    min-height: 360px;
    display: grid;
    place-content: center;
    text-align: center;
}

.empty-kicker,
.result-label {
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.empty-state h2,
.result-state h2 {
    margin-bottom: 10px;
    font-size: 1.65rem;
    line-height: 1.35;
}

.empty-state p:last-child,
.loading-state p {
    max-width: 420px;
    margin: 0 auto;
    color: var(--muted);
}

.loader {
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;
    border: 5px solid #f4dfbd;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-state {
    color: var(--red);
    font-weight: 700;
}

.metrics-table-wrap {
    margin: 22px 0;
    overflow-x: auto;
    border: 1px solid #efd8b3;
    border-radius: var(--radius);
    background: #fffdf9;
}

.metrics-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.metrics-table caption {
    padding: 14px 16px;
    background: #fff4df;
    color: var(--accent-dark);
    font-size: 0.86rem;
    font-weight: 900;
    text-align: left;
}

.metrics-table th,
.metrics-table td {
    padding: 13px 16px;
    border-top: 1px solid #f0e4d2;
    text-align: left;
    vertical-align: middle;
}

.metrics-table th {
    width: 150px;
    color: var(--ink);
    font-weight: 900;
    white-space: nowrap;
}

.metrics-table td:first-of-type {
    width: 210px;
    color: var(--ink);
    font-size: 1.18rem;
    font-weight: 900;
    white-space: nowrap;
}

.metrics-table td:last-of-type {
    color: var(--muted);
    font-size: 0.9rem;
}

.result-block,
.comment-box {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.result-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.result-block h3,
.comment-box h3 {
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.result-block ul {
    margin: 0;
    padding-left: 1.2em;
    color: var(--muted);
}

.comment-box {
    border-radius: var(--radius);
    border: 1px solid #dce8d7;
    background: #f6fbf2;
    padding: 16px;
}

.comment-box p {
    margin-bottom: 0;
    color: #3f624c;
}

.result-disclaimer {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.result-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-start;
}

.footer {
    padding: 30px 22px;
    background: #333333;
    color: rgba(255, 255, 255, 0.58);
    text-align: center;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 0.82rem;
}

.footer p {
    margin-bottom: 0;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

@media (max-width: 860px) {
    .hero,
    .result-columns {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 34px;
    }

    .hero-visual {
        max-width: 460px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .nav {
        align-items: flex-start;
        flex-direction: column;
    }

    .brand {
        align-items: flex-start;
    }

    .app-shell {
        padding-left: 14px;
        padding-right: 14px;
    }

    .hero {
        gap: 14px;
        padding-top: 28px;
        padding-bottom: 10px;
    }

    h1 {
        margin-bottom: 14px;
        font-size: 1.86rem;
        max-width: 8.5em;
        word-break: break-all;
    }

    .lead {
        margin-bottom: 10px;
        font-size: 0.98rem;
    }

    .trial-note {
        margin-bottom: 10px;
    }

    .lead,
    .note {
        max-width: 20em;
        word-break: break-all;
    }

    .note {
        font-size: 0.88rem;
    }

    .hero-visual {
        max-width: 68%;
    }

    .form-panel,
    .result-panel {
        padding: 18px;
    }

    .metrics-table {
        min-width: 0;
    }

    .metrics-table th,
    .metrics-table td {
        display: block;
        width: 100%;
        padding: 8px 14px;
    }

    .metrics-table th {
        padding-top: 14px;
    }

    .metrics-table td:first-of-type {
        width: 100%;
    }

    .metrics-table td:last-of-type {
        padding-bottom: 14px;
        border-top: 0;
    }

    .metrics-table tr {
        display: block;
        border-top: 1px solid #f0e4d2;
    }

    .metrics-table tr:first-child {
        border-top: 0;
    }

}
