/* ZavTech Privacy & Terms — Google Privacy & Terms inspired layout */
:root,
:root[data-theme="dark"] {
  --bg: #131314;
  --surface: #1b1c1d;
  --surface-elevated: #232426;
  --border: #3c4043;
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --accent: #8ab4f8;
  --accent-soft: rgba(138, 180, 248, 0.14);
  --badge-bg: #1b2820;
  --badge-border: #346240;
  --badge-text: #a8dab5;
  --code-bg: #282a2c;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --surface-elevated: #f1f3f4;
  --border: #dadce0;
  --text: #202124;
  --text-muted: #5f6368;
  --accent: #1a73e8;
  --accent-soft: rgba(26, 115, 232, 0.1);
  --badge-bg: #eef7f0;
  --badge-border: #b7dfc0;
  --badge-text: #137333;
  --code-bg: #f1f3f4;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Google Sans", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  background: var(--code-bg);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

/* Sticky Top Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 28px 6px;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 22px;
  letter-spacing: -0.2px;
}

.brand-title strong {
  font-weight: 700;
  color: var(--text);
}

.brand-title span {
  font-weight: 400;
  color: var(--text-muted);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  background: var(--surface-elevated);
  border-color: var(--accent);
}

.tab-nav {
  display: flex;
  gap: 28px;
  padding: 6px 28px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-nav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 2px 12px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab-nav a:hover {
  color: var(--text);
}

.tab-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Two-column Google Policies Layout */
.layout {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: calc(100vh - 104px);
}

.sidebar {
  border-right: 1px solid var(--border);
  padding: 24px 16px 40px 24px;
  position: sticky;
  top: 104px;
  height: calc(100vh - 104px);
  overflow-y: auto;
}

.sidebar-group {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-group li {
  margin: 2px 0;
}

.sidebar-group a {
  display: block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}

.sidebar-group a:hover,
.sidebar-group a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.sidebar-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

.content {
  max-width: 800px;
  padding: 40px 48px 96px;
}

/* Accurate anchor offset so section start lands cleanly below sticky header */
section[id],
h2[id],
h3[id] {
  scroll-margin-top: 124px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}

.meta-line {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.meta-line button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.meta-line button:hover {
  text-decoration: underline;
}

.country-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.hero-lead {
  font-size: 18px;
  font-weight: 500;
  color: var(--text);
  margin: 16px 0 8px;
}

h1 {
  font-size: 28px;
  line-height: 1.3;
  font-weight: 500;
  margin: 8px 0 20px;
  color: var(--text);
}

h2 {
  font-size: 22px;
  line-height: 1.35;
  font-weight: 500;
  margin: 44px 0 14px;
  padding-top: 6px;
  color: var(--text);
}

h3 {
  font-size: 16.5px;
  font-weight: 600;
  margin: 24px 0 10px;
  color: var(--text);
}

p {
  margin: 0 0 14px;
  color: var(--text-muted);
}

p strong,
li strong {
  color: var(--text);
}

ul,
ol {
  margin: 0 0 18px;
  padding-left: 22px;
  color: var(--text-muted);
}

li {
  margin-bottom: 8px;
}

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 22px;
  margin: 22px 0 28px;
}

.callout.entity {
  background: var(--badge-bg);
  border-color: var(--badge-border);
}

.callout.entity h3 {
  margin-top: 0;
  color: var(--badge-text);
}

.app-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 14px;
}

.app-table th,
.app-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.app-table th {
  color: var(--text);
  font-weight: 600;
  background: var(--surface);
}

.app-table td {
  color: var(--text-muted);
}

.footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
  }

  .sidebar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sidebar-divider {
    display: none;
  }

  .content {
    padding: 28px 20px 64px;
  }

  .brand-row,
  .tab-nav {
    padding-left: 20px;
    padding-right: 20px;
  }

  section[id],
  h2[id],
  h3[id] {
    scroll-margin-top: 118px;
  }
}

@media print {
  :root,
  :root[data-theme="dark"],
  :root[data-theme="light"] {
    --bg: #ffffff;
    --surface: #f8f9fa;
    --border: #d0d7de;
    --text: #111111;
    --text-muted: #333333;
    --accent: #0b57d0;
  }

  .top-header,
  .sidebar {
    display: none !important;
  }

  .layout {
    display: block;
  }

  .content {
    max-width: 100%;
    padding: 0;
  }
}
