/* Trust page: the owner page (public/pages/trust.js) and the public server-rendered page (src/trust.js, loaded after
   /styles.css with no JavaScript, so the system theme applies). Tokens only. */

/* ---- Owner page ---- */
.trust-hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--s-6) var(--s-10);
  padding: var(--s-8);
  border: 1px solid var(--line-subtle);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
.trust-hero-state { display: flex; gap: var(--s-5); align-items: flex-start; }
.trust-hero-glyph {
  --tone: var(--text-2);
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid color-mix(in srgb, var(--tone) 40%, transparent);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--tone) 10%, transparent);
  color: var(--tone);
}
.trust-hero-glyph[data-tone="ok"] { --tone: var(--ok); }
.trust-hero-state .eyebrow { margin-bottom: var(--s-1); }
.trust-hero-label { margin: 0; color: var(--text); font-size: var(--fs-display); font-weight: 650; letter-spacing: -0.02em; line-height: var(--lh-display); }
.trust-hero[data-state="off"] .trust-hero-label { color: var(--text-2); }
.trust-hero-line { max-width: 52ch; margin: var(--s-2) 0 0; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.trust-hero-actions { margin-top: var(--s-5); }
.trust-hero-actions a.button { display: inline-flex; align-items: center; gap: var(--s-2); }
.trust-hero-share { display: grid; gap: var(--s-4); align-content: start; min-width: 0; }
.trust-copy label { margin-top: 0; }
.trust-copy-row { display: flex; gap: var(--s-2); align-items: flex-start; }
.trust-copy-row :is(input, textarea) { flex: 1 1 auto; min-width: 0; font-family: var(--font-mono); font-size: var(--fs-xs); resize: none; }
.trust-copy-row button { display: inline-flex; flex: none; align-items: center; gap: var(--s-2); }
.trust-badge { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.trust-badge-label { margin: 0; color: var(--text); font-size: var(--fs-sm); font-weight: 550; }
.trust-badge img { display: block; height: 20px; }
.trust-badge .hint { margin: 0; }
.trust-computed { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin: 0; padding-top: var(--s-4); border-top: 1px solid var(--line-subtle); color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.trust-computed > .icon { color: var(--text-3); }
.trust-computed > span { flex: 1 1 16rem; }
.trust-computed button { display: inline-flex; align-items: center; gap: var(--s-2); }

.trust-layout { display: grid; gap: var(--s-6); margin-top: var(--s-6); }
.trust-layout > .ui-section { margin-top: 0; }
/* Name beside the section switches on wide screens; title, error and actions span the form. */
.trust-form { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 9fr); gap: var(--s-5) var(--s-8); }
.trust-form > :not(.trust-fieldset) { grid-column: 1 / -1; }
.trust-form .ui-panel-title, .trust-form .field-error, .trust-form .button-row { margin: 0; }
.trust-fieldset { display: grid; gap: var(--s-3); align-content: start; min-width: 0; margin: 0; padding: 0; border: 0; }
.trust-fieldset legend { margin-bottom: var(--s-3); padding: 0; color: var(--text); font-size: var(--fs-sm); font-weight: 550; }
.trust-name-field[hidden] { display: none; }
.trust-name-field label { margin-top: 0; }
.trust-name-field .hint { margin: var(--s-1) 0 0; }
.trust-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--s-5) var(--s-6); }
.trust-toggle .hint { margin: var(--s-1) 0 0 calc(36px + var(--s-3)); }
.trust-switch { display: inline-flex; align-items: center; gap: var(--s-3); margin: 0; color: var(--text); font-weight: 500; cursor: pointer; }
.trust-switch input {
  position: relative;
  flex: none;
  width: 36px;
  height: 20px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-full);
  background: var(--sunken);
  appearance: none;
  cursor: pointer;
  transition: background var(--t-micro) var(--ease-move), border-color var(--t-micro) var(--ease-move);
}
.trust-switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: var(--r-full);
  background: var(--text-2);
  transition: transform var(--t-micro) var(--ease-move), background var(--t-micro) var(--ease-move);
}
.trust-switch input:checked { border-color: var(--accent); background: var(--accent); }
.trust-switch input:checked::after { background: var(--accent-ink); transform: translateX(16px); }
.trust-switch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.trust-previews { display: grid; gap: var(--s-5); }
.trust-preview > .ui-panel { margin: 0; }
.trust-preview .ui-panel-body { display: grid; gap: var(--s-5); }
/* A section hidden from the public page keeps its numbers readable; the dashed frame marks it. */
.trust-preview[data-hidden] > .ui-panel { border-style: dashed; border-color: var(--line-input); box-shadow: none; }
.trust-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); align-items: center; }
.trust-pair .ui-kv { margin: 0; }
.trust-hash { display: inline-block; max-width: 18ch; overflow: hidden; font-family: var(--font-mono); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.trust-disclaimer { display: flex; gap: var(--s-2); align-items: flex-start; margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.trust-disclaimer .icon { flex: none; margin-top: 2px; color: var(--text-3); }

@media (max-width: 1199px) {
  .trust-form { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .trust-hero { grid-template-columns: minmax(0, 1fr); padding: var(--s-6); }
}
@media (max-width: 639px) {
  .trust-hero { padding: var(--s-5); }
  .trust-hero-state { flex-direction: column; gap: var(--s-3); }
  .trust-copy-row { flex-direction: column; align-items: stretch; }
  .trust-pair { grid-template-columns: minmax(0, 1fr); }
  .trust-toggle .hint { margin-left: 0; }
}
@media (pointer: coarse) {
  .trust-switch input { width: 44px; height: 28px; }
  .trust-switch input::after { width: 22px; height: 22px; }
  .trust-switch input:checked::after { transform: translateX(16px); }
  /* The label is what a finger lands on, so the row, not just the track, reaches 44px. */
  .trust-switch { min-height: 44px; }
}
@media (pointer: coarse) and (min-width: 640px) {
  .trust-toggle .hint { margin-left: calc(44px + var(--s-3)); }
}

/* ---- Public page ---- */
.trust-public-page { margin: 0; padding: var(--s-10) var(--s-6) var(--s-16); }
.trust-public { display: grid; gap: var(--s-6); max-width: 960px; margin: 0 auto; }
/* Grid children may shrink below their content, so wide tables scroll inside .trust-table-wrap instead of widening the page. */
.trust-public > *, .trust-section > *, .trust-anchors { min-width: 0; }
.trust-public-head { display: grid; gap: var(--s-3); }
.trust-brand {
  margin: 0 0 var(--s-4);
  padding: 0 0 var(--s-4) calc(32px + var(--s-3));
  border-bottom: 1px solid var(--line-subtle);
  background: url('/brand/command-mark.svg') left top / 32px 32px no-repeat;
  color: var(--text);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 32px;
}
.trust-public-head .eyebrow { margin: 0; }
.trust-public-head h1 { margin: 0; font-size: var(--fs-display); line-height: var(--lh-display); letter-spacing: -0.02em; }
.trust-lede { max-width: 68ch; margin: 0; color: var(--text-2); font-size: var(--fs-md); line-height: var(--lh-md); }
.trust-meta { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-2) 0 0; }
.trust-meta span { padding: var(--s-1) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--raised); color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); font-variant-numeric: tabular-nums; }

.trust-section {
  display: grid;
  gap: var(--s-5);
  padding: var(--s-6);
  border: 1px solid var(--line-subtle);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
.trust-section h2 { margin: 0; font-size: var(--fs-xl); line-height: var(--lh-xl); letter-spacing: -0.012em; }
.trust-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: var(--s-4); margin: 0; }
/* Values share a baseline along a row even when a label wraps. */
.trust-figure { display: grid; gap: var(--s-1); align-content: space-between; padding: var(--s-4); border: 1px solid var(--line-subtle); border-radius: var(--r-sm); background: var(--raised); }
.trust-figure dt { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.trust-figure dd { margin: 0; color: var(--text); font-size: var(--fs-xl); font-weight: 600; line-height: var(--lh-xl); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.trust-figure[data-tone="ok"] dd { color: var(--ok); }
.trust-figure[data-tone="warn"] dd { color: var(--warn); }
.trust-figure[data-tone="danger"] dd { color: var(--danger); }
.trust-note, .trust-empty { margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }

.trust-split { display: block; width: 100%; height: 12px; border-radius: var(--r-full); background: var(--seq-0); }
.trust-split-approved, .trust-legend-approved .trust-swatch { fill: var(--ok); background: var(--ok); }
.trust-split-autopilot, .trust-legend-autopilot .trust-swatch { fill: var(--info); background: var(--info); }
.trust-split-refused, .trust-legend-refused .trust-swatch { fill: var(--warn); background: var(--warn); }
.trust-split-other, .trust-legend-other .trust-swatch { fill: var(--chart-1); background: var(--chart-1); }
.trust-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: calc(var(--s-2) * -1) 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.trust-legend li { display: inline-flex; align-items: center; gap: var(--s-2); }
.trust-legend strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.trust-swatch { width: 10px; height: 10px; border-radius: var(--r-xs); }

.trust-definitions, .trust-anchors { margin: 0; padding-top: var(--s-4); border-top: 1px solid var(--line-subtle); }
.trust-definitions summary, .trust-anchors summary { color: var(--text); font-size: var(--fs-sm); font-weight: 550; cursor: pointer; }
.trust-definitions p { max-width: 80ch; margin: var(--s-3) 0 0; color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.trust-table-wrap { overflow-x: auto; margin-top: var(--s-3); }
.trust-section table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); line-height: var(--lh-sm); }
.trust-section :is(th, td) { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line-subtle); text-align: start; vertical-align: top; }
.trust-section thead th { color: var(--text-3); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.trust-section tbody th { color: var(--text); font-weight: 550; }
.trust-section td { color: var(--text-2); }
.trust-section .trust-num { text-align: end; font-variant-numeric: tabular-nums; }
.trust-anchors thead th:nth-child(2) { text-align: end; }
.trust-anchors td:first-child { white-space: nowrap; }
.trust-section code { font-family: var(--font-mono); font-size: var(--fs-xs); overflow-wrap: anywhere; }
.trust-disclaimer, .trust-public-foot p { color: var(--text-2); }
.trust-section > .trust-disclaimer { display: block; }
.trust-public-foot { display: grid; gap: var(--s-2); padding-top: var(--s-4); border-top: 1px solid var(--line-subtle); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.trust-public-foot p { margin: 0; }
.trust-framework-mobile { display: none; margin: 0; }
.trust-framework-mobile dt { font-weight: 600; color: var(--text); }
.trust-framework-mobile dd { margin: var(--s-1) 0 0; color: var(--text-2); font-size: var(--fs-sm); }

@media (max-width: 639px) {
  .trust-framework-mobile { display: grid; gap: var(--s-4); }
  .trust-framework-table { display: none; }
  .trust-public-page { padding: var(--s-6) var(--s-4) var(--s-12); }
  .trust-section { padding: var(--s-5); }
  .trust-public-head h1 { font-size: var(--fs-xl); line-height: var(--lh-xl); }
  .trust-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .trust-figure { padding: var(--s-3); }
  .trust-figure dd { font-size: var(--fs-lg); line-height: var(--lh-lg); }
}
