/* Policies page: header, sidebar and title stay put; only the grey sections scroll. */
.policies {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.policies > header {
  position: relative;
  padding: clamp(18px, 3.4vh, 38px) var(--gutter) clamp(28px, 5vh, 56px);
  text-align: center;
}
.policies > header h1 {
  margin: 0;
  font-size: clamp(17px, 1.6vw, 24px);
  font-weight: 400;
  line-height: 1.4;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  column-gap: clamp(24px, 4vw, 64px);
  min-height: 0;
}

.doc-nav { min-height: 0; overflow-y: auto; padding-bottom: 24px; }
.doc-nav ul { margin: 0; padding: 0; list-style: none; max-width: 230px; }
.doc-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-body);
  text-decoration: none;
}
.doc-nav a:hover { color: var(--text); background: var(--panel); }
.doc-nav a[aria-current="page"] { color: var(--text); background: var(--panel-active); }

.doc { max-width: 800px; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.doc-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 4px 16px;
}
.doc-head h2 { margin: 0; font-size: clamp(20px, 1.6vw, 25px); font-weight: 500; }
.doc-meta { display: flex; gap: 10px; font-size: 12px; color: var(--text-dim); }
.doc-meta time { color: var(--text); }
.doc-meta { align-items: center; flex-wrap: wrap; }
.doc-meta .state-pill { margin-left: 4px; border: 0; background: var(--panel-active); }
.doc-meta .state-pill[data-state="draft"]::before { background: var(--amber); }

.doc-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 48px;
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}
.doc-body:focus-visible { outline-offset: -2px; }
/* Oliver, 29 Oct 2026, the site in the topic pages' style: sections stand on the page ground, ruled. */
.doc-section {
  background: transparent;
  border-top: 1px solid var(--border);
  border-radius: 0;
  padding: clamp(20px, 2.4vw, 32px) 0;
  margin-bottom: 0;
}
.doc-section h2 { margin: 0 0 16px; font-size: 17px; font-weight: 500; letter-spacing: -0.01em; color: var(--text); }
.doc-section h3 { margin: 18px 0 2px; font-size: 13px; font-weight: 400; color: var(--text-body); }
.doc-section h3 + p { margin-top: 0; }
.doc-section p { margin: 0 0 14px; font-size: 13px; line-height: 1.55; color: var(--text-body); }
.doc-section p:last-child { margin-bottom: 0; }
.doc-empty { color: var(--text-body); font-size: 14px; padding: 24px 4px; }

/* Tables in a policy (suppliers, lawful bases, retention): banded rows, no rules. */
.doc-table { margin: 4px 0 16px; overflow-x: auto; }
.doc-table:last-child { margin-bottom: 0; }
.doc-table table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: 12.5px; line-height: 1.5; }
.doc-table th, .doc-table td { padding: 9px 12px; text-align: left; vertical-align: top; color: var(--text-body); }
.doc-table thead th { padding-top: 0; padding-bottom: 2px; font-weight: 400; font-size: 12px; color: var(--text-dim); }
.doc-table tbody th, .doc-table tbody td { background: var(--panel-raised); }
.doc-table tbody th { font-weight: 500; color: var(--text); }
.doc-table tbody tr > :first-child { border-radius: var(--radius-small) 0 0 var(--radius-small); }
.doc-table tbody tr > :last-child { border-radius: 0 var(--radius-small) var(--radius-small) 0; }

/* Phone: each row becomes a block, every value under its column name. */
@media (max-width: 760px) {
  .doc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .doc-table table, .doc-table tbody, .doc-table tr, .doc-table th, .doc-table td { display: block; }
  .doc-table tr { margin-bottom: 6px; padding: 10px 12px; background: var(--panel-raised); border-radius: var(--radius-small); }
  .doc-table tbody th, .doc-table tbody td { padding: 0 0 8px; background: none; border-radius: 0; }
  .doc-table tbody tr > :last-child { padding-bottom: 0; }
  .doc-table td::before { content: attr(data-col); display: block; font-size: 11.5px; color: var(--text-dim); }
}

@media (max-width: 860px) {
  .doc { width: auto; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); row-gap: 16px; }
  .doc-nav { overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; }
  .doc-nav ul { display: flex; gap: 4px; max-width: none; }
  .doc-nav a { white-space: nowrap; }
  .policies > header { padding-left: calc(var(--gutter) + 40px); padding-right: calc(var(--gutter) + 40px); }
}

/* 18 Oct 2026: the page now sits under the shared site header. */
.policies { display: grid; grid-template-rows: auto minmax(0, 1fr); height: calc(100dvh - var(--nav-height)); }
.policies > header { display: none; }
.policies-head { display: grid; gap: 10px; padding: clamp(28px, 4vw, 48px) 0 clamp(20px, 3vw, 32px); }
.workspace { padding-left: 0; padding-right: 0; }
.doc { width: auto; }
.not-found-body { display: grid; gap: 16px; padding: clamp(64px, 12vw, 160px) 0; max-width: 560px; }

/* Phone: the policy text flows down the page instead of scrolling inside a fixed-height box. */
@media (max-width: 760px) {
  .policies { height: auto; display: block; }
  .policies .doc-nav { max-width: 100%; }
  .policies .workspace, .policies .doc { height: auto; min-height: 0; display: block; }
  .policies .doc-body { overflow: visible; height: auto; }
}

.doc-kicker { font-size: 13px; color: var(--text-dim); }
.doc-nav a[aria-current="page"] { color: var(--text); }

.policies { grid-template-columns: minmax(0, 1fr); }
