:root {
    --primary-blue: #2F4858;
    --primary-blue-dark: #223642;
    --primary-green: #FF9800;
    --dark: #1E293B;
    --dark-light: #334155;
    --gray: #64748B;
    --light: #E2E8F0;
    --lighter: #F8FAFC;
    --white: #FFFFFF;
    --radius-sm: 6px;
    --radius-md: 8px;
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-xl: 0 18px 48px rgba(15, 23, 42, 0.16);
    --transition: all 0.25s ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.hsp-legal-page {
    margin: 0;
    color: var(--dark-light);
    background: var(--white);
    font-family: "Noto Sans JP", "Zen Maru Gothic", sans-serif;
    line-height: 1.8;
}

body.hsp-legal-page main {
    padding-top: 72px;
}

a {
    color: var(--primary-blue);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-blue-dark);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: var(--dark);
    text-decoration: none;
    line-height: 1.2;
}

.nav-logo-text {
    color: rgb(35, 47, 62);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.nav-logo i {
    font-size: 1.5rem;
    color: var(--primary-blue);
    flex: 0 0 auto;
}

.nav-logo small {
    display: inline-block;
    font-weight: 400;
    font-size: 11.2px;
    color: rgb(100, 116, 139);
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    transform: translateY(4px);
}

.nav-link {
    display: block;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--dark-light);
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--primary-blue);
    background: rgba(35, 47, 62, 0.06);
}

.nav-cta {
    background: var(--primary-green);
    color: var(--dark) !important;
    font-weight: 700;
    border-radius: 50px;
    padding: 10px 20px;
    margin-left: 8px;
}

.nav-cta:hover {
    color: var(--dark) !important;
    background: #FB8C00;
}

.page-header {
    padding: 56px 0 64px;
    text-align: center;
    background: linear-gradient(135deg, #FFF8EE 0%, #F0F4F8 52%, #F8FAFC 100%);
}

.page-header h1 {
    margin: 0 0 8px;
    color: var(--dark);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.4;
}

.page-header p {
    margin: 0;
    color: var(--gray);
    font-size: 0.95rem;
}

.legal-content {
    padding: 56px 0 96px;
}

.legal-intro,
.legal-table,
.legal-note,
.back-link-wrapper {
    width: min(100%, 900px);
    margin-left: auto;
    margin-right: auto;
}

.legal-intro {
    margin-bottom: 24px;
}

.legal-intro h2 {
    margin: 0 0 10px;
    color: var(--dark);
    font-size: 1.35rem;
    line-height: 1.45;
}

.legal-intro p {
    margin: 0;
    color: var(--gray);
    font-size: 0.95rem;
}

.legal-table {
    overflow: hidden;
    border: 1px solid var(--light);
    border-radius: var(--radius-md);
    background: var(--white);
}

.legal-table table {
    width: 100%;
    border-collapse: collapse;
}

.legal-table th,
.legal-table td {
    padding: 20px 24px;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.8;
    border-bottom: 1px solid var(--light);
    vertical-align: top;
}

.legal-table tr:last-child th,
.legal-table tr:last-child td {
    border-bottom: 0;
}

.legal-table th {
    width: 210px;
    color: var(--dark);
    font-weight: 700;
    background: var(--lighter);
    white-space: nowrap;
}

.legal-table td {
    color: var(--dark-light);
}

.legal-table small {
    color: var(--gray);
    font-size: 0.82rem;
}

.legal-note {
    margin-top: 32px;
    padding: 24px;
    border-radius: var(--radius-md);
    background: var(--lighter);
    color: var(--gray);
    font-size: 0.9rem;
}

.legal-note p {
    margin: 0 0 10px;
}

.legal-note p:last-child {
    margin-bottom: 0;
}

.legal-note strong {
    color: var(--dark);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 36px;
    color: var(--primary-blue);
    font-size: 0.95rem;
    font-weight: 700;
}

.back-link:hover {
    transform: translateX(-2px);
}

.privacy-body {
    width: min(100%, 900px);
    margin: 28px auto 0;
}

.privacy-section {
    padding: 26px 0;
    border-bottom: 1px solid var(--light);
}

.privacy-section:first-child {
    padding-top: 0;
}

.privacy-section:last-child {
    border-bottom: 0;
}

.privacy-section h2 {
    margin: 0 0 12px;
    color: var(--dark);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.55;
}

.privacy-section p {
    margin: 0;
    color: var(--dark-light);
    font-size: 0.95rem;
}

.privacy-section ul {
    margin: 12px 0 0;
    padding-left: 1.35em;
    color: var(--dark-light);
    font-size: 0.95rem;
}

.privacy-section li + li {
    margin-top: 6px;
}

.privacy-contact {
    margin-top: 18px;
    padding: 22px 24px;
    border: 1px solid var(--light);
    border-radius: var(--radius-md);
    background: var(--lighter);
}

.privacy-contact dl {
    margin: 0;
}

.privacy-contact dl > div {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--light);
}

.privacy-contact dl > div:first-child {
    padding-top: 0;
}

.privacy-contact dl > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.privacy-contact dt,
.privacy-contact dd {
    margin: 0;
    font-size: 0.95rem;
}

.privacy-contact dt {
    color: var(--dark);
    font-weight: 700;
}

.privacy-contact dd {
    color: var(--dark-light);
}

.legal-page-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px 24px;
}

.back-link-secondary {
    color: var(--gray);
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    color: var(--white);
    background: var(--primary-blue);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: var(--transition);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

body.admin-bar .header {
    top: 32px;
}

body.admin-bar.hsp-legal-page main {
    padding-top: 104px;
}

@media (max-width: 782px) {
    body.admin-bar .header {
        top: 46px;
    }

    body.admin-bar.hsp-legal-page main {
        padding-top: 118px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 18px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 320px;
        height: 100dvh;
        min-height: 100vh;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 80px 24px 40px;
        background: var(--white);
        box-shadow: var(--shadow-xl);
        transition: transform 0.3s ease;
        transform: translateX(100%);
        z-index: 10020;
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-link {
        width: 100%;
        padding: 12px 16px;
        font-size: 1rem;
    }

    .nav-cta {
        width: 100%;
        margin-top: 12px;
        margin-left: 0;
        text-align: center;
    }

    .page-header {
        padding: 44px 0 44px;
    }

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

    .legal-content {
        padding: 40px 0 72px;
    }

    .legal-table {
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }

    .legal-table th,
    .legal-table td {
        display: block;
        width: 100%;
        padding: 12px 16px;
        border-bottom: 0;
    }

    .legal-table th {
        padding-bottom: 4px;
        white-space: normal;
    }

    .legal-table td {
        padding-top: 4px;
    }

    .legal-table tr {
        display: block;
        border-bottom: 1px solid var(--light);
    }

    .legal-table tr:last-child {
        border-bottom: 0;
    }

    .legal-note {
        padding: 18px;
    }

    .privacy-section {
        padding: 22px 0;
    }

    .privacy-section h2 {
        font-size: 1.05rem;
    }

    .privacy-contact {
        padding: 16px;
    }

    .privacy-contact dl > div {
        display: block;
        padding: 12px 0;
    }

    .privacy-contact dt {
        margin-bottom: 4px;
    }

    .legal-page-links {
        display: block;
    }

    .back-link-secondary {
        margin-top: 14px;
    }
}

.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 990;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}
