.ailfc-wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 20px;
    color: #222;
}

.ailfc-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ailfc-notice {
    padding: 14px 16px;
    border-left: 4px solid #7a6a40;
    background: #fbf7ec;
    color: #3f3520;
    font-size: 14px;
    line-height: 1.7;
}

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

.ailfc-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    border: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
}

.ailfc-field-wide,
.ailfc-birthdate {
    grid-column: 1 / -1;
}

.ailfc-field-wide {
    gap: 12px;
}

.ailfc-conditional-field[hidden] {
    display: none;
}

.ailfc-field input,
.ailfc-field select,
.ailfc-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    padding: 11px 12px;
    font: inherit;
    font-weight: 400;
    background: #fff;
}

.ailfc-field small {
    color: #666;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}

.ailfc-date-selects {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
}

.ailfc-date-selects label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.ailfc-character-field legend {
    margin-bottom: 8px;
}

.ailfc-character-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ailfc-character-card {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    min-height: 132px;
    box-sizing: border-box;
    border: 2px solid #d6d6d6;
    border-radius: 8px;
    padding: 16px 16px 16px 54px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.ailfc-character-card:hover,
.ailfc-character-card:focus-within,
.ailfc-character-card.is-selected {
    border-color: #2f5d50;
    background: #f2f6f5;
    box-shadow: 0 0 0 3px rgba(47, 93, 80, 0.1);
}

.ailfc-character-card:has(input:checked) {
    border-color: #2f5d50;
    background: #f2f6f5;
    box-shadow: 0 0 0 3px rgba(47, 93, 80, 0.1);
}

.ailfc-character-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ailfc-character-check {
    position: absolute;
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid #b9b9b9;
    border-radius: 50%;
    background: #fff;
    color: transparent;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.ailfc-character-card.is-selected .ailfc-character-check {
    border-color: #2f5d50;
    background: #2f5d50;
    color: #fff;
}

.ailfc-character-card:has(input:checked) .ailfc-character-check {
    border-color: #2f5d50;
    background: #2f5d50;
    color: #fff;
}

.ailfc-character-icon {
    grid-row: 1 / span 2;
    font-size: 30px;
    line-height: 1;
}

.ailfc-character-name {
    color: #2f5d50;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
}

.ailfc-character-description {
    grid-column: 2;
    color: #444;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
}

.ailfc-field textarea {
    min-height: 104px;
    resize: vertical;
}

.ailfc-button {
    width: fit-content;
    border: 0;
    border-radius: 6px;
    padding: 13px 28px;
    background: #2f5d50;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.ailfc-button:hover,
.ailfc-button:focus {
    background: #24483e;
}

.ailfc-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.ailfc-loading,
.ailfc-error,
.ailfc-result {
    margin-top: 22px;
}

.ailfc-loading {
    padding: 14px 16px;
    background: #f2f6f5;
    color: #24483e;
    border-radius: 6px;
}

.ailfc-error {
    padding: 14px 16px;
    background: #fff1f1;
    color: #8a1f1f;
    border-radius: 6px;
}

.ailfc-result {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    line-height: 1.9;
}

.ailfc-result-sections {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ailfc-result-card {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
}

.ailfc-result-card:nth-child(n + 6),
.ailfc-character-result {
    grid-column: 1 / -1;
}

.ailfc-result-card h3 {
    margin: 0 0 12px;
    color: #2f5d50;
    font-size: 18px;
    line-height: 1.5;
}

.ailfc-result-card p {
    margin: 0;
    color: #333;
    font-size: 15px;
    line-height: 1.9;
}

.ailfc-result-card p + p {
    margin-top: 12px;
}

.ailfc-result-card-highlight {
    border-color: #c8dbc9;
    background: #f7fbf8;
}

.ailfc-result-main {
    margin-bottom: 10px;
    color: #2f5d50;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
}

.ailfc-color-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ailfc-color-swatch {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 50%;
}

.ailfc-share {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}

.ailfc-share[hidden] {
    display: none;
}

.ailfc-share-button {
    border: 1px solid #2f5d50;
    border-radius: 6px;
    padding: 11px 16px;
    background: #fff;
    color: #2f5d50;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
}

.ailfc-share-button:hover,
.ailfc-share-button:focus {
    background: #f2f6f5;
}

.ailfc-share-message {
    min-height: 1.5em;
    color: #2f5d50;
    font-size: 14px;
    font-weight: 700;
}

.ailfc-image-card {
    position: fixed;
    top: 0;
    left: -9999px;
    width: 1080px;
    min-height: 1350px;
    background: #f8f4ea;
    color: #222;
    font-family: sans-serif;
}

.ailfc-image-card-inner {
    margin: 44px;
    min-height: 1262px;
    box-sizing: border-box;
    border: 3px solid #d8c9a5;
    border-radius: 28px;
    padding: 74px;
    background: #fff;
}

.ailfc-image-card-title {
    color: #2f5d50;
    font-size: 54px;
    font-weight: 700;
    line-height: 1.25;
}

.ailfc-image-card-subtitle {
    margin-top: 18px;
    color: #7a6a40;
    font-size: 28px;
    line-height: 1.5;
}

.ailfc-image-card dl {
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin: 90px 0 70px;
}

.ailfc-image-card dl > div {
    border-radius: 18px;
    padding: 28px;
    background: #f2f6f5;
}

.ailfc-image-card dt {
    margin: 0 0 14px;
    color: #2f5d50;
    font-size: 30px;
    font-weight: 700;
}

.ailfc-image-card dd {
    margin: 0;
    color: #222;
    font-size: 34px;
    line-height: 1.45;
}

.ailfc-image-card-url {
    color: #666;
    font-size: 26px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.ailfc-branches {
    margin-top: 24px;
}

.ailfc-branches[hidden],
.ailfc-branch-loading[hidden],
.ailfc-branch-error[hidden],
.ailfc-branch-result[hidden] {
    display: none;
}

.ailfc-branches-intro {
    margin: 0 0 14px;
    color: #2f5d50;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.7;
}

.ailfc-branch-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ailfc-branch-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 168px;
    border: 1px solid #d6d6d6;
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    color: #222;
    text-align: left;
    cursor: pointer;
}

.ailfc-branch-card:hover,
.ailfc-branch-card:focus,
.ailfc-branch-card.is-selected {
    border-color: #2f5d50;
    background: #f2f6f5;
}

.ailfc-branch-card:disabled {
    cursor: wait;
    opacity: 0.72;
}

.ailfc-branch-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #2f5d50;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.ailfc-branch-title {
    color: #2f5d50;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
}

.ailfc-branch-description {
    color: #444;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.7;
}

.ailfc-branch-loading {
    margin-top: 16px;
    padding: 14px 16px;
    background: #f2f6f5;
    color: #24483e;
    border-radius: 6px;
}

.ailfc-branch-error {
    margin-top: 16px;
    padding: 14px 16px;
    background: #fff1f1;
    color: #8a1f1f;
    border-radius: 6px;
}

.ailfc-branch-result {
    margin-top: 18px;
    padding: 22px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    line-height: 1.9;
}

.ailfc-branch-result h3 {
    margin: 1.2em 0 0.4em;
    color: #2f5d50;
}

.ailfc-branch-result h3:first-child {
    margin-top: 0;
}

@media (max-width: 640px) {
    .ailfc-wrap {
        padding: 16px;
    }

    .ailfc-grid,
    .ailfc-date-selects,
    .ailfc-character-cards {
        grid-template-columns: 1fr;
    }

    .ailfc-button,
    .ailfc-share-button {
        width: 100%;
    }

    .ailfc-result-sections {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .ailfc-result-card {
        padding: 16px;
    }

    .ailfc-result-main {
        font-size: 26px;
    }

    .ailfc-share {
        flex-direction: column;
        align-items: stretch;
    }

    .ailfc-share-message {
        text-align: center;
    }

    .ailfc-branch-cards {
        grid-template-columns: 1fr;
    }

    .ailfc-branch-card {
        min-height: auto;
    }

    .ailfc-branch-result {
        padding: 16px;
    }
}
