/* ═══════════════════════════════════════════════════════════════════════
   LEGAL PAGES SHARED STYLES
   Privacy / Terms / Cookies / 特定商取引法
   ═══════════════════════════════════════════════════════════════════════ */

.legal-hero {
    padding: 88px var(--pad-x) 60px;
    background: var(--bg-cool);
    border-bottom: 1px solid var(--line);
}
.legal-hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}
.legal-hero .meta {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-mute);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.legal-hero .meta::before {
    content: '';
    width: 28px;
    height: 1px;
    background: var(--brand);
}
.legal-hero h1 {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 14px;
    text-wrap: balance;
}
.legal-hero h1 em {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
    color: var(--cyan-deep);
}
.legal-hero .lede {
    font-size: 15px;
    color: var(--ink-soft);
    max-width: 720px;
    line-height: 1.85;
}
.legal-hero .updated {
    margin-top: 24px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-soft);
    letter-spacing: 0.04em;
}
.legal-hero .updated .dot {
    width: 6px;
    height: 6px;
    background: var(--cyan);
    border-radius: 50%;
}

.legal-body {
    padding: 80px var(--pad-x) 120px;
    background: white;
}
.legal-body-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 80px;
}

/* TOC sidebar */
.legal-toc {
    position: sticky;
    top: 100px;
    align-self: start;
    height: max-content;
}
.legal-toc-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--ink-mute);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}
.legal-toc ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.legal-toc a {
    display: block;
    padding: 8px 12px 8px 14px;
    font-size: 12.5px;
    color: var(--ink-mute);
    line-height: 1.5;
    border-left: 1px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
}
.legal-toc a:hover {
    color: var(--ink);
    border-left-color: var(--line-strong);
    background: var(--bg-cool);
}
.legal-toc a.active {
    color: var(--brand);
    border-left-color: var(--brand);
    font-weight: 600;
}

/* Article content */
.legal-content {
    max-width: 760px;
    font-size: 14.5px;
    line-height: 1.95;
    color: var(--ink-soft);
}
.legal-content > section {
    margin-bottom: 56px;
    scroll-margin-top: 100px;
}
.legal-content > section:last-child {
    margin-bottom: 0;
}
.legal-content h2 {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 26px;
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--ink);
    margin-bottom: 6px;
    padding-top: 8px;
    display: flex;
    align-items: baseline;
    gap: 14px;
}
.legal-content h2 .num {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--brand);
    font-weight: 600;
    letter-spacing: 0.12em;
    flex-shrink: 0;
}
.legal-content h2 + .h2-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink-mute);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.legal-content h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--ink);
    margin-top: 32px;
    margin-bottom: 12px;
    letter-spacing: -0.005em;
}
.legal-content p {
    margin-bottom: 16px;
}
.legal-content p:last-child {
    margin-bottom: 0;
}
.legal-content strong {
    color: var(--ink);
    font-weight: 600;
}
.legal-content a {
    color: var(--brand);
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
    transition: opacity 0.2s;
}
.legal-content a:hover {
    opacity: 0.7;
}
.legal-content ul,
.legal-content ol {
    margin: 16px 0 20px;
    padding-left: 24px;
}
.legal-content li {
    margin-bottom: 8px;
    line-height: 1.85;
}
.legal-content ul li {
    list-style: none;
    position: relative;
    padding-left: 18px;
}
.legal-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 6px;
    height: 1px;
    background: var(--ink-mute);
}
.legal-content ol {
    counter-reset: legal-counter;
    padding-left: 0;
}
.legal-content ol li {
    list-style: none;
    counter-increment: legal-counter;
    position: relative;
    padding-left: 36px;
}
.legal-content ol li::before {
    content: counter(legal-counter, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--brand);
    font-weight: 600;
    line-height: 2.4;
}

/* Definition table for 特商法 / Privacy */
.legal-table {
    width: 100%;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--line);
    margin: 24px 0 32px;
    font-size: 13.5px;
}
.legal-table tr {
    border-bottom: 1px solid var(--line);
}
.legal-table tr:last-child {
    border-bottom: none;
}
.legal-table th,
.legal-table td {
    padding: 18px 16px;
    text-align: left;
    vertical-align: top;
    line-height: 1.75;
}
.legal-table th {
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    color: var(--ink-mute);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    width: 200px;
    background: var(--bg-cool);
    border-right: 1px solid var(--line);
}
.legal-table td {
    color: var(--ink-soft);
}
.legal-table td strong {
    color: var(--ink);
}

/* Callout box */
.legal-callout {
    background: var(--bg-cool);
    border-left: 3px solid var(--brand);
    padding: 20px 22px;
    margin: 24px 0;
    border-radius: 2px;
}
.legal-callout-label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--brand);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}
.legal-callout p {
    font-size: 13.5px;
    color: var(--ink-soft);
    margin: 0;
}

/* Cookie table specific */
.cookie-table th:nth-child(1) { width: 25%; }
.cookie-table th:nth-child(2) { width: 18%; }
.cookie-table th:nth-child(3) { width: 18%; }
.cookie-table th {
    width: auto;
    background: var(--ink);
    color: white;
    border-right: 1px solid rgba(255,255,255,0.1);
}
.cookie-table th:last-child { border-right: none; }
.cookie-table td {
    font-size: 12.5px;
    padding: 14px 14px;
}
.cookie-table .cookie-name {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--ink);
    font-weight: 600;
}
.cookie-table .cookie-type {
    display: inline-block;
    padding: 2px 8px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.cookie-table .cookie-type.essential {
    background: #e8f5e9;
    color: #1b5e20;
}
.cookie-table .cookie-type.analytics {
    background: #fff3e0;
    color: #c75300;
}

/* Contact block at bottom of legal */
.legal-contact-block {
    margin-top: 64px;
    padding: 36px 36px;
    background: var(--ink);
    color: white;
    border-radius: 2px;
}
.legal-contact-block .label {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--cyan);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-weight: 600;
}
.legal-contact-block h3 {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 22px;
    color: white;
    margin-bottom: 14px;
    margin-top: 0;
}
.legal-contact-block p {
    font-size: 13.5px;
    color: rgba(255,255,255,0.75);
    margin-bottom: 18px;
}
.legal-contact-block a.btn-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.4);
    padding-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s;
}
.legal-contact-block a.btn-link:hover {
    border-bottom-color: var(--cyan);
}

@media (max-width: 980px) {
    .legal-body-inner {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .legal-toc {
        position: static;
        padding: 18px 20px;
        background: var(--bg-cool);
        border: 1px solid var(--line);
        border-radius: 4px;
    }
    .legal-toc ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px 12px;
    }
    .legal-toc a {
        padding: 4px 0;
        font-size: 12px;
        border-left: none;
        border-bottom: 1px solid transparent;
    }
    .legal-toc a:hover,
    .legal-toc a.active {
        background: transparent;
        border-left: none;
    }
    .legal-table th {
        width: 130px;
        font-size: 10px;
        padding: 14px 12px;
    }
    .legal-table td {
        padding: 14px 12px;
        font-size: 13px;
    }
    .legal-content h2 {
        font-size: 22px;
        flex-direction: column;
        gap: 4px;
    }
    .legal-contact-block {
        padding: 28px 24px;
    }
}

@media (max-width: 600px) {
    .legal-hero { padding: 64px var(--pad-x) 48px; }
    .legal-body { padding: 56px var(--pad-x) 80px; }
    .cookie-table {
        font-size: 11.5px;
    }
    .cookie-table th,
    .cookie-table td {
        padding: 10px 8px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════
   COOKIE CONSENT BANNER
   ═══════════════════════════════════════════════════════════════════════ */

#cookie-consent {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    background: var(--ink);
    color: white;
    border-radius: 6px;
    box-shadow: 0 24px 60px -12px rgba(7, 17, 31, 0.55), 0 0 0 1px rgba(255,255,255,0.08);
    padding: 24px 28px;
    z-index: 9000;
    transform: translateY(140%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s;
}
#cookie-consent.visible {
    transform: translateY(0);
    opacity: 1;
}
.cc-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}
.cc-icon {
    width: 36px;
    height: 36px;
    background: rgba(10,166,194,0.12);
    border: 1px solid rgba(10,166,194,0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    flex-shrink: 0;
}
.cc-icon svg {
    width: 18px;
    height: 18px;
}
.cc-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.005em;
    color: white;
}
.cc-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    background: rgba(10,166,194,0.15);
    color: var(--cyan);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    font-weight: 600;
}
.cc-body {
    font-size: 12.5px;
    color: rgba(255,255,255,0.75);
    line-height: 1.7;
    margin-bottom: 18px;
}
.cc-body a {
    color: var(--cyan);
    border-bottom: 1px solid rgba(10,166,194,0.4);
    padding-bottom: 1px;
    transition: opacity 0.2s;
}
.cc-body a:hover {
    opacity: 0.8;
}
.cc-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.cc-btn {
    padding: 10px 18px;
    font-size: 12.5px;
    font-weight: 600;
    border-radius: 5px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}
.cc-btn.primary {
    background: white;
    color: var(--ink);
}
.cc-btn.primary:hover {
    background: var(--cyan);
    color: white;
}
.cc-btn.ghost {
    background: transparent;
    color: rgba(255,255,255,0.85);
    border-color: rgba(255,255,255,0.2);
}
.cc-btn.ghost:hover {
    border-color: rgba(255,255,255,0.5);
    color: white;
}
.cc-btn.text {
    background: transparent;
    color: rgba(255,255,255,0.6);
    padding: 10px 8px;
    margin-left: auto;
    font-size: 12px;
}
.cc-btn.text:hover {
    color: white;
}

/* Settings panel (expanded) */
.cc-settings {
    display: none;
    margin: 16px 0 18px;
    padding: 18px 0 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}
#cookie-consent.expanded .cc-settings {
    display: block;
}
.cc-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.cc-row:last-child {
    border-bottom: none;
}
.cc-row-text {
    flex: 1;
}
.cc-row-name {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cc-row-required {
    font-family: var(--font-mono);
    font-size: 9.5px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.1em;
    font-weight: 500;
}
.cc-row-desc {
    font-size: 11.5px;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
}
.cc-toggle {
    flex-shrink: 0;
    width: 38px;
    height: 22px;
    background: rgba(255,255,255,0.15);
    border-radius: 22px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 2px;
}
.cc-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}
.cc-toggle.on {
    background: var(--cyan);
}
.cc-toggle.on::after {
    transform: translateX(16px);
}
.cc-toggle.locked {
    background: rgba(10,166,194,0.4);
    cursor: not-allowed;
    opacity: 0.7;
}
.cc-toggle.locked::after {
    transform: translateX(16px);
}

@media (max-width: 600px) {
    #cookie-consent {
        bottom: 12px;
        left: 12px;
        right: 12px;
        padding: 18px 20px;
    }
    .cc-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .cc-btn {
        width: 100%;
        justify-content: center;
    }
    .cc-btn.text {
        margin-left: 0;
    }
}
