/* BrewTunes legal pages — self-contained, aligned with the main product UI. */
:root {
  color-scheme: light;
  --bg: #faf6f1;
  --card: #ffffff;
  --soft: #f3ece2;
  --ink: #1f1a14;
  --muted: #5b5246;
  --subtle: #756b5f;
  --accent: #7a4f1d;
  --accent-soft: #f3e6d2;
  --line: #e4d9c8;
  --line-strong: #cfc0aa;
  --danger: #a72f2a;
  --focus: #2767c5;
  --shadow: 0 10px 34px rgba(60, 40, 18, .09);
  --radius: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #15110d;
    --card: #1d1813;
    --soft: #221c15;
    --ink: #f6efe2;
    --muted: #c8bca8;
    --subtle: #9f9588;
    --accent: #ffb469;
    --accent-soft: #2c2418;
    --line: #332a20;
    --line-strong: #4a3b2b;
    --danger: #ff8a82;
    --focus: #8bb8ff;
    --shadow: 0 12px 36px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; }
:where(a, button, input, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.wrap { max-width: 900px; margin: 0 auto; padding: 28px 24px 80px; }
header.legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
header.legal a.home {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
}

.langbar { display: inline-flex; gap: 4px; }
.langbar button {
  min-width: 48px;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}
.langbar button:first-child { border-radius: 10px 4px 4px 10px; }
.langbar button:last-child { border-radius: 4px 10px 10px 4px; }
.langbar button.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.pdfbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 30px;
  padding: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.pdfbar button {
  min-height: 44px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 750;
  font-size: 14px;
  border-radius: 10px;
}
.pdfbar button.secondary { background: var(--card); color: var(--accent); }
.pdfbar button:hover { filter: brightness(.95); }
.pdfbar button:disabled { opacity: .55; cursor: wait; }
.pdfbar-status { color: var(--subtle); font-size: 13px; line-height: 1.4; }
.pdfbar-status.error { color: var(--danger); font-weight: 650; }
@media (prefers-color-scheme: dark) {
  .langbar button.active,
  .pdfbar button { color: #1f1a14; }
  .pdfbar button.secondary { color: var(--accent); }
}

h1, h2, h3 {
  font-family: Fraunces, Georgia, "Times New Roman", serif;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(32px, 5vw, 44px); line-height: 1.12; letter-spacing: -.025em; margin: 22px 0 8px; }
h2 { font-size: clamp(22px, 3vw, 27px); line-height: 1.25; margin: 38px 0 10px; }
h3 { font-size: 19px; line-height: 1.35; }
p, li { color: var(--muted); }
li + li { margin-top: 6px; }
.meta { color: var(--subtle); font-size: 14px; margin: 0 0 28px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--card); }
th, td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: var(--soft); color: var(--ink); }
.placeholder {
  background: #fff3c4;
  color: #5a4500;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}
@media (prefers-color-scheme: dark) { .placeholder { background: #4d3f12; color: #ffe9a8; } }

footer.legal {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--subtle);
  font-size: 13px;
  line-height: 2;
}
footer.legal a { color: var(--accent); display: inline-block; }
ul, ol { padding-left: 1.4rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
[hidden] { display: none !important; }

@media (max-width: 620px) {
  .wrap { padding: 18px 16px 64px; }
  header.legal { align-items: stretch; }
  .langbar { width: 100%; }
  .langbar button { flex: 1; }
  .pdfbar { align-items: stretch; padding: 12px; }
  .pdfbar button, .pdfbar-status { width: 100%; }
  .card { padding: 20px 18px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  body { background: #fff; }
  .wrap { max-width: none; padding: 0; }
  .pdfbar { display: none !important; }
  .card { box-shadow: none; break-inside: avoid; }
}
