.page {
    width: 90%;
    max-width: 84rem;
    margin: 0 auto;
    padding: 0.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-header-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(18rem, 32vw);
    gap: 1rem;
    align-items: start;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.settings-header-layout-authenticated {
    grid-template-columns: minmax(0, 1fr);
}

.settings-header-left {
    min-width: 0;
}

.settings-header-right {
    min-width: 0;
    align-self: start;
}

.settings-ad-slot {
    width: 100%;
    min-width: 0;
    min-height: 6.25rem;
    border: 0.0625rem dashed #cfc7a4;
    border-radius: 0.5rem;
    background: #ffffff;
    padding: 0.75rem;
    box-sizing: border-box;
}

.settings-adsense {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 5.5rem;
}

.page-header {
    padding: 0;
    margin: 0;
}

.page-header h1 {
    margin: 0 0 0.5rem;
    font-size: 2.5rem;
    line-height: 1.3;
    color: #111827;
}

.page-header p {
    margin: 0 0 0.5rem;
    color: #1f2a44;
    line-height: 1.6;
    font-size: 1rem;
}

.settings-note {
    margin: 0;
    font-size: 0.8rem;
    color: #666666;
}

.card,
.accounting-setting-card {
    background: #ffffff;
    border-radius: 1.25rem;
    padding: 0.75rem 1rem 0.625rem;
    box-shadow: 0 0.125rem 0.5rem rgba(15, 23, 42, 0.08);
    margin-bottom: 0;
}

.accounting-setting-card h2 {
    margin: 0 0 0.875rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #222222;
}

.settings-table-wrap {
    width: 100%;
    overflow-x: hidden;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #ffffff;
}

.settings-table th,
.settings-table td {
    border: 0.0625rem solid #000000;
    padding: 0.75rem;
    vertical-align: top;
    box-sizing: border-box;
}

.settings-table th {
    background-color: #f2f2f2;
    text-align: center;
    font-weight: 700;
    color: #222222;
}

.settings-table th:first-child,
.settings-table td:first-child {
    width: 36%;
}

.settings-table th:nth-child(2),
.settings-table td:nth-child(2) {
    width: 64%;
}

.settings-input-cell,
.settings-list-cell {
    width: auto;
}

.setting-text-input {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 0.0625rem solid #d6deeb;
    border-radius: 0.5rem;
    padding: 0.75rem 0.9375rem;
    background: #ffffff;
    color: #1f2a44;
    font-size: 0.9375rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.setting-text-input::placeholder {
    color: #94a3b8;
}

.setting-text-input:focus {
    outline: none;
    border-color: #9eb8ef;
    box-shadow: 0 0 0 0.1875rem rgba(47, 106, 230, 0.18);
}

.settings-save-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    border: 0.0625rem solid #2f6ae6;
    border-radius: 0.5rem;
    padding: 0.625rem 0.9375rem;
    background: #2f6ae6;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 0.25rem 0.75rem rgba(47, 106, 230, 0.18);
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.settings-save-btn:hover {
    background: #2559c7;
    border-color: #2559c7;
    transform: translateY(-0.0625rem);
}

.settings-save-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.1875rem rgba(47, 106, 230, 0.18);
}

.setting-item-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 0.0625rem solid #e5e7eb;
}

.setting-item:first-child {
    padding-top: 0;
}

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

.setting-item-label {
    min-width: 0;
    word-break: break-word;
    color: #222222;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.setting-delete-btn {
    flex: 0 0 auto;
    border: 0.0625rem solid #f1c0c0;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fffafa;
    color: #b42318;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.setting-delete-btn:hover {
    background: #fff1f1;
    border-color: #e19a9a;
    transform: translateY(-0.0625rem);
}

.setting-delete-btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.1875rem rgba(180, 35, 24, 0.14);
}

@media (max-width: 48rem) {
    .page {
        padding: 0.625rem 0.75rem 0.875rem;
        gap: 0.875rem;
    }

    .settings-header-layout {
        grid-template-columns: 1fr;
        margin-top: 1rem;
    }

    .settings-header-right {
        order: -1;
    }

    .settings-ad-slot {
        min-height: 5rem;
    }

    .settings-adsense {
        min-height: 4.5rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .card,
    .accounting-setting-card {
        padding: 0.625rem 0.75rem 0.5rem;
        border-radius: 1rem;
    }

    .accounting-setting-card h2 {
        margin-bottom: 0.625rem;
        font-size: 1rem;
    }

    .settings-table th,
    .settings-table td {
        padding: 0.5rem;
    }

    .settings-table th:first-child,
    .settings-table td:first-child {
        width: 40%;
    }

    .settings-table th:nth-child(2),
    .settings-table td:nth-child(2) {
        width: 60%;
    }

    .setting-text-input {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }

    .settings-save-btn {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }

    .setting-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .setting-delete-btn {
        width: 100%;
    }
}

@media (max-width: 36rem) {
    .settings-table th,
    .settings-table td {
        padding: 0.4375rem;
    }

    .settings-table th:first-child,
    .settings-table td:first-child {
        width: 42%;
    }

    .settings-table th:nth-child(2),
    .settings-table td:nth-child(2) {
        width: 58%;
    }

    .setting-text-input {
        font-size: 0.8125rem;
        padding: 0.5625rem 0.625rem;
    }

    .settings-save-btn {
        font-size: 0.8125rem;
        padding: 0.5625rem 0.625rem;
    }

    .setting-item-label {
        font-size: 0.875rem;
    }

    .setting-delete-btn {
        font-size: 0.75rem;
        padding: 0.5rem 0.625rem;
    }
}