/* AI Use Policy Builder. Loaded after /assets/resources.css, whose colours it uses. */
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Hero privacy promise */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); gap: 48px; align-items: end; }
.hero-aside { display: grid; gap: 14px; padding: 22px; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--card-shine), var(--surface); box-shadow: var(--card-shadow); }
.privacy-line { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid rgba(103, 219, 181, 0.45); border-radius: 12px; background: #10291f; color: var(--text); font-size: 1rem; }
.privacy-line strong { color: #fff; }
.privacy-line a { white-space: nowrap; }
.privacy-icon { flex-shrink: 0; width: 26px; height: 26px; margin-top: 1px; color: var(--primary); }

.section-intro { margin-top: -8px; }
.privacy-points { margin: 0 0 24px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; color: var(--muted); font-size: 0.9375rem; }
.privacy-points li { padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-low); }
.privacy-points strong { display: block; margin-bottom: 6px; color: #fff; font-family: Lexend, system-ui, sans-serif; font-weight: 600; font-size: 1rem; }
/* Hero: the offline download, secondary to the builder */
.offline-option { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 4px 4px 0; }
.offline-option p { flex: 1 1 100%; color: var(--muted); font-size: 0.9375rem; }
.offline-option strong { color: #fff; }
.download.offline-link { flex: 1 1 100%; gap: 12px; box-shadow: none; min-height: 48px; padding: 8px 18px 8px 10px; border-radius: 8px; }
.offline-link .dl-icon { width: 32px; height: 32px; }
.offline-link .dl-icon svg { width: 18px; height: 18px; }
.offline-link .dl-label { font-size: 0.9375rem; }
.offline-option .offline-hint { flex: 0 0 100%; margin: -2px 0 0; color: var(--muted); font-size: 0.875rem; }
.offline-option .offline-status { flex: 0 0 100%; margin: 0; color: var(--accent); font-weight: 600; font-size: 0.9375rem; }
.offline-status:empty { display: none; }
/* Shown only in the offline file */
.offline-banner { padding: 10px 0; background: #133b2e; border-bottom: 1px solid var(--primary-container); color: #fff; font-weight: 600; font-size: 0.9375rem; }

/* Builder frame */
.builder-section { padding: 24px 0 64px; }
.builder-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 8px; }
.builder-head h2 { margin: 0; }
.file-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button { cursor: pointer; font-family: Lexend, system-ui, sans-serif; font-size: 0.9375rem; }
.button.small { min-height: 44px; padding: 8px 16px; font-size: 0.8125rem; }
.pb-file-note { max-width: 760px; color: var(--muted); font-size: 0.9375rem; }
.pb-status { min-height: 1.6em; margin: 8px 0; color: var(--accent); font-weight: 600; scroll-margin-top: 16px; }
.pb-loading { color: var(--muted); }

.pb-progress { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pb-progress-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 6px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-low); color: var(--muted); font: 600 0.8125rem/1.2 Lexend, system-ui, sans-serif; transition: border-color 0.15s, color 0.15s; }
button.pb-progress-link { cursor: pointer; }
button.pb-progress-link:hover { border-color: var(--primary); color: #fff; }
.pb-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--border-strong); color: #fff; }
.pb-progress .done .pb-num { background: #133b2e; color: var(--primary); box-shadow: inset 0 0 0 1px rgba(103, 219, 181, 0.35); }
.pb-progress .current .pb-progress-link { border-color: var(--primary); background: #133b2e; color: #fff; box-shadow: 0 0 0 4px rgba(103, 219, 181, 0.12); }
.pb-progress .current .pb-num { background: var(--primary-container); color: var(--on-primary); }

.pb-toggle { display: none; }
.pb-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 32px; align-items: start; }
.pb-form { min-width: 0; padding: 32px; border: 1px solid var(--border-strong); border-radius: 18px; background: var(--card-shine), var(--surface); box-shadow: var(--card-shadow); }
#pb-step-title { font-size: 1.5rem; margin-bottom: 12px; scroll-margin-top: 20px; }
#pb-step-title:focus { outline: none; }
#pb-step-title:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.pb-step-count { display: block; margin-bottom: 6px; color: var(--primary); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.pb-intro { color: var(--muted); margin-bottom: 20px; }
.pb-fixed { margin: -8px 0 24px; padding-left: 1.25rem; color: var(--text); }

/* Questions */
.pb-field { margin: 0 0 24px; padding: 0; border: 0; min-width: 0; }
.pb-field > label, .pb-field legend { display: block; padding: 0; margin-bottom: 4px; color: #fff; font-family: Lexend, system-ui, sans-serif; font-weight: 600; }
.pb-required { color: var(--muted); font-family: "Open Sans", system-ui, sans-serif; font-weight: 400; font-size: 0.875rem; }
.pb-help { margin-bottom: 8px; color: var(--muted); font-size: 0.9375rem; }
.pb-field input[type="text"], .pb-field input[type="date"], .pb-field textarea { display: block; width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #50685f; border-radius: 8px; background: var(--background); color: #fff; font: inherit; color-scheme: dark; }
.pb-field textarea { resize: vertical; }
.pb-field select { display: block; width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid #50685f; border-radius: 8px; background: var(--background); color: #fff; font: inherit; color-scheme: dark; }
.pb-field select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pb-other { margin-top: 12px; padding: 12px 0 0 14px; border-left: 3px solid var(--primary-container); }
.pb-other > label { display: block; margin-bottom: 4px; color: #fff; font-family: Lexend, system-ui, sans-serif; font-weight: 600; font-size: 0.9375rem; }
.pb-field input:focus-visible, .pb-field textarea:focus-visible, .pb-other input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pb-field [aria-invalid="true"] { border-color: #ffb4ab; }
.pb-error { margin-top: 6px; color: #ffb4ab; font-weight: 600; }
.pb-options { display: grid; gap: 8px; }
.pb-option { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-low); color: var(--text); cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.pb-option:hover { border-color: var(--primary); }
.pb-option input { flex-shrink: 0; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary-container); }
.pb-option:has(input:checked) { border-color: var(--primary-container); background: #12271f; box-shadow: inset 3px 0 0 var(--primary); }
.pb-toggle-row { font-weight: 600; }

.pb-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; padding-top: 20px; border-top: 1px solid var(--border); }
.pb-nav #pb-next { margin-left: auto; }

/* Review step */
.pb-missing { margin-bottom: 24px; padding: 16px 20px; border-left: 4px solid var(--accent); background: var(--surface-low); }
.pb-missing h4, .pb-second h4, .pb-summary h4 { font-size: 1.0625rem; margin: 0 0 6px; color: #fff; font-family: Lexend, system-ui, sans-serif; }
.pb-missing ul { margin: 8px 0 0; padding-left: 1.25rem; }
.pb-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.pb-more { margin-bottom: 28px; }
.pb-more h4 { margin: 0 0 8px; color: #fff; font: 600 0.9375rem Lexend, system-ui, sans-serif; }
.pb-more-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pb-more .pb-note { margin: 8px 0 0; color: var(--muted); font-size: 0.875rem; }
.pb-summary { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.pb-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pb-edit { min-height: 44px; padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: transparent; color: var(--primary); font: 600 0.875rem Lexend, system-ui, sans-serif; cursor: pointer; }
.pb-edit:hover { border-color: var(--primary); }
.pb-summary dl { margin: 8px 0 0; }
.pb-summary dt { color: var(--muted); font-size: 0.875rem; }
.pb-summary dd { margin: 0 0 8px; color: #fff; overflow-wrap: anywhere; }
.pb-second { padding: 20px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-low); }
.pb-second p { margin-bottom: 14px; color: var(--muted); }
.pb-second .pb-note { margin: 14px 0 0; color: var(--text); font-size: 0.9375rem; }
.pb-copy-text { width: 100%; margin-top: 12px; padding: 10px; border: 1px solid #50685f; border-radius: 8px; background: var(--background); color: #fff; font: 0.8125rem/1.5 ui-monospace, monospace; }

/* Live preview: a white page, like the Word file */
.pb-preview { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--border-strong); border-radius: 18px; background: #fff; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.04); }
.pb-preview:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pb-preview-title { position: sticky; top: 0; z-index: 1; margin: 0; padding: 10px 24px; background: #e5ece9; color: #1f2937; font-size: 0.8125rem; letter-spacing: 0.13em; text-transform: uppercase; }
.pb-preview-title:focus { outline: none; }
.policy-doc { padding: 28px 32px 36px; color: #1f2937; font-family: "Open Sans", system-ui, sans-serif; font-size: 0.875rem; line-height: 1.55; overflow-wrap: anywhere; }
.policy-doc p { margin: 0 0 10px; }
.policy-doc .pd-title { margin-bottom: 2px; font: 700 1.625rem/1.2 Lexend, system-ui, sans-serif; color: #1f2937; }
.policy-doc .pd-notice { font-style: italic; color: #4b5563; margin-bottom: 14px; }
.policy-doc .pd-meta { margin-bottom: 4px; }
.policy-doc .pd-sep { color: #6b7280; }
.policy-doc .pd-heading { margin: 18px 0 6px; font: 700 1rem/1.3 Lexend, system-ui, sans-serif; color: #1f2937; letter-spacing: 0; }
.policy-doc .pd-label { font-weight: 700; margin-bottom: 4px; }
.policy-doc ul { margin: 0 0 10px; padding-left: 1.25rem; }
.policy-doc li { margin-bottom: 3px; }
.policy-doc table { width: 100%; border-collapse: collapse; margin: 4px 0 10px; font-size: 0.8125rem; }
.policy-doc th, .policy-doc td { padding: 6px 8px; border: 1px solid #bfbfbf; text-align: left; vertical-align: top; }
.policy-doc thead th { background: #1f2937; color: #fff; }
.policy-doc .pd-answer { background: #e3f6ef; border-radius: 3px; }
.policy-doc .pd-missing { background: #fff36b; color: #1f2937; border-radius: 3px; padding: 0 2px; }
.policy-doc .pd-subheading { margin: 12px 0 4px; font: 700 0.9375rem/1.3 Lexend, system-ui, sans-serif; color: #1f2937; }
.policy-doc .pd-appendix { margin-top: 24px; padding-top: 6px; border-top: 2px solid #1f2937; }
.policy-doc .pd-why { margin: 0 0 10px; border: 1px solid #c9d6d1; border-radius: 6px; background: #f1f6f4; font-size: 0.8125rem; }
.policy-doc .pd-why summary { display: list-item; min-height: 32px; padding: 6px 10px; color: #0f5a45; font-weight: 700; cursor: pointer; }
.policy-doc .pd-why summary:focus-visible { outline: 3px solid #0f5a45; outline-offset: 1px; }
.policy-doc .pd-why-body { padding: 0 12px 8px; }
.policy-doc .pd-why-body p { margin: 0 0 6px; }
.policy-doc .pd-why-how { font-weight: 700; }
.policy-doc .pd-why ul { margin: 0; padding-left: 0; list-style: none; }
.policy-doc .pd-why li { margin: 0; }
.policy-doc .pd-why-link { min-height: 32px; padding: 4px 0; border: 0; background: none; color: #0f5a45; font: inherit; text-align: left; text-decoration: underline; cursor: pointer; }
.policy-doc .pd-why-link:hover { color: #00382a; }
.policy-doc .pd-why-link:focus-visible { outline: 3px solid #0f5a45; outline-offset: 1px; }
.policy-doc .pd-footer { margin: 24px 0 0; padding-top: 10px; border-top: 1px solid #e5e7eb; color: #4b5563; font-size: 0.75rem; font-style: italic; }

@media (max-width: 1099px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
  .hero-aside { max-width: 640px; }
  .pb-layout { grid-template-columns: minmax(0, 1fr); }
  .pb-preview { position: static; max-height: none; display: none; }
  .pb.show-preview .pb-preview { display: block; }
  .pb.show-preview .pb-form { display: none; }
  .pb-toggle { display: flex; align-items: center; justify-content: center; position: sticky; bottom: 12px; z-index: 5; width: 100%; min-height: 48px; margin: 0 0 16px; padding: 10px 16px; border: 1px solid var(--primary); border-radius: 999px; background: #133b2e; color: #fff; font: 600 0.9375rem Lexend, system-ui, sans-serif; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
}
@media (max-width: 640px) {
  /* Keep the privacy promise on the first screen: the aside moves up, under the intro */
  .hero-grid { gap: 0; }
  .hero-grid > div { display: contents; }
  .hero-aside { order: 1; margin-top: 24px; padding: 16px; }
  .hero-grid .facts, .hero-grid .note { order: 2; }
  .privacy-line { padding: 14px 16px; }
  .privacy-points { grid-template-columns: minmax(0, 1fr); }
  .privacy-line a { white-space: normal; }
  .offline-option p { flex-basis: 100%; }
  .download.offline-link { flex-wrap: nowrap; width: 100%; padding: 8px 14px 8px 10px; }
  .offline-link .dl-text { flex-basis: auto; order: 0; }
  .pb-form { padding: 20px 16px; }
  .pb-progress { gap: 6px; }
  .pb-progress-link { padding: 4px; }
  .pb-progress-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pb-progress .current .pb-progress-name { position: static; width: auto; height: auto; clip: auto; padding-right: 8px; }
  .pb-nav .button { width: auto; flex: 1; }
  .pb-actions .button, .pb-second .button { width: 100%; }
  .policy-doc { padding: 20px 16px 28px; }
}

/* Print or save as PDF: just the policy */
@media print {
  @page { margin: 0.75in; }
  body { background: #fff; color: #000; }
  .skip-link, .site-header, .site-footer, main > section:not(.builder-section), .builder-head, .pb-file-note,
  .pb-status, .pb-loading, .pb > nav, .pb-toggle, .pb-form, .pb-preview-title { display: none !important; }
  .container { width: auto; }
  .builder-section { padding: 0; }
  .pb, .pb-layout, .pb-preview, .pb.show-preview .pb-preview { display: block !important; position: static; max-height: none; overflow: visible; border: 0; border-radius: 0; }
  .policy-doc { padding: 0; font-size: 10.5pt; }
  .policy-doc .pd-answer { background: none; }
  .policy-doc .pd-missing { background: none; padding: 0; }
  .policy-doc .pd-heading { break-after: avoid; }
  .policy-doc .pd-why { display: none !important; }
  .policy-doc .pd-appendix { break-before: page; border-top: 0; }
  .policy-doc tr { break-inside: avoid; }
}
