/* ==========================================================================
   Habit Connect · legal pages (Privacy Policy, Terms)
   ========================================================================== */

body { font-size: 16px; line-height: 1.65; }
.doc a, .legal-top .lead a { color: var(--green-strong); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Top: title + visual ---------- */
.legal-top {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; align-items: center;
  padding: 56px 0 48px; border-bottom: 1px solid var(--border);
}
.legal-top .eyebrow { margin-bottom: 16px; }
.legal-top h1 { font-size: clamp(42px, 6vw, 68px); line-height: 1; margin-bottom: 14px; }
.legal-top .lead { font-size: 18px; max-width: 44ch; }
.updated { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* Privacy visual */
.pv { display: grid; gap: 12px; }
.pv-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow-lg); }
.pv-profile { display: flex; align-items: center; gap: 12px; }
.pv-av { width: 44px; height: 44px; border-radius: 50%; position: relative; flex-shrink: 0; }
.pv-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.pv-lock {
  position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--green); display: grid; place-items: center; border: 3px solid var(--surface);
}
.pv-lock svg { width: 10px; height: 10px; color: var(--green-ink); }
.pv-profile b { display: block; font-weight: 800; font-size: 15px; }
.pv-profile small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.pv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 14px; font-weight: 700; }
.pv-row + .pv-row { border-top: 1px solid var(--border); }
.pv-row span { display: flex; align-items: center; gap: 8px; }
.pv-row .toggle { transform: scale(.86); transform-origin: right center; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pv-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800;
  padding: 7px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.pv-chip svg { width: 13px; height: 13px; color: var(--green-strong); }

/* ---------- Document body ---------- */
.doc { max-width: 720px; margin: 0 auto; padding: 40px 24px 80px; }
.doc h2 { font-size: 28px; line-height: 1.15; margin: 44px 0 12px; scroll-margin-top: 90px; }
.doc p { margin: 0 0 14px; }
.doc ul { padding-left: 22px; margin: 0 0 14px; }
.doc li { margin: 6px 0; }
.doc strong { font-weight: 800; }

.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; margin: 6px 0 18px; }
.table-scroll { overflow-x: auto; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.doc tr:last-child td { border-bottom: 0; }
.doc th {
  font-stretch: 125%; color: var(--muted); font-weight: 800; font-size: 11px;
  text-transform: uppercase; letter-spacing: .14em; background: var(--surface-2);
}
.doc td:last-child { color: var(--muted); }

/* Unfilled draft values; remove once every placeholder is filled */
mark.todo { background: var(--todo); color: var(--todo-ink); padding: 0 4px; border-radius: 4px; }

@media (max-width: 860px) {
  .legal-top { grid-template-columns: 1fr; padding: 36px 0 40px; gap: 32px; }
  .pv { max-width: 400px; }
}
@media (max-width: 520px) {
  .doc { padding: 32px 16px 64px; }
  .nav-link { display: none; }
}

/* Content Rules visual: a kind comment with its ••• menu open */
.cr { display: grid; gap: 12px; }
.cr-card { padding: 14px 16px; }
.cr-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.cr-row img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.cr-text { flex: 1; color: var(--muted); }
.cr-text b { color: var(--text); font-weight: 800; }
.cr-dots { color: var(--muted); font-weight: 900; letter-spacing: 1px; padding: 2px 8px; border-radius: 8px; background: var(--surface-2); }
.cr-menu {
  margin: 12px 0 0 auto; width: 160px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px; display: grid; gap: 2px;
}
.cr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; font-size: 14px; font-weight: 700; }
.cr-item svg { width: 16px; height: 16px; color: var(--coral); }
.cr-item:first-child { background: var(--surface); }
.cr-item + .cr-item svg { color: var(--muted); }

/* Terms visual: Free vs Pro at a glance */
.tv { display: grid; gap: 12px; }
.tv-plans { display: grid; gap: 10px; padding: 14px; }
.tv-plan { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.tv-plan--pro { border-color: var(--violet); background: var(--violet-soft); }
.tv-name { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.tv-plan--pro .tv-name .pro { display: none; }
.tv-plan b { display: block; font-size: 15px; font-weight: 800; margin: 4px 0 10px; }
.tv-bars { display: flex; gap: 5px; }
.tv-bars i { flex: 1; height: 8px; border-radius: 4px; background: var(--green); }
.tv-bars i.is-lock { background: transparent; border: 1.5px dashed var(--dim); }
