.terms-page {
    min-height: 100vh;
    padding-bottom: 0;
    color: var(--text-primary);
    background: #f7edf3;
}

.terms-page .bg-layer::after {
    background: rgba(255, 255, 255, 0.52);
}

.terms-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 12px;
    padding: 0 max(18px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.68);
    box-shadow: 0 4px 18px rgba(45, 35, 42, 0.05);
}

.terms-topbar strong {
    overflow: hidden;
    font-family: var(--font-kat);
    font-size: 18px;
    font-weight: 400;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.terms-back {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: 8px;
}

.terms-back:hover {
    color: var(--pink-dark);
    background: var(--pink-bg);
}

.terms-main {
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 36px 24px 28px;
}

.terms-intro {
    max-width: 760px;
    margin: 0 auto 28px;
    text-align: center;
}

.terms-eyebrow {
    margin: 0 0 4px;
    color: var(--pink-dark);
    font-size: 13px;
    font-weight: 600;
}

.terms-intro h1 {
    margin: 0;
    font-family: var(--font-kat);
    font-size: 34px;
    font-weight: 400;
    line-height: 1.3;
}

.terms-intro > p:last-child {
    margin: 10px auto 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.terms-layout {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.terms-toc,
.terms-document {
    background: rgba(255, 255, 255, 0.68);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(45, 35, 42, 0.08);
}

.terms-toc {
    position: sticky;
    top: 84px;
    padding: 16px 10px;
}

.terms-toc > p {
    margin: 0 8px 9px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.terms-toc nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.terms-toc a {
    padding: 8px;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 13px;
}

.terms-toc a:hover,
.terms-toc a.is-active {
    color: var(--pink-dark);
    background: var(--pink-bg);
}

.terms-document {
    min-width: 0;
    padding: 8px 34px;
}

.terms-section {
    scroll-margin-top: 84px;
    padding: 30px 0;
}

.terms-section + .terms-section {
    border-top: 1px solid rgba(255, 105, 180, 0.14);
}

.terms-section h2 {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 18px;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.45;
}

.terms-section h2 span {
    flex: 0 0 auto;
    color: var(--pink);
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.terms-section h3 {
    margin: 22px 0 8px;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
}

.terms-section p,
.terms-section li,
.terms-section dd {
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.9;
}

.terms-section p {
    margin: 0 0 12px;
}

.terms-section ol,
.terms-section ul {
    margin: 10px 0 18px;
    padding-left: 22px;
}

.terms-section li + li {
    margin-top: 5px;
}

.terms-section li::marker {
    color: var(--pink-dark);
    font-family: Arial, sans-serif;
    font-weight: 600;
}

.terms-section a {
    color: var(--pink-dark);
    border-bottom: 1px solid rgba(185, 56, 117, 0.25);
}

.terms-section a:hover {
    border-bottom-color: var(--pink-dark);
}

.terms-image {
    margin: 16px 0 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 105, 180, 0.14);
    border-radius: 7px;
}

.terms-image img {
    width: 100%;
    max-height: 380px;
    display: block;
    object-fit: contain;
}

.terms-faq {
    margin: 0;
}

.terms-faq > div {
    padding: 14px 0;
}

.terms-faq > div + div {
    border-top: 1px dashed rgba(255, 105, 180, 0.18);
}

.terms-faq dt {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}

.terms-faq dd {
    margin: 5px 0 0;
}

.terms-contact {
    padding-left: 0 !important;
    list-style: none;
}

.terms-contact li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-contact .fa {
    width: 18px;
    flex: 0 0 auto;
    color: var(--pink);
    font-family: FontAwesome;
    text-align: center;
}

.terms-action {
    position: relative;
    z-index: 20;
    width: min(720px, calc(100% - 32px));
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px 12px 20px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(45, 35, 42, 0.14);
    margin: 0 auto 24px;
}

.terms-action p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.terms-action button {
    min-width: 168px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    color: #fff;
    background: #b93875;
    border: 1px solid #b93875;
    border-radius: 7px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.terms-action button:hover {
    background: #97275e;
    border-color: #97275e;
    box-shadow: 0 6px 16px rgba(151, 39, 94, 0.22);
}

.terms-action button:focus-visible,
.terms-back:focus-visible,
.terms-toc a:focus-visible {
    outline: 3px solid rgba(255, 105, 180, 0.25);
    outline-offset: 2px;
}

.terms-action button:disabled {
    opacity: 0.65;
    cursor: wait;
}

@media (max-width: 760px) {
    .terms-page {
        padding-bottom: calc(84px + env(safe-area-inset-bottom));
    }

    .terms-topbar {
        height: 58px;
        padding: 0 max(10px, env(safe-area-inset-left));
    }

    .terms-main {
        padding: 26px 14px 24px;
    }

    .terms-intro {
        margin-bottom: 20px;
    }

    .terms-intro h1 {
        font-size: 28px;
    }

    .terms-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .terms-toc {
        position: static;
        padding: 13px;
    }

    .terms-toc > p {
        margin-left: 4px;
    }

    .terms-toc nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
    }

    .terms-toc a {
        padding: 8px 6px;
    }

    .terms-document {
        padding: 4px 18px;
    }

    .terms-section {
        padding: 25px 0;
        scroll-margin-top: 70px;
    }

    .terms-section h2 {
        align-items: flex-start;
        font-size: 18px;
    }

    .terms-section p,
    .terms-section li,
    .terms-section dd {
        font-size: 13.5px;
        line-height: 1.85;
    }

    .terms-action {
        position: fixed;
        left: 0;
        bottom: 0;
        z-index: 120;
        width: 100%;
        min-height: 72px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 0;
        margin: 0;
        transform: none;
    }

    .terms-action p {
        display: none;
    }

    .terms-action button {
        width: 100%;
        min-height: 46px;
    }
}

@media (max-width: 360px) {
    .terms-toc nav {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
