/* Legal pages: light theme only, matches in-app WebView + static hosting */
:root {
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

html {
    background: #fff;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
    background: #fff;
    color: #111;
    min-height: 100%;
    padding-bottom: 2rem;
}

html[dir="rtl"] body,
html[dir="rtl"] .legal-body {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .legal-topbar {
    direction: rtl;
}

html[dir="rtl"] .legal-back {
    margin: -8px -8px -8px 0;
}

.legal-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
}

.legal-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 8px 12px 8px 8px;
    margin: -8px 0 -8px -8px;
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
}

.legal-back:hover {
    background: #f3f3f3;
    color: #000;
}

.legal-back:focus {
    outline: none;
}

.legal-back:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

article.legal-body {
    max-width: 44rem;
    margin: 0 auto;
    padding: 1.25rem 1rem 2rem;
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

article.legal-body h1 {
    font-size: 1.5rem;
    margin-top: 0;
    color: #111;
}

article.legal-body h2 {
    font-size: 1.1rem;
    margin-top: 1.75rem;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.25rem;
    color: #111;
}

article.legal-body a {
    color: #0b5cad;
}

article.legal-body a:visited {
    color: #5b21b6;
}

.contact-box {
    font-size: 0.9rem;
    background: #f5f5f5;
    color: #111;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid #eee;
}

.contact-box a {
    color: #0b5cad;
}

ul {
    padding-left: 1.25rem;
}
