:root {
    --ink: #24313f;
    --muted: #667085;
    --line: #e8dfd2;
    --paper: #fffaf2;
    --card: #ffffff;
    --accent: #d97706;
    --accent-dark: #92400e;
    --accent-soft: #fff4dc;
    --accent-strong: #b45309;
    --green: #166534;
    --shadow: 0 18px 50px rgba(120, 72, 16, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(255, 244, 220, 0.75), rgba(255, 255, 255, 0) 360px),
        var(--paper);
    font-family: "Hiragino Sans", "Yu Gothic", "Meiryo", system-ui, sans-serif;
    line-height: 1.75;
    overflow-x: hidden;
}

a {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

p,
h2,
h3,
a,
.notice,
.mini-note {
    overflow-wrap: anywhere;
}

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 250, 242, 0.94);
    border-bottom: 1px solid rgba(232, 223, 210, 0.9);
    backdrop-filter: blur(14px);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 900;
    letter-spacing: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.nav-toggle {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
}

.nav-toggle span {
    width: 20px;
    height: 2px;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-nav {
    display: none;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px 16px;
}

.site-nav.open {
    display: grid;
}

.site-nav a {
    padding: 12px 0;
    border-top: 1px solid var(--line);
    color: var(--ink);
}

main {
    max-width: 860px;
    margin: 0 auto;
    padding: 28px 20px 56px;
}

.hero {
    padding: 68px 0 36px;
}

.eyebrow {
    display: inline-flex;
    margin: 0 0 14px;
    padding: 4px 12px;
    border: 1px solid #f2c57c;
    border-radius: 999px;
    color: var(--accent-dark);
    background: #fff8e8;
    font-size: 0.86rem;
    font-weight: 800;
}

.hero h1 {
    margin: 0;
    font-size: clamp(2.25rem, 6vw, 4.05rem);
    line-height: 1.08;
    letter-spacing: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.hero h1 span {
    display: inline;
}

.hero-accent {
    position: relative;
    margin-left: 0.12em;
    color: var(--accent-strong);
    white-space: nowrap;
}

.hero-accent::after {
    content: "";
    position: absolute;
    left: 0.03em;
    right: 0.03em;
    bottom: 0.03em;
    z-index: -1;
    height: 0.28em;
    border-radius: 999px;
    background: linear-gradient(90deg, #facc15, #fb923c);
}

.lead {
    max-width: 720px;
    margin: 22px 0 0;
    color: #475467;
    font-size: clamp(1rem, 2.2vw, 1.24rem);
}

.notice,
.mini-note,
.disclaimer-box {
    border: 1px solid #f2c57c;
    background: #fff8e8;
    color: #7a4b00;
}

.notice {
    max-width: 720px;
    margin: 24px 0 0;
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 700;
    overflow-wrap: normal;
}

.tool-layout {
    display: grid;
    gap: 22px;
    align-items: start;
    margin-top: 32px;
}

.calculator,
.result-card,
.related-links,
.disclaimer-box,
.legal-page,
.article-page {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.calculator,
.result-card,
.related-links,
.disclaimer-box,
.legal-page,
.article-page {
    padding: clamp(20px, 4vw, 34px);
}

.form-header h2,
.result-card h2,
.related-links h2,
.disclaimer-box h2,
.legal-page h1,
.article-page h1 {
    margin: 0 0 10px;
    font-size: clamp(1.45rem, 3vw, 2.1rem);
    line-height: 1.25;
}

.form-header p,
.result-empty,
.hint,
.mini-note {
    color: var(--muted);
}

.field {
    margin-top: 22px;
}

.field-grid {
    display: grid;
    gap: 18px;
}

label,
legend {
    display: block;
    margin-bottom: 8px;
    font-weight: 900;
}

input,
select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #d6cabb;
    border-radius: 8px;
    background: #fffdfa;
    color: var(--ink);
    padding: 10px 12px;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(217, 119, 6, 0.35);
    outline-offset: 2px;
}

input[aria-invalid="true"] {
    border-color: #b42318;
    background: #fff6f5;
}

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

.input-unit span {
    min-width: 28px;
    color: var(--muted);
    font-weight: 800;
}

.hint {
    margin: 8px 0 0;
    font-size: 0.88rem;
}

.error-message {
    min-height: 1.5em;
    margin: 6px 0 0;
    color: #b42318;
    font-size: 0.9rem;
    font-weight: 700;
}

.display-field {
    border: 0;
    padding: 0;
}

.display-field label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 14px 8px 0;
    font-weight: 700;
}

.display-field input {
    width: auto;
    min-height: auto;
}

.primary-button,
.share-action {
    min-height: 48px;
    border-radius: 8px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    font-weight: 900;
    cursor: pointer;
    text-align: center;
}

.primary-button {
    width: 100%;
    margin-top: 24px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 24px rgba(217, 119, 6, 0.24);
}

.primary-button:hover,
.share-action:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.result-card {
    position: static;
}

.result-kicker {
    margin: 0 0 8px;
    color: var(--green);
    font-weight: 900;
}

.total-box {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.total-box p {
    margin: 0;
    padding: 14px;
    border-radius: 8px;
    background: #f7fbf4;
    border: 1px solid #d7ead0;
}

.total-box span {
    display: block;
    color: #4b6b45;
    font-size: 0.9rem;
    font-weight: 800;
}

.total-box strong {
    display: block;
    font-size: clamp(1.7rem, 6vw, 2.5rem);
    line-height: 1.2;
}

.burden-comment {
    padding: 14px;
    border-left: 4px solid var(--accent);
    background: #fffaf1;
    font-weight: 800;
}

.breakdown {
    display: grid;
    gap: 8px;
    margin: 20px 0;
}

.breakdown div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.breakdown dt {
    color: var(--muted);
    font-weight: 800;
}

.breakdown dd {
    margin: 0;
    font-weight: 900;
}

.mini-note {
    padding: 10px 12px;
    border-radius: 8px;
    color: #7a4b00;
    font-size: 0.9rem;
}

.share-panel {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    background:
        linear-gradient(135deg, #fff7ed, #ffffff 58%),
        #ffffff;
}

.share-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.share-heading p {
    margin: 0;
    color: var(--accent-dark);
    font-size: 1.02rem;
    font-weight: 900;
}

.share-heading span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.share-box {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.share-action {
    flex: 1 1 128px;
    background: #fff;
    color: var(--ink);
    border-color: #f4c27d;
    box-shadow: 0 8px 18px rgba(120, 72, 16, 0.1);
}

.share-action-primary {
    flex-basis: 100%;
    background: linear-gradient(135deg, var(--accent), #ea580c);
    color: #fff;
    border-color: #c2410c;
    box-shadow: 0 12px 26px rgba(217, 119, 6, 0.28);
}

.share-action-line {
    background: #ecfdf3;
    color: #14532d;
    border-color: #86efac;
}

.share-action-mail {
    background: #f8fafc;
    color: #334155;
    border-color: #cbd5e1;
}

.copy-status {
    min-height: 1.4em;
    color: var(--green);
    font-weight: 800;
}

.related-links,
.disclaimer-box,
.legal-page,
.article-page {
    margin-top: 24px;
}

.disclaimer-box {
    background: #fff7ed;
    border-color: #fdba74;
    color: #7c2d12;
}

.disclaimer-box h2 {
    color: #9a3412;
}

.disclaimer-box p {
    color: #7c2d12;
    font-weight: 700;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.article-grid {
    display: grid;
    gap: 12px;
}

.article-grid a {
    display: block;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdfa;
    color: var(--ink);
}

.site-footer {
    padding: 30px 20px 42px;
    text-align: center;
    color: var(--muted);
    background: #fffaf2;
    border-top: 1px solid var(--line);
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 18px;
    margin-bottom: 10px;
}

.legal-page,
.article-page {
    max-width: 840px;
    margin-left: auto;
    margin-right: auto;
}

.legal-page h2,
.article-page h2 {
    margin-top: 34px;
    color: var(--accent-dark);
    font-size: 1.35rem;
}

.legal-page ul,
.article-page ul {
    padding-left: 1.35rem;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.info-table th,
.info-table td {
    padding: 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.info-table th {
    width: 32%;
    background: #fff8e8;
    color: var(--accent-dark);
}

.breadcrumb {
    max-width: 840px;
    margin: 0 auto 16px;
    color: var(--muted);
    font-size: 0.92rem;
}

.article-list {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.article-list a {
    display: block;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fffdfa;
}

.article-meta {
    margin: 0 0 12px;
    color: var(--green);
    font-weight: 900;
}

@media (min-width: 760px) {
    .nav-toggle {
        display: none;
    }

    .site-nav {
        display: flex;
        justify-content: flex-end;
        gap: 22px;
        padding: 0 20px 14px;
    }

    .site-nav a {
        padding: 0;
        border-top: 0;
    }

    .field-grid {
        grid-template-columns: 1fr 1fr;
    }

    .article-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero h1 {
        white-space: nowrap;
        font-size: clamp(2.65rem, 5.4vw, 3.8rem);
    }

    .share-action-primary {
        flex-basis: 180px;
    }
}

@media (max-width: 520px) {
    main {
        padding-inline: 14px;
    }

    .brand span {
        font-size: 0.92rem;
    }

    .hero {
        padding-top: 44px;
    }

    .hero h1 {
        font-size: 2.25rem;
        line-height: 1.18;
    }

    .hero h1 span {
        display: block;
    }

    .hero-accent {
        margin-left: 0;
    }

    .lead {
        font-size: 0.98rem;
        max-width: 22em;
    }

    .notice {
        font-size: 0.94rem;
    }

    .calculator,
    .result-card,
    .related-links,
    .disclaimer-box,
    .legal-page,
    .article-page {
        padding: 18px;
    }

    .breakdown div {
        display: grid;
        gap: 2px;
    }

    .share-heading {
        display: block;
    }

    .share-heading span {
        display: block;
        margin-top: 2px;
    }

    .info-table th,
    .info-table td {
        display: block;
        width: 100%;
    }
}
