:root {
    --background: #f2efe8;
    --panel: #fffdf8;
    --ink: #1f2a24;
    --muted: #6f766d;
    --line: #ddd5c8;
    --accent: #0f766e;
    --accent-strong: #0b4f4a;
    --error: #b42318;
    --success: #137333;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--ink);
    font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    background:
        radial-gradient(circle at 15% 15%, rgba(15, 118, 110, 0.18), transparent 30%),
        linear-gradient(135deg, #f7f4ec 0%, var(--background) 50%, #e6efe9 100%);
}

.shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.panel {
    width: min(760px, 100%);
    padding: clamp(24px, 5vw, 44px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: 0 24px 70px rgba(31, 42, 36, 0.12);
}

.heading {
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 7vw, 4rem);
    line-height: 1;
}

.form,
.actions {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    background: #fff;
}

input[type="color"] {
    min-height: 52px;
    padding: 6px;
}

input:focus {
    outline: 3px solid rgba(15, 118, 110, 0.2);
    border-color: var(--accent);
}

textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    line-height: 1.6;
    resize: vertical;
    background: #fff;
}

textarea:focus {
    outline: 3px solid rgba(15, 118, 110, 0.2);
    border-color: var(--accent);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.primary {
    color: #fff;
    background: var(--button-color, var(--accent));
}

.primary:hover {
    filter: brightness(0.9);
}

.secondary {
    color: var(--ink);
    border-color: var(--line);
    background: #fff;
}

.danger {
    color: #fff;
    background: var(--error);
}

.small {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.9rem;
}

.muted {
    margin: 0;
    color: var(--muted);
}

.notice {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 6px;
    font-weight: 700;
}

.notice.error {
    color: var(--error);
    background: #fff1f0;
}

.notice.success {
    color: var(--success);
    background: #edf7ed;
}

.summary {
    display: grid;
    gap: 12px;
    margin: 0;
}

.summary div {
    display: grid;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

dt {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

dd {
    margin: 0;
    overflow-wrap: anywhere;
}

pre {
    margin: 0;
    white-space: pre-wrap;
    font: inherit;
}

.mail-list {
    display: grid;
    gap: 16px;
    margin-bottom: 24px;
}

.mail-list form {
    margin: 0;
}

.mail-send-button {
    display: grid;
    gap: 8px;
    width: 100%;
    min-height: 96px;
    padding: 18px 20px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    text-align: left;
    background: var(--button-color, var(--accent));
    box-shadow: 0 12px 28px rgba(31, 42, 36, 0.16);
    cursor: pointer;
}

.mail-send-button:hover {
    filter: brightness(0.92);
}

.mail-send-button span {
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.mail-send-button small {
    font-size: 0.95rem;
    line-height: 1.5;
    opacity: 0.9;
    overflow-wrap: anywhere;
}

.wide {
    place-items: start center;
}

.wide .panel {
    width: min(1100px, 100%);
}

.row-heading {
    display: flex;
    gap: 16px;
    align-items: start;
    justify-content: space-between;
}

.setting-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr);
    gap: 24px;
}

.setting-list,
.editor-form {
    min-width: 0;
}

.setting-list h2,
.editor-form h2 {
    margin: 0 0 16px;
    font-size: 1.25rem;
}

.setting-item {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.setting-item strong,
.setting-item p {
    display: block;
    overflow-wrap: anywhere;
}

.setting-item p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.color-chip {
    width: 18px;
    height: 18px;
    border: 1px solid rgba(31, 42, 36, 0.18);
    border-radius: 50%;
    background: var(--chip-color, var(--accent));
}

.setting-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.setting-actions form {
    margin: 0;
}

.actions {
    grid-template-columns: repeat(2, auto);
    align-items: center;
    justify-content: end;
}

@media (max-width: 560px) {
    .shell {
        min-height: 100svh;
        padding: 12px;
        place-items: start center;
    }

    .panel {
        padding: 20px 16px;
        border-radius: 8px;
        box-shadow: 0 12px 34px rgba(31, 42, 36, 0.1);
    }

    .heading {
        margin-bottom: 22px;
    }

    h1 {
        font-size: 2rem;
        line-height: 1.1;
    }

    .button,
    .mail-send-button {
        width: 100%;
    }

    .mail-send-button {
        min-height: 88px;
        padding: 16px;
    }

    .mail-send-button span {
        font-size: 1.15rem;
    }

    .mail-send-button small {
        font-size: 0.88rem;
    }

    .row-heading,
    .setting-layout {
        display: grid;
        grid-template-columns: 1fr;
    }

    .row-heading .button {
        justify-self: stretch;
    }

    .setting-item {
        grid-template-columns: 18px minmax(0, 1fr);
        align-items: start;
    }

    .setting-actions {
        grid-column: 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        flex-wrap: wrap;
    }

    .setting-actions form {
        width: 100%;
    }

    .actions {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }
}