:root {
    --bg: var(--form-bg, #f4ecdf);
    --bg-strong: var(--form-bg-strong, #e2d2bd);
    --paper: var(--form-paper, #fffdf9);
    --ink: var(--form-ink, #201813);
    --muted: var(--form-muted, #6e6258);
    --line: rgba(32, 24, 19, 0.12);
    --brand: var(--form-brand, #8c5c31);
    --brand-dark: var(--form-brand-dark, #5f3c1f);
    --accent: var(--form-accent, #f0e3d1);
    --error: #a03d2f;
    --success: #2f6f4f;
    --shadow: 0 22px 60px rgba(49, 34, 18, 0.14);
    --hint-bg: var(--accent);
    --hint-border: var(--brand);
    --option-bg: var(--accent);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    background: var(--bg);
    min-height: 100vh;
}

body.embed-mode {
    background: transparent;
    min-height: auto;
}

.embed-shell {
    width: 100%;
    margin: 0;
    padding: 0;
}

.page-shell {
    width: min(1180px, calc(100% - 24px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

/* ---- ヘッダー画像 ---- */
.page-hero {
    padding: 0;
    border-radius: 24px;
    background: var(--paper);
    border: 1px solid rgba(140, 92, 49, 0.12);
    box-shadow: var(--shadow);
    backdrop-filter: none;
    overflow: hidden;
}

.hero-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.hero-image-wrap {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    background: var(--paper);
}

.page-hero-text {
    padding: 24px 32px 28px;
    background: var(--paper);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(140, 92, 49, 0.1);
    color: var(--brand-dark);
    font-size: 0.84rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1 {
    margin: 16px 0 12px;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.08;
    letter-spacing: 0.04em;
}

.lead {
    margin: 0;
    max-width: 54rem;
    color: var(--muted);
    line-height: 1.9;
}

.form-card {
    margin-top: 22px;
    padding: 28px;
    border-radius: 30px;
    background: var(--paper);
    box-shadow: var(--shadow);
    border: 1px solid rgba(140, 92, 49, 0.12);
}

.entry-app {
    display: grid;
    gap: 22px;
}

.entry-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.entry-title {
    margin: 0;
    font-size: 1.4rem;
}

.entry-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.entry-step {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--brand-dark);
    font-weight: 700;
}

.entry-hint {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--hint-bg);
    border: 1px solid var(--hint-border);
    color: var(--brand-dark);
    line-height: 1.7;
}

.error-summary {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(160, 61, 47, 0.08);
    border: 1px solid rgba(160, 61, 47, 0.18);
    color: var(--error);
    line-height: 1.75;
}

.error-summary strong {
    display: block;
    margin-bottom: 8px;
}

.error-summary ul {
    margin: 0;
    padding-left: 1.25rem;
}

.error-summary li {
    margin: 4px 0;
}

.error-summary a {
    color: var(--error);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.entry-grid .full {
    grid-column: 1 / -1;
}

.section-head {
    margin-top: 16px;
}

.section-head-title {
    margin: 0 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #000000;
    font-size: 1.05rem;
    line-height: 1.4;
}

.field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.field .badge {
    margin-left: 8px;
    font-size: 0.78rem;
    padding: 3px 8px;
    border-radius: 999px;
    display: inline-block;
    line-height: 1.2;
}

.field .badge-required {
    background: #d63638 !important;
    color: #ffffff !important;
}

.field .badge-optional {
    background: #e5e7eb !important;
    color: #000000 !important;
}

.field-error {
    min-height: 1.2em;
    margin-top: 6px;
    color: var(--error);
    font-size: 0.88rem;
    line-height: 1.5;
}

.is-missing input,
.is-missing select,
.is-missing textarea {
    border-color: rgba(160, 61, 47, 0.75);
    background: rgba(255, 246, 244, 0.96);
}

.is-missing .option-card {
    border-color: rgba(160, 61, 47, 0.6);
    background: rgba(255, 246, 244, 0.9);
}

.is-missing .field-error {
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(32, 24, 19, 0.18);
    border-radius: 16px;
    padding: 14px 16px;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.8;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(140, 92, 49, 0.7);
    box-shadow: 0 0 0 4px rgba(140, 92, 49, 0.12);
}

.help-text,
.error-text,
.success-text {
    margin-top: 8px;
    font-size: 0.92rem;
    line-height: 1.65;
}

.help-text {
    color: var(--muted);
}

.error-text {
    color: var(--error);
}

.success-text {
    color: var(--success);
}

.option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.option-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(32, 24, 19, 0.14);
    background: var(--option-bg);
}

.option-card input {
    width: auto;
    margin: 0;
    accent-color: var(--brand);
}

.actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.actions.actions-center {
    justify-content: center;
}

.actions .note {
    color: var(--muted);
    line-height: 1.7;
}

.button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    padding: 15px 24px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    box-shadow: 0 14px 24px rgba(140, 92, 49, 0.24);
}

.button.secondary {
    background: #efe6da;
    color: var(--brand-dark);
    box-shadow: none;
    border: 1px solid rgba(140, 92, 49, 0.16);
}

.summary {
    display: grid;
    gap: 12px;
    padding: 20px;
    border-radius: 18px;
    background: rgba(255,255,255,0.62);
    border: 1px solid var(--line);
}

.summary-item {
    display: grid;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px dashed rgba(32, 24, 19, 0.12);
}

.summary-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.summary-label {
    color: var(--muted);
    font-size: 0.88rem;
}

.summary-value {
    font-weight: 700;
    line-height: 1.7;
}

.hidden {
    display: none !important;
}

.page-organizer-footer {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #a50409;
    color: #ffffff;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.7;
}

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 14px, 1180px);
        padding-top: 14px;
    }

    .page-hero,
    .form-card {
        padding: 18px;
        border-radius: 24px;
    }

    .entry-grid,
    .actions {
        grid-template-columns: 1fr;
    }

    .actions {
        display: grid;
    }

    .button {
        width: 100%;
    }
}
