@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400..700;1,400..700&display=swap');

@font-face {
    font-family: 'Memorial Noto Sans JP';
    src: url('/static/fonts/woff2/NotoSansJP.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

@font-face {
    font-family: 'Memorial Noto Serif JP';
    src: url('/static/fonts/woff2/NotoSerifJP.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --terms-gold: #c9a84c;
    --terms-gold-dark: #b8963e;
    --terms-gold-dim: rgba(201, 168, 76, 0.12);
    --terms-gold-line: rgba(201, 168, 76, 0.28);
    --terms-navy: #2c3e50;
    --terms-slate: #5a6a7a;
    --terms-cream: #faf9f6;
    --terms-white: #ffffff;
    --terms-border: rgba(180, 140, 50, 0.25);
    --terms-shadow: rgba(44, 62, 80, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.terms-page-body {
    margin: 0;
    font-family: 'Memorial Noto Sans JP', 'Helvetica Neue', sans-serif;
    background:
        radial-gradient(circle at top right, rgba(201, 168, 76, 0.14), transparent 24%),
        linear-gradient(180deg, #fdfcf8 0%, var(--terms-cream) 100%);
    color: var(--terms-navy);
    min-height: 100vh;
}

.terms-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 56px;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: var(--terms-navy);
    border-bottom: 2px solid var(--terms-gold);
}

.terms-topbar-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--terms-white);
    text-decoration: none;
    font-family: 'Memorial Noto Serif JP', 'Lora', serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.terms-topbar-logo i {
    color: var(--terms-gold);
    font-size: 1.15rem;
}

.terms-topbar-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.18);
}

.terms-topbar-title {
    margin: 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.terms-nav-toggle {
    margin-left: auto;
    display: none;
    align-items: center;
    gap: 0.45rem;
    border: 1px solid rgba(201, 168, 76, 0.48);
    background: transparent;
    color: var(--terms-gold);
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
}

.terms-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: calc(100vh - 56px);
}

.terms-sidebar {
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    padding: 1.25rem 0;
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid var(--terms-border);
}

.terms-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.2rem 0.8rem;
    border-bottom: 1px solid var(--terms-border);
    margin-bottom: 0.5rem;
    color: var(--terms-gold-dark);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.terms-sidebar-close {
    display: none;
    border: 0;
    background: transparent;
    color: var(--terms-slate);
    font-size: 1rem;
    cursor: pointer;
}

.terms-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0 0.65rem;
}

.terms-nav-link {
    display: block;
    padding: 0.6rem 0.85rem;
    border-left: 3px solid transparent;
    border-radius: 0 10px 10px 0;
    color: var(--terms-slate);
    text-decoration: none;
    font-size: 0.86rem;
    line-height: 1.45;
    transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.terms-nav-link:hover,
.terms-nav-link.is-active {
    color: var(--terms-gold-dark);
    background: var(--terms-gold-dim);
    border-left-color: var(--terms-gold);
}

.terms-content {
    max-width: 920px;
    padding: 2rem 2rem 4rem;
}

.terms-hero,
.terms-section {
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid var(--terms-border);
    border-radius: 22px;
    box-shadow: 0 20px 40px var(--terms-shadow);
}

.terms-hero {
    padding: 2rem;
    background:
        radial-gradient(circle at top right, rgba(201, 168, 76, 0.16), transparent 30%),
        linear-gradient(135deg, rgba(201, 168, 76, 0.08), rgba(255, 255, 255, 0.98));
}

.terms-eyebrow {
    margin: 0 0 0.6rem;
    color: var(--terms-gold-dark);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.76rem;
    font-weight: 700;
}

.terms-hero-title {
    margin: 0 0 0.85rem;
    font-family: 'Memorial Noto Serif JP', 'Lora', serif;
    font-size: 1.9rem;
    line-height: 1.4;
}

.terms-hero-copy {
    margin: 0;
    font-size: 1rem;
    line-height: 1.9;
    color: rgba(44, 62, 80, 0.84);
}

.terms-meta-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    margin-top: 1.25rem;
}

.terms-hero-meta-row {
    padding: 0.9rem 1rem;
    border: 1px solid var(--terms-gold-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
}

.terms-hero-meta-label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--terms-gold-dark);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.terms-hero-meta-value {
    display: block;
    color: var(--terms-navy);
    font-size: 0.98rem;
    font-weight: 600;
}

.terms-callout {
    margin-top: 1.25rem;
    padding: 1rem 1.1rem;
    border-radius: 16px;
    border: 1px solid var(--terms-gold-line);
    background: rgba(255, 255, 255, 0.84);
}

.terms-callout strong {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--terms-gold-dark);
}

.terms-callout p {
    margin: 0;
    line-height: 1.8;
}

.terms-section {
    margin-top: 1.15rem;
    padding: 1.6rem 1.8rem 1.7rem;
}

.terms-section-header {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--terms-gold-line);
}

.terms-section-num {
    color: var(--terms-gold-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
}

.terms-section h2 {
    margin: 0;
    font-family: 'Memorial Noto Serif JP', 'Lora', serif;
    font-size: 1.3rem;
    line-height: 1.4;
}

.terms-section p {
    margin: 0 0 1rem;
    line-height: 1.9;
}

.terms-section p:last-child {
    margin-bottom: 0;
}

.terms-section-intro {
    margin-top: 1.15rem;
}

.terms-document-body p {
    margin: 0 0 1rem;
    line-height: 1.9;
}

.terms-document-body p:last-child {
    margin-bottom: 0;
}

.terms-document-body ul,
.terms-document-body ol {
    margin: 0 0 1rem 1.35rem;
    padding: 0;
}

.terms-document-body li {
    margin-bottom: 0.45rem;
    line-height: 1.8;
}

.terms-document-body ul > li::marker,
.terms-document-body ol > li::marker {
    color: var(--terms-gold-dark);
}

.terms-document-body .page-lead {
    font-size: 1rem;
}

.terms-document-body .page-meta-list {
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--terms-border);
    border-radius: 14px;
    background: var(--terms-gold-dim);
}

.terms-document-body .page-meta-row {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0.75rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--terms-gold-line);
}

.terms-document-body .page-meta-row:last-child {
    border-bottom: 0;
}

.terms-document-body .page-meta-row dt {
    margin: 0;
    color: var(--terms-gold-dark);
    font-weight: 700;
}

.terms-document-body .page-meta-row dd {
    margin: 0;
}

.terms-document-body a {
    color: var(--terms-navy);
    text-decoration: none;
    border-bottom: 1px solid var(--terms-gold-line);
}

.terms-document-body a:hover {
    color: var(--terms-gold-dark);
}

.terms-list {
    margin: 0 0 1rem 1.35rem;
    padding: 0;
}

.terms-list li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

.terms-list li::marker {
    color: var(--terms-gold-dark);
}

.terms-meta-list {
    margin: 0;
}

.terms-meta-row {
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--terms-gold-line);
}

.terms-meta-row:last-child {
    border-bottom: 0;
}

.terms-meta-row dt {
    margin: 0;
    color: var(--terms-gold-dark);
    font-weight: 700;
}

.terms-meta-row dd {
    margin: 0;
}

.terms-meta-row a {
    color: var(--terms-navy);
    text-decoration: none;
    border-bottom: 1px solid var(--terms-gold-line);
}

.terms-meta-row a:hover {
    color: var(--terms-gold-dark);
}

.terms-updated {
    margin-top: 1.15rem;
    padding-top: 1rem;
    border-top: 1px solid var(--terms-border);
    color: var(--terms-slate);
    font-size: 0.94rem;
}

.terms-backtotop {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: var(--terms-navy);
    color: var(--terms-gold);
    box-shadow: 0 16px 28px rgba(44, 62, 80, 0.2);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.18s, transform 0.18s;
}

.terms-backtotop.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.terms-overlay {
    display: none;
}

@media (max-width: 960px) {
    .terms-nav-toggle {
        display: inline-flex;
    }

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

    .terms-sidebar {
        position: fixed;
        top: 56px;
        left: 0;
        width: min(320px, 86vw);
        height: calc(100vh - 56px);
        z-index: 40;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        box-shadow: 18px 0 32px rgba(44, 62, 80, 0.16);
    }

    .terms-page-body.terms-nav-open .terms-sidebar {
        transform: translateX(0);
    }

    .terms-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .terms-overlay {
        position: fixed;
        inset: 56px 0 0;
        z-index: 35;
        background: rgba(44, 62, 80, 0.34);
    }

    .terms-page-body.terms-nav-open .terms-overlay {
        display: block;
    }

    .terms-content {
        max-width: none;
        padding: 1.15rem 0.95rem 3rem;
    }
}

@media (max-width: 640px) {
    .terms-topbar {
        padding: 0 0.9rem;
        gap: 0.65rem;
    }

    .terms-topbar-logo span {
        display: none;
    }

    .terms-topbar-title {
        font-size: 0.88rem;
    }

    .terms-hero,
    .terms-section {
        border-radius: 18px;
    }

    .terms-hero {
        padding: 1.4rem 1.2rem;
    }

    .terms-hero-title {
        font-size: 1.55rem;
    }

    .terms-meta-card {
        grid-template-columns: 1fr;
    }

    .terms-section {
        padding: 1.25rem 1.15rem 1.3rem;
    }

    .terms-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }

    .terms-meta-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .terms-document-body .page-meta-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }
}
