/* Privacy centre and policy pages (templates/policies/*). Colours come from
   the theme tokens; the gold accent is the dark-mode secondary. */
.pol-page { --pol-accent: var(--dm-secondary, var(--brand-alt)); max-width: 920px; margin: 0 auto; padding: 8px 16px 40px; color: var(--text); }
.pol-head { margin: 4px 0 16px; }
.pol-head h1 { margin: 2px 0 6px; font-size: 26px; font-weight: 700; color: var(--text); }
.pol-crumb { font-size: 12.5px; color: var(--text-soft); text-decoration: none; }
.pol-crumb:hover { text-decoration: underline; }
.pol-sub { margin: 0 0 8px; font-size: 14.5px; line-height: 1.8; color: var(--text-soft); }
.pol-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-soft); }
.pol-meta a { color: var(--brand); }
html.dark-mode .pol-meta a { color: var(--pol-accent); }
.pol-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 20px 22px; margin-bottom: 16px; }
.pol-card h2 { margin: 0 0 10px; font-size: 17px; font-weight: 700; color: var(--text); }
.pol-hint { font-size: 13px; color: var(--text-soft); line-height: 1.7; margin: 0 0 12px; }
.pol-foot { text-align: center; font-size: 13.5px; }

/* the document text */
.pol-doc { font-size: 14.5px; line-height: 1.95; color: var(--text); }
.pol-doc h3 { font-size: 15.5px; font-weight: 700; margin: 22px 0 8px; color: var(--text); padding-top: 14px; border-top: 1px solid var(--border); }
.pol-doc h3:first-of-type { border-top: 0; padding-top: 0; }
.pol-doc p { margin: 0 0 10px; }
.pol-doc ul, .pol-doc ol { margin: 0 0 10px; padding-inline-start: 22px; }
.pol-doc li { margin-bottom: 4px; }
.pol-doc ul ul { margin-top: 4px; }
.pol-lead { font-size: 15px; background: var(--bg-soft); border-radius: 12px; padding: 12px 14px; }
.pol-note { border-inline-start: 4px solid var(--pol-accent); background: color-mix(in srgb, var(--pol-accent) 10%, transparent); border-radius: 10px; padding: 10px 14px; }
.pol-kv { list-style: none; padding: 0 !important; display: grid; gap: 6px; }
.pol-kv li { display: flex; gap: 12px; justify-content: space-between; border-bottom: 1px dashed var(--border); padding-bottom: 4px; }
.pol-kv span { color: var(--text-soft); }
.pol-table-wrap { overflow-x: auto; }
.pol-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 6px 0 12px; }
.pol-table th { text-align: start; background: var(--bg-soft); color: var(--text-soft); font-size: 12.5px; font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.pol-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }

/* list of policies */
.pol-list { display: grid; gap: 10px; }
.pol-item { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--text); }
.pol-item:hover { border-color: var(--border-strong); }
.pol-item b { font-size: 15px; }
.pol-item span { font-size: 12.5px; color: var(--text-soft); }
.pol-item-admin { border-style: dashed; }

/* acceptance */
.pol-acc h2 { font-size: 16px; }
.pol-scroll { max-height: 340px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--bg-page, var(--bg-soft)); }
.pol-scroll:focus-visible { outline: 2px solid var(--pol-accent); outline-offset: 2px; }
.pol-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; font-size: 14px; font-weight: 600; line-height: 1.7; cursor: pointer; }
.pol-check input { width: 20px; height: 20px; margin-top: 4px; flex: none; accent-color: var(--brand); }
.pol-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pol-btn { min-height: 44px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.pol-btn-pri { background: var(--brand); border-color: var(--brand); color: #fff; }
.pol-btn-ghost { background: transparent; border-color: transparent; color: var(--text-soft); }
.pol-btn-ghost:hover { color: var(--text); background: var(--bg-soft); }

/* privacy centre form */
.pol-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.pol-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.pol-field input { min-height: 42px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-card); color: var(--text); padding: 0 12px; font: inherit; font-size: 14px; font-weight: 500; }
.pol-field input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.pol-span { grid-column: 1 / -1; }
.pol-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pol-ok { background: #e2f2e8; color: #14663f; }
.pol-wait { background: #fcefd8; color: #8a4a08; }
html.dark-mode .pol-ok { background: #123327; color: #5fd39a; }
html.dark-mode .pol-wait { background: #3a2a10; color: #f6bd60; }

@media (max-width: 720px) {
  .pol-page { padding: 4px 12px 32px; }
  .pol-head h1 { font-size: 22px; }
  .pol-card { padding: 14px; border-radius: 14px; }
  .pol-grid { grid-template-columns: minmax(0, 1fr); }
  .pol-scroll { max-height: 46vh; }
  .pol-actions .pol-btn { flex: 1 1 100%; }
  .pol-kv li { flex-direction: column; gap: 0; }
}
@media print {
  .pol-scroll { max-height: none; overflow: visible; }
}

/* settings page: the privacy group's acknowledgement table */
.pv-table-wrap { overflow-x: auto; max-height: 420px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.pv-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pv-table th { position: sticky; top: 0; text-align: start; background: var(--bg-soft); color: var(--text-soft); font-size: 12.5px; font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.pv-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); }
.pv-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pv-ok { background: #e2f2e8; color: #14663f; }
.pv-wait { background: #fcefd8; color: #8a4a08; }
html.dark-mode .pv-ok { background: #123327; color: #5fd39a; }
html.dark-mode .pv-wait { background: #3a2a10; color: #f6bd60; }

/* policies page: one collapsible list per policy */
.pol-acc-list { display: flex; flex-direction: column; gap: 10px; }
.pol-fold { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.pol-fold > summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.pol-fold > summary::-webkit-details-marker { display: none; }
.pol-fold > summary .pol-fold-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pol-fold > summary b { font-size: 15px; }
.pol-fold > summary span { font-size: 12.5px; color: var(--text-soft); }
.pol-fold > summary .pol-chev { width: 18px; height: 18px; fill: none; stroke: var(--text-soft); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; flex: none; }
.pol-fold[open] > summary .pol-chev { transform: rotate(180deg); }
.pol-fold[open] > summary { border-bottom: 1px solid var(--border); }
.pol-fold-body { padding: 16px 18px; }
.pol-fold > summary:focus-visible { outline: 2px solid var(--pol-accent); outline-offset: -2px; }

/* closed policies in light grey, the open one stands out */
.pol-fold:not([open]) { background: color-mix(in srgb, var(--bg-soft) 70%, var(--bg-card)); border-color: var(--border); }
.pol-fold:not([open]) > summary b { color: var(--text-soft); font-weight: 600; }
.pol-fold:not([open]) > summary:hover { background: var(--bg-soft); }
.pol-fold:not([open]) > summary:hover b { color: var(--text); }
.pol-fold[open] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
html.dark-mode .pol-fold[open] { border-color: var(--pol-accent); box-shadow: 0 0 0 1px var(--pol-accent) inset; }

/* office details inside a policy (placeholders in the editor) */
.pme-editor .pol-var, .pol-hint .pol-var { display: inline-block; padding: 0 7px; border-radius: 6px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font-weight: 600; font-size: .92em; user-select: all; }
html.dark-mode .pme-editor .pol-var, html.dark-mode .pol-hint .pol-var { background: color-mix(in srgb, var(--pol-accent) 16%, transparent); color: var(--pol-accent); }

/* the policy editor */
a.pol-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.pol-btn-danger { border-color: color-mix(in srgb, #c0392b 45%, var(--border)); color: #b3261e; background: transparent; margin-inline-start: auto; }
.pol-btn-danger:hover { background: color-mix(in srgb, #c0392b 8%, transparent); }
html.dark-mode .pol-btn-danger { color: #f19a92; }
.pme-form { display: flex; flex-direction: column; gap: 14px; }
.pme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pme-field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-soft); font-weight: 600; }
.pme-field.pme-wide { grid-column: 1 / -1; }
.pme-field .form { min-height: 42px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 12px; background: var(--bg-card); color: var(--text); font: inherit; font-size: 14.5px; font-weight: 500; }
.pme-field .form:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.pme-bar { position: sticky; top: 8px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-soft); }
.pme-b { min-height: 34px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.pme-b:hover { border-color: var(--brand); color: var(--brand); }
.pme-sep { width: 1px; height: 22px; background: var(--border-strong); margin: 0 2px; }
.pme-var { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-soft); }
.pme-var select { min-height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font: inherit; font-size: 13px; padding: 0 8px; }
.pme-editor { min-height: 380px; max-height: 70vh; overflow-y: auto; border: 1px solid var(--border-strong); border-radius: 12px; padding: 16px 18px; background: var(--bg-card); }
.pme-editor:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.pme-editor table { border-collapse: collapse; width: 100%; }
.pme-editor td, .pme-editor th { border: 1px solid var(--border); padding: 6px 8px; }
.pme-check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.7; cursor: pointer; }
.pme-check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--brand); flex: none; }
.pme-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) {
  .pme-grid { grid-template-columns: 1fr; }
  .pme-var { width: 100%; }
  .pme-var select { flex: 1; }
  .pol-btn-danger { margin-inline-start: 0; }
}

/* settings: the policies list */
.pv-pol-list { list-style: none; margin: 10px 0 12px; padding: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pv-pol-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-card); }
.pv-pol-row:last-child { border-bottom: 0; }
.pv-pol-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pv-pol-t b { font-size: 14px; color: var(--text); }
.pv-pol-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.pv-pol-tags .pv-chip:not(.pv-ok):not(.pv-wait) { background: var(--bg-soft); color: var(--text-soft); }
.pv-pol-foot { display: flex; flex-wrap: wrap; gap: 8px; }
