/* A shared reading layout for every policy, in both portal roles. */
.policy-page { background: #f3f6fb; color: #334155; font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.75; }
.policy-page .main { background: #f3f6fb; }
.policy-page .policy-header { position: relative; top: auto; background: #fff; color: #0f172a; padding: 0; border-bottom: 1px solid #e2e8f0; box-shadow: none; z-index: 1; }
.policy-page .header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: auto; padding: 22px 28px; gap: 24px; }
.policy-header-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.policy-page .brand-logo { width: 48px; height: 48px; flex-shrink: 0; object-fit: contain; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 4px; }
.policy-header-text { min-width: 0; }
.policy-brand-name { display: block; color: #64748b; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.policy-page .policy-header h1 { font-size: 21px; line-height: 1.35; margin: 3px 0 0; color: #0f172a; letter-spacing: -.3px; overflow-wrap: anywhere; }
.policy-header-actions { flex-shrink: 0; }
.policy-page .policy-header .back-btn { background: #eff6ff !important; color: #1d4ed8 !important; border: 1px solid #bfdbfe; border-radius: 10px !important; padding: 11px 15px !important; font-size: 13px !important; font-weight: 700 !important; white-space: nowrap; }
.policy-page .policy-header .back-btn:hover { background: #dbeafe !important; }
.policy-page a:focus-visible { outline: 3px solid #60a5fa; outline-offset: 3px; border-radius: 4px; }
.policy-page .policy-hero { padding: 42px 28px; text-align: left; background: linear-gradient(120deg, #172554, #1e40af); color: white; border: 0; }
.policy-eyebrow { display: block; font-size: 11px; font-weight: 700; letter-spacing: 1.8px; color: #bfdbfe; margin-bottom: 12px; }
.policy-page .policy-hero h2 { color: white; font-size: clamp(26px, 3vw, 36px); line-height: 1.25; margin: 0 0 12px; letter-spacing: -.6px; }
.policy-page .policy-hero p { color: #dbeafe; font-size: 15px; line-height: 1.7; max-width: 740px; margin: 0; }
.policy-page .effective { display: inline-block; margin-top: 20px; padding: 6px 12px; border: 1px solid #ffffff40; border-radius: 8px; background: #ffffff12; color: #eff6ff; font-size: 12px; font-weight: 600; }
.policy-page .main > .container { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; width: 100%; max-width: 1200px; gap: 24px; padding: 0 28px; margin: 28px auto 48px; }
.policy-page .main > .container.policy-without-toc { grid-template-columns: minmax(0, 1fr); }
.policy-page .toc { position: sticky; top: 24px; padding: 20px; border: 1px solid #e2e8f0; border-radius: 14px; background: #fff; box-shadow: 0 4px 16px #0f172a04; max-height: calc(100vh - 48px); overflow-y: auto; }
.policy-page .toc h3 { color: #0f172a; font-size: 15px; margin: 0 0 12px; }
.policy-page .toc a { display: block; padding: 9px 0; color: #475569; font-size: 12px; line-height: 1.55; border-bottom: 1px solid #f1f5f9; text-decoration: none; }
.policy-page .toc a:hover { color: #1d4ed8; }
.policy-page .content { padding: 32px; background: white; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 6px 24px #0f172a04; min-width: 0; }
.policy-page .content section { margin: 0 0 28px; scroll-margin-top: 24px; }
.policy-page .content section + section { padding-top: 24px; border-top: 1px solid #f1f5f9; }
.policy-page .content h2, .policy-page .content .section h3 { color: #172554; font-size: 21px; line-height: 1.4; margin: 0 0 12px; letter-spacing: -.2px; }
.policy-page .content p, .policy-page .content li { color: #475569; font-size: 15px; line-height: 1.8; }
.policy-page .content p { margin: 0 0 12px; }
.policy-page .content ul, .policy-page .content ol { padding-left: 24px; }
.policy-page .intro, .policy-page .notice { background: #eff6ff; border-left: 4px solid #2563eb; border-radius: 10px; padding: 18px; margin: 0 0 28px; }
.policy-page .company-box, .policy-page .contact, .policy-page .acceptance { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; }
.policy-page .policy-footer { margin-top: auto; padding: 30px 28px 24px; background: #0f172a; color: #e2e8f0; text-align: left; }
.policy-footer-inner { max-width: 1144px; margin: auto; }
.policy-footer-identity { display: flex; align-items: center; gap: 12px; }
.policy-footer-identity img { border-radius: 10px; object-fit: contain; background: #fff; padding: 4px; flex-shrink: 0; }
.policy-page .footer-brand { color: #f8fafc; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.policy-page .footer-company { color: #94a3b8; font-size: 12px; margin: 3px 0 0; }
.policy-page .footer-links { display: flex; justify-content: flex-start; flex-wrap: wrap; gap: 12px 20px; margin: 24px 0; }
.policy-page .policy-footer a { color: #cbd5e1; text-decoration: none; font-size: 12px; overflow-wrap: anywhere; }
.policy-page .policy-footer a:hover { color: #fff; text-decoration: underline; }
.policy-footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid #334155; padding-top: 18px; }
.policy-page .copyright { border: 0; padding: 0; margin: 0; font-size: 11px; color: #94a3b8; }
@media (max-width: 1100px) {
 .policy-page .main > .container { grid-template-columns: minmax(0, 1fr) !important; }
 .policy-page .toc { position: static; max-height: 260px; }
}
@media (max-width: 600px) {
 .policy-page .header-inner { padding: 18px 16px; flex-wrap: wrap; gap: 16px; }
 .policy-header-brand { width: 100%; }
 .policy-page .policy-header h1 { font-size: 18px; }
 .policy-page .brand-logo { width: 44px; height: 44px; }
 .policy-brand-name { font-size: 11px; }
 .policy-header-actions { width: 100%; }
 .policy-page .policy-hero { padding: 28px 18px; }
 .policy-page .policy-hero p { font-size: 14px; }
 .policy-page .main > .container { padding: 0 12px; margin: 18px auto 28px; gap: 16px; }
 .policy-page .toc { padding: 16px; max-height: 220px; }
 .policy-page .content { padding: 22px 18px; border-radius: 12px; }
 .policy-page .content h2, .policy-page .content .section h3 { font-size: 19px; }
 .policy-page .content p, .policy-page .content li { font-size: 14px; }
 .policy-page .policy-footer { padding: 26px 18px; }
 .policy-page .footer-links { gap: 12px 16px; }
 .policy-page .footer-brand { font-size: 14px; }
}

/* Admin policy history must fit the same narrow reading area. */
.policy-page .policy-editor-toolbar { min-width: 0; padding: 0 12px; overflow-wrap: anywhere; }
.policy-page .policy-version-stats, .policy-page .policy-version-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); }
.policy-page .policy-version-row > div { min-width: 0; }

/* Compact policy chrome applies only to phones. */
@media (max-width: 600px) {
 .policy-page .policy-header { position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 10px #0f172a0d; }
 .policy-page .header-inner { flex-wrap: nowrap; gap: 8px; padding: 6px 12px; }
 .policy-page .policy-header-brand { flex: 1 1 0; width: auto; gap: 8px; }
 .policy-page .policy-header-text { flex: 1; }
 .policy-page .brand-logo { width: 28px; height: 28px; border-radius: 7px; padding: 2px; }
 .policy-page .policy-brand-name { display: none; }
 .policy-page .policy-header h1 { font-size: 13px; line-height: 1.35; margin: 0; }
 .policy-page .policy-header-actions { width: auto; flex: 0 0 auto; margin-left: auto; }
 .policy-page .policy-header .back-btn { padding: 6px 8px !important; font-size: 10px !important; border-radius: 7px !important; line-height: 1.4; }
 .policy-page .content section, .policy-page .content > h2 { scroll-margin-top: 90px; }
 .policy-page .policy-footer { width: 100%; padding: 14px 12px 12px; }
 .policy-page .policy-footer-identity { display: none; }
 .policy-page .footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, auto); gap: 6px 8px; margin: 0 0 10px; text-align: center; }
 .policy-page .footer-links a { display: flex; align-items: center; justify-content: center; min-height: 30px; font-size: 11px; line-height: 1.4; }
 .policy-page .policy-footer-bottom { display: block; padding-top: 8px; text-align: center; }
 .policy-page .policy-footer-bottom > a { display: none; }
 .policy-page .copyright { font-size: 9px; line-height: 1.5; }
 html[data-portal-shell="admin"] body.policy-page .portal-main { margin-left: 0 !important; width: 100% !important; }
 html[data-portal-shell="admin"] .policy-page #portal-sidebar { display: none !important; }
}

/* Contact uses the policy chrome while retaining its working enquiry form. */
.contact-policy-page .policy-header { display: block; max-width: none; margin: 0; padding-left: 0 !important; }
.contact-policy-page .policy-header .back-btn { display: inline-flex; align-items: center; }
.contact-policy-page .contact-grid { width: 100%; max-width: 740px; }
.contact-policy-page .content h3 { color: #172554; }
.contact-policy-page .btn { background: #2563eb; }
.contact-policy-page .btn:hover { background: #1d4ed8; }
.contact-policy-page .row > div { min-width: 0; }

.contact-policy-page .footer-links { flex-direction: row; }

/* Match policy and Contact Us chrome heights on phones only. */
@media (max-width: 600px) {
 .policy-page .policy-header { height: 64px; }
 .policy-page .header-inner { height: 100%; padding: 10px 12px; }
 .policy-page .brand-logo { width: 32px; height: 32px; }
 .policy-page .policy-footer { height: 136px; display: flex; align-items: center; }
 .policy-page .policy-footer-inner { width: 100%; }
 .policy-page .footer-links { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: repeat(2, 32px); }
 .policy-page .footer-links a[href*="terms"] { white-space: nowrap; overflow-wrap: normal; font-size: clamp(10px, 2.8vw, 11px); }
}
