:root{
  --bg:#f6f7f9;
  --surface:#fff;
  --soft:#fafbfc;
  --text:#111827;
  --muted:#667085;
  --line:#e4e7ec;
  --brand:#c99a35;
  --success:#067647;
  color-scheme:light;
}
html[data-theme="dark"]{
  --bg:#090e16;
  --surface:#111827;
  --soft:#0d131c;
  --text:#f8fafc;
  --muted:#98a2b3;
  --line:#273244;
  --brand:#d6ad51;
  color-scheme:dark;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0!important;
  min-height:100vh!important;
  background:
    radial-gradient(circle at 92% 0%,rgba(201,154,53,.10),transparent 28%),
    var(--bg)!important;
  color:var(--text)!important;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
  visibility:visible!important;
  opacity:1!important;
}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}
.container{width:min(1160px,calc(100% - 32px));margin-inline:auto}
.brand{display:inline-flex;align-items:center;gap:10px}
.brand-logo{
  width:48px!important;
  height:48px!important;
  min-width:48px!important;
  min-height:48px!important;
  max-width:48px!important;
  max-height:48px!important;
  object-fit:contain!important;
  border-radius:50%;
}
.brand span{font-size:14px;font-weight:800;white-space:nowrap}
.btn{
  min-height:42px;display:inline-flex!important;align-items:center;justify-content:center;
  padding:0 14px;border:1px solid var(--line);border-radius:11px;
  background:var(--surface);color:var(--text);font-size:12px;font-weight:800;
}
.btn.primary{background:#111827;color:#fff;border-color:#111827}
html[data-theme="dark"] .btn.primary{background:#f8fafc;color:#111827;border-color:#f8fafc}
.eyebrow{
  display:inline-flex;margin-bottom:13px;color:#a4771e;font-size:11px;
  font-weight:850;text-transform:uppercase;letter-spacing:.12em
}
html[data-theme="dark"] .eyebrow{color:#e0bb68}

/* Header/footer */
.legal-header,.privacy-header{
  position:sticky;top:0;z-index:30;background:color-mix(in srgb,var(--surface) 94%,transparent);
  backdrop-filter:blur(12px);border-bottom:1px solid var(--line)
}
.legal-header-inner,.privacy-header-inner{
  min-height:76px;display:flex!important;align-items:center;justify-content:space-between;gap:16px
}
.legal-footer,.privacy-footer{border-top:1px solid var(--line);background:var(--surface)}
.legal-footer-inner,.privacy-footer-inner{
  min-height:78px;display:flex!important;align-items:center;justify-content:space-between;
  gap:18px;color:var(--muted);font-size:13px
}
.legal-footer-links,.privacy-footer-links{display:flex!important;gap:16px;flex-wrap:wrap}
.legal-footer a,.privacy-footer a{font-weight:700}

/* Main must always be visible */
.legal-main,.privacy-main{
  display:block!important;visibility:visible!important;opacity:1!important;
  position:relative!important;height:auto!important;min-height:500px!important;
  overflow:visible!important;padding:64px 0 88px!important
}
.legal-wrap,.privacy-wrap{display:block!important;max-width:1160px!important}
.legal-hero,.privacy-hero{
  display:block!important;visibility:visible!important;opacity:1!important;
  max-width:860px;margin:0 0 42px!important
}
.legal-hero h1,.privacy-hero h1{
  display:block!important;margin:0!important;font-size:clamp(38px,6.5vw,72px)!important;
  line-height:1!important;letter-spacing:-.05em!important;color:var(--text)!important
}
.legal-hero>p,.privacy-hero>p{
  display:block!important;margin:20px 0 17px!important;color:var(--muted)!important;
  font-size:17px!important;line-height:1.8!important
}
.legal-meta,.privacy-meta{
  display:flex!important;flex-wrap:wrap;gap:10px 18px;color:var(--muted);font-size:12px
}

/* Grid/content */
.legal-grid,.privacy-grid{
  display:grid!important;grid-template-columns:250px minmax(0,1fr)!important;
  gap:32px!important;align-items:start!important;visibility:visible!important;opacity:1!important
}
.legal-toc,.privacy-toc{
  display:grid!important;position:sticky;top:100px;gap:6px;padding:18px;
  background:var(--surface)!important;border:1px solid var(--line);border-radius:18px
}
.legal-toc strong,.privacy-toc strong{margin-bottom:6px}
.legal-toc a,.privacy-toc a{
  display:block!important;padding:9px 10px;border-radius:10px;color:var(--muted);font-size:13px
}
.legal-content,.privacy-content{
  display:grid!important;visibility:visible!important;opacity:1!important;gap:18px!important
}
.legal-card,.privacy-card{
  display:block!important;visibility:visible!important;opacity:1!important;
  position:relative!important;transform:none!important;
  scroll-margin-top:105px;background:var(--surface)!important;border:1px solid var(--line)!important;
  border-radius:22px!important;padding:30px 32px!important;box-shadow:0 16px 45px rgba(15,23,42,.045)
}
.legal-card.highlight,.privacy-contact-card{
  background:
    radial-gradient(circle at 92% 12%,rgba(201,154,53,.13),transparent 30%),
    var(--surface)!important
}
.legal-number,.privacy-number{
  display:inline-flex!important;min-width:36px;height:28px;align-items:center;justify-content:center;
  border-radius:999px;background:#111827;color:#fff;font-size:11px;font-weight:800;margin-bottom:14px
}
.legal-card h2,.privacy-card h2{
  display:block!important;margin:0 0 14px!important;color:var(--text)!important;
  font-size:28px!important;line-height:1.2!important
}
.legal-card h3,.privacy-card h3{margin:20px 0 8px;color:var(--text)}
.legal-card p,.privacy-card p,
.legal-card ul,.legal-card ol,.privacy-card ul,.privacy-card ol{
  display:block!important;visibility:visible!important;color:var(--muted)!important;
  font-size:15px!important;line-height:1.82!important
}
.legal-card p,.privacy-card p{margin:0 0 14px!important}
.legal-card ul,.legal-card ol,.privacy-card ul,.privacy-card ol{padding-left:22px}
.process-grid{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:16px
}
.process-step{
  display:block!important;padding:17px;border:1px solid var(--line);border-radius:16px;background:var(--soft)
}
.process-step b{display:block;margin-bottom:6px}
.process-step span{display:block;color:var(--muted);font-size:13px;line-height:1.55}
.legal-note,.privacy-note{
  display:grid!important;grid-template-columns:auto 1fr;gap:10px;padding:18px 20px;
  border-radius:16px;background:#111827;color:#fff;line-height:1.65
}
.legal-note span,.privacy-note span{color:#d5d9e1}

/* Privacy page class name compatibility */
.privacy-page{min-height:100vh}
.privacy-header,.privacy-main,.privacy-wrap,.privacy-hero,.privacy-grid,
.privacy-toc,.privacy-content,.privacy-card,.privacy-footer{
  visibility:visible!important;opacity:1!important
}

@media(max-width:850px){
  .legal-grid,.privacy-grid{grid-template-columns:1fr!important}
  .legal-toc,.privacy-toc{position:static}
  .process-grid{grid-template-columns:1fr}
}
@media(max-width:600px){
  .container{width:min(100% - 24px,1160px)}
  .legal-header-inner,.privacy-header-inner{min-height:66px}
  .brand-logo{width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important;max-width:42px!important;max-height:42px!important}
  .brand span{display:none}
  .legal-main,.privacy-main{padding:38px 0 62px!important}
  .legal-card,.privacy-card{padding:23px 19px!important}
  .legal-note,.privacy-note{grid-template-columns:1fr}
  .legal-footer-inner,.privacy-footer-inner{
    flex-direction:column;justify-content:center;padding:18px 0;text-align:center
  }
}


/* =========================================================
   Shared light/dark mode for legal pages
   Uses the same `mgbaku-theme` key as the main site.
   ========================================================= */

html[data-theme="light"]{
  --bg:#f6f7f9;
  --surface:#fff;
  --soft:#fafbfc;
  --text:#111827;
  --muted:#667085;
  --line:#e4e7ec;
  --brand:#c99a35;
  --success:#067647;
  color-scheme:light;
}

html[data-theme="dark"]{
  --bg:#090e16;
  --surface:#111827;
  --soft:#0d131c;
  --text:#f8fafc;
  --muted:#98a2b3;
  --line:#273244;
  --brand:#d6ad51;
  --success:#32d583;
  color-scheme:dark;
}

.legal-header-actions{
  display:flex;
  align-items:center;
  gap:9px;
}

.legal-theme-toggle{
  width:42px;
  height:42px;
  min-width:42px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--surface);
  color:var(--text);
  cursor:pointer;
  transition:
    border-color .18s ease,
    background .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}

.legal-theme-toggle:hover{
  transform:translateY(-1px);
  border-color:var(--brand);
  box-shadow:0 8px 22px rgba(15,23,42,.08);
}

.legal-theme-icon{
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.legal-theme-icon-sun{
  display:none;
}

html[data-theme="dark"] .legal-theme-icon-moon{
  display:none;
}

html[data-theme="dark"] .legal-theme-icon-sun{
  display:block;
}

html[data-theme="dark"] body{
  background:
    radial-gradient(circle at 92% 0%,rgba(201,154,53,.11),transparent 28%),
    linear-gradient(180deg,#090e16,#0b111b)!important;
}

html[data-theme="dark"] .legal-header,
html[data-theme="dark"] .privacy-header{
  background:rgba(17,24,39,.92);
  border-color:#273244;
}

html[data-theme="dark"] .legal-footer,
html[data-theme="dark"] .privacy-footer{
  background:#111827;
  border-color:#273244;
}

html[data-theme="dark"] .legal-card,
html[data-theme="dark"] .privacy-card,
html[data-theme="dark"] .legal-toc,
html[data-theme="dark"] .privacy-toc{
  background:#111827!important;
  border-color:#273244!important;
  box-shadow:0 18px 55px rgba(0,0,0,.20);
}

html[data-theme="dark"] .process-step{
  background:#0d131c;
  border-color:#273244;
}

html[data-theme="dark"] .legal-card.highlight,
html[data-theme="dark"] .privacy-contact-card{
  background:
    radial-gradient(circle at 92% 12%,rgba(214,173,81,.12),transparent 30%),
    #111827!important;
}

html[data-theme="dark"] .legal-number,
html[data-theme="dark"] .privacy-number{
  background:#f8fafc;
  color:#111827;
}

html[data-theme="dark"] .legal-note,
html[data-theme="dark"] .privacy-note{
  background:#0b111b;
  border:1px solid #273244;
}

html[data-theme="dark"] .legal-note span,
html[data-theme="dark"] .privacy-note span{
  color:#cbd5e1;
}

html[data-theme="dark"] .btn.secondary{
  background:#111827;
  color:#f8fafc;
  border-color:#344054;
}

html[data-theme="dark"] .btn.secondary:hover,
html[data-theme="dark"] .legal-theme-toggle:hover{
  border-color:var(--brand);
}

@media(max-width:600px){
  .legal-header-actions{
    gap:7px;
  }

  .legal-theme-toggle{
    width:38px;
    height:38px;
    min-width:38px;
    border-radius:10px;
  }

  .legal-theme-icon{
    width:18px;
    height:18px;
  }

  .legal-header-actions .btn.secondary{
    min-height:38px;
    padding:0 11px;
    font-size:11px;
  }
}
