/* Legal pages share the same restrained reading surface as the generators. */
:root {
    --lg-bg: #f5f5f7;
    --lg-surface: #ffffff;
    --lg-hover: #fbfbfd;
    --lg-text: #1d1d1f;
    --lg-body: #424245;
    --lg-meta: #6e6e73;
    --lg-faint: #86868b;
    --lg-line: rgba(0, 0, 0, .07);
    --lg-accent: #0071e3;
    --lg-accent-link: #0066cc;
    --lg-warn: #ff6b00;
    --lg-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Helvetica Neue', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --lg-panel: 0 1px 3px rgba(0, 0, 0, .05), 0 14px 40px rgba(0, 0, 0, .05);
    --lg-pill: 999px;
}

body { min-height: 100vh; background: var(--lg-bg); color: var(--lg-text); font-family: var(--lg-font); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; }
body > header { position: sticky; top: 0; z-index: 50; padding: 0; background: rgba(245, 245, 247, .72); border-bottom: 1px solid transparent; box-shadow: none; backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); transition: border-color .3s cubic-bezier(.25, 1, .5, 1), box-shadow .3s cubic-bezier(.25, 1, .5, 1); }
body > header.scrolled { border-bottom-color: var(--lg-line); box-shadow: 0 1px 12px rgba(0, 0, 0, .04); }
.header-content { width: min(100%, 720px); min-height: 54px; padding: 0 22px; }
header h1 { color: var(--lg-text); font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.back-link { min-height: 36px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: var(--lg-pill); color: var(--lg-meta); font-size: 13px; font-weight: 550; text-decoration: none; transition: background .2s cubic-bezier(.25, 1, .5, 1), color .2s cubic-bezier(.25, 1, .5, 1), transform .1s ease-out; }
.back-link:hover { background: rgba(0, 0, 0, .05); color: var(--lg-text); transform: none; }
.back-link:active { transform: scale(.97); }
.legal-header-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.header-tool-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(0, 113, 227, .16);
    border-radius: var(--lg-pill);
    background: rgba(0, 113, 227, .08);
    color: var(--lg-accent-link) !important;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    transition: background .2s cubic-bezier(.25, 1, .5, 1), transform .1s ease-out;
}
.header-tool-link:hover { background: rgba(0, 113, 227, .14); color: var(--lg-accent-link) !important; transform: translateY(-1px); }
.header-tool-link:active { transform: scale(.97); }

main { width: min(100%, 720px); margin: 0 auto; padding: clamp(38px, 6vw, 64px) 22px; }
.policy-container,
.terms-container { padding: clamp(24px, 5vw, 46px); border-radius: 22px; background: var(--lg-surface); box-shadow: var(--lg-panel); }
.policy-header,
.terms-header { margin: 0 0 clamp(30px, 5vw, 44px); padding: 0 0 22px; border-bottom: 1px solid var(--lg-line); text-align: left; }
.policy-header h2,
.terms-header h2 { color: var(--lg-text); font-size: clamp(28px, 5vw, 42px); font-weight: 700; letter-spacing: -.035em; line-height: 1.12; }
.policy-header .subtitle,
.terms-header .subtitle { margin-top: 11px; color: var(--lg-meta); font-size: 14px; line-height: 1.6; }
.policy-section,
.terms-section { margin: 0; padding: 27px 0; border-bottom: 1px solid var(--lg-line); }
.policy-section h3,
.terms-section h3 { display: block; margin: 0 0 14px; padding: 0; border: 0; color: var(--lg-text); font-size: 18px; font-weight: 650; letter-spacing: -.015em; line-height: 1.4; }
.policy-section h3::before,
.terms-section h3::before { display: none; }
.policy-section p,
.terms-section p,
.policy-section li,
.terms-section li { color: var(--lg-body); font-size: 16px; line-height: 1.85; }
.policy-section p,
.terms-section p { margin: 0 0 14px; }
.policy-section ul,
.terms-section ul,
.terms-section ol { margin: 14px 0; padding-left: 1.4em; }
.policy-section li,
.terms-section li { margin: 7px 0; padding-left: .2em; }
.policy-section a,
.terms-section a { color: var(--lg-accent-link) !important; text-underline-offset: 3px; }
.terms-section h4 { margin: 20px 0 9px !important; color: var(--lg-text) !important; font-size: 15px !important; font-weight: 650; letter-spacing: -.01em; }

.highlight,
.info-box,
.success-box,
.warning-box,
.update-info { margin: 20px 0 0; padding: 16px 18px; border: 1px solid var(--lg-line); border-left: 0; border-radius: 12px; background: var(--lg-hover); }
.highlight { background: rgba(0, 113, 227, .06); border-color: rgba(0, 113, 227, .16); }
.info-box { background: rgba(0, 113, 227, .06); border-color: rgba(0, 113, 227, .16); }
.success-box { background: rgba(48, 209, 88, .07); border-color: rgba(48, 209, 88, .18); }
.warning-box { background: rgba(255, 107, 0, .08); border-color: rgba(255, 107, 0, .2); }
.highlight p,
.info-box p,
.success-box p,
.warning-box p,
.update-info p { margin: 0; color: var(--lg-body); font-size: 14px; line-height: 1.7; }
.update-info { margin-top: 27px; background: var(--lg-hover); }
.update-info h4 { margin: 0 0 5px; color: var(--lg-text); font-size: 14px; font-weight: 650; }

.terms-table { width: 100%; margin: 20px 0 0; overflow: hidden; border: 1px solid var(--lg-line); border-collapse: separate; border-spacing: 0; border-radius: 12px; color: var(--lg-body); font-size: 14px; }
.terms-table th { background: var(--lg-hover); color: var(--lg-text); font-weight: 650; }
.terms-table th,
.terms-table td { padding: 13px 14px; border: 0; border-bottom: 1px solid var(--lg-line); text-align: left; line-height: 1.55; }
.terms-table tr:last-child td { border-bottom: 0; }
.terms-table th + th,
.terms-table td + td { border-left: 1px solid var(--lg-line); }

footer { margin: 0; padding: 0 22px 22px; border-top: 1px solid var(--lg-line); background: var(--lg-surface); color: var(--lg-meta); }
.footer-inner,
.footer-bottom { width: min(100%, 720px); margin: 0 auto; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(250px, .9fr); gap: 36px; align-items: start; padding: 32px 0 26px; }
.footer-brand { display: inline-flex; align-items: center; color: var(--lg-text); font-size: 16px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }
.footer-brand:hover { color: var(--lg-accent-link); }
.footer-tagline { max-width: 300px; margin: 10px 0 0; color: var(--lg-meta); font-size: 13px; line-height: 1.65; }
.footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 20px; margin: 0; }
.footer-nav a { display: inline-flex; align-items: center; min-height: 36px; color: var(--lg-meta); font-size: 13px; text-decoration: none; transition: color .2s cubic-bezier(.25, 1, .5, 1), background .2s cubic-bezier(.25, 1, .5, 1); }
.footer-nav a:hover { color: var(--lg-accent-link); }
.footer-nav a:focus-visible,
.footer-author-link:focus-visible { outline: 2px solid rgba(0, 113, 227, .45); outline-offset: 3px; }
.footer-nav span { margin-left: 5px; color: var(--lg-accent-link); font-size: 12px; }
.footer-nav .footer-tool-link { width: max-content; padding: 0 11px; border: 1px solid rgba(0, 113, 227, .16); border-radius: var(--lg-pill); background: rgba(0, 113, 227, .06); color: var(--lg-accent-link) !important; font-weight: 650; }
.footer-nav .footer-tool-link:hover { background: rgba(0, 113, 227, .12); color: var(--lg-accent-link) !important; }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0 0; border-top: 1px solid var(--lg-line); color: var(--lg-faint); font-size: 12px; line-height: 1.5; }
.footer-author-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 13px; border: 1px solid rgba(0, 113, 227, .18); border-radius: var(--lg-pill); background: rgba(0, 113, 227, .06); color: var(--lg-accent-link) !important; font-weight: 650; text-decoration: none; transition: background .2s cubic-bezier(.25, 1, .5, 1), transform .1s ease-out; }
.footer-author-link:hover { background: rgba(0, 113, 227, .12); transform: translateY(-1px); }
.footer-author-link span { margin-left: 5px; font-size: 12px; }
.footer-author-link:active { transform: scale(.97); }

@media (max-width: 680px) {
    .header-content, main { padding-left: 16px; padding-right: 16px; }
    .policy-container, .terms-container { padding: 24px 20px; border-radius: 18px; }
    .legal-header-actions { gap: 4px; }
    .header-tool-link { min-height: 34px; padding: 0 9px; font-size: 12px; }
    footer { padding-left: 16px; padding-right: 16px; }
    .footer-inner { grid-template-columns: 1fr; gap: 24px; padding: 28px 0 22px; }
    .footer-nav { gap: 2px 16px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 14px; }
    .footer-author-link { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .2s !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
@media (prefers-reduced-transparency: reduce) { body > header { background: var(--lg-surface); backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media (prefers-contrast: more) { body > header, .policy-container, .terms-container, .highlight, .info-box, .success-box, .warning-box, .update-info, .terms-table { border-color: rgba(0, 0, 0, .35); } }
