/* AgentGate — legal documents (/privacy, /terms, /dpa), the trust centre (/trust)
   and the security questionnaire (/security-questionnaire). Builds on site.css. */

/* ── Page body ─────────────────────────────────────────────────────────────── */

/* The hero leaves room below itself; the document starts right under it. */
.legal-body {
  padding-top: clamp(4px, 1.4vw, 20px);
}

/* ── Contents rail ─────────────────────────────────────────────────────────── */

/* number column + label, so a wrapped label keeps its hanging indent */
.legal-doc .doc-toc a {
  display: grid;
  grid-template-columns: 2.1em minmax(0, 1fr);
  align-items: baseline;
}

.doc-toc .toc-n {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

/* site.css hides the rail below 1020px. A legal document without its contents
   list is hard to use on a phone, so here it becomes a panel above the text. */
@media (max-width: 1020px) {
  .legal-doc .doc-toc {
    display: block;
    position: static;
    max-height: none;
    overflow: visible;
    columns: 2;
    column-gap: 28px;
    padding: 18px 18px 8px;
    border: 1px solid var(--line);
    border-radius: var(--r-l);
    background: var(--panel);
  }

  .legal-doc .doc-toc .toc-title {
    column-span: all;
    margin-bottom: 6px;
  }

  .legal-doc .doc-toc a {
    break-inside: avoid;
    padding: 12px 0;
    border-left: 0;
  }
}

@media (max-width: 560px) {
  .legal-doc .doc-toc {
    columns: 1;
  }
}

/* ── Prose add-ons ─────────────────────────────────────────────────────────── */

/* A note inside a document holds running text, not an icon and a line. */
.prose .note > * {
  min-width: 0;
}

.prose .note p + p {
  margin-top: 0.75em;
}

/* Label + period rows (the retention schedule). */
.prose .kv {
  padding-left: 0;
  border-top: 1px solid var(--line);
}

.prose .kv > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.prose .kv > li > span:first-child {
  flex: 1 1 17rem;
  min-width: 0;
}

.prose .kv .tag {
  flex: none;
}

/* Cards inside running text are quieter than on the marketing pages. */
.prose .card {
  padding: 18px 20px;
  border-radius: var(--r);
  font-size: 0.9375rem;
}

.prose .card > * + * {
  margin-top: 0.6em;
}

.prose .card h3 {
  margin-top: 0;
  font-size: 1rem;
}

.prose .grid {
  gap: 12px;
}

/* Wide tables scroll inside themselves instead of crushing their columns. */
.prose table.t-wide th,
.prose table.t-wide td {
  min-width: 8.5rem;
}

/* ── Sheets (trust centre, security questionnaire) ─────────────────────────── */

.sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(44px, 6vw, 76px);
}

.sheet-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.sheet-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.sheet-num {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.sheet-section > p {
  max-width: 70ch;
  color: var(--ink-2);
}

ul.sheet-list {
  display: grid;
  gap: 8px;
  max-width: 70ch;
  padding-left: 1.2em;
  list-style: disc;
  color: var(--ink-2);
}

ul.sheet-list li::marker {
  color: var(--ink-3);
}

/* Term + description rows. */
.spec {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--line);
}

.spec > div {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: 4px 28px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

.spec dt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: start;
  gap: 6px 10px;
  font-size: 0.9375rem;
  font-weight: 560;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.spec dd {
  font-size: 0.9375rem;
  color: var(--ink-2);
}

/* Tables that need room scroll inside their wrapper on small screens. */
.table.table-wide {
  min-width: 36rem;
}

.table .cell-note {
  display: block;
  max-width: 46ch;   /* keeps a long note from claiming the whole table for its column */
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* Text + action. */
.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}

.callout > :first-child {
  flex: 1 1 22rem;
  min-width: 0;
}

.callout p {
  font-size: 0.9375rem;
  color: var(--ink-2);
}

/* Questionnaire rows: the shared .faq, with the question id in its own column
   and the status beside the question. */
.sheet .faq details {
  scroll-margin-top: calc(var(--nav-h) + 16px);
}

.sheet .faq summary {
  align-items: baseline;
  padding-block: 18px;
}

.qa-q {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 18px;
}

.qa-id {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.sheet .faq summary .tag {
  flex: none;
}

/* the answer lines up under the question, not under the id */
.sheet .faq .faq-body {
  max-width: calc(70ch + 5.5rem + 20px);
  padding-left: calc(5.5rem + 20px);
}

@media (max-width: 760px) {
  .spec > div {
    grid-template-columns: minmax(0, 1fr);
  }

  /* id, status and chevron share the first line; the question gets the full width below */
  .sheet .faq summary {
    flex-wrap: wrap;
    gap: 6px 12px;
  }

  .qa-q {
    display: contents;
  }

  .qa-id {
    order: 1;
    flex: 1;
  }

  .sheet .faq summary .tag {
    order: 2;
  }

  .sheet .faq summary::after {
    order: 3;
  }

  .qa-q > span:last-child {
    order: 4;
    flex: 1 0 100%;
  }

  .sheet .faq .faq-body {
    max-width: 70ch;
    padding-left: 2px;
  }
}
