/* OHQ Console. OHQ's design system (site/ohq/styles.css, documented on the brand page), in the
   form the AgentFGA docs use for an app-like page: black, grey and white in warm neutrals, no
   accent color. Emphasis comes from weight, fill, rules and inversion, so states (active, revoked,
   owner, errors) are told apart by fill and border, never by hue. */
:root {
  --paper: #f6f4f3;
  --surface: #ffffff;
  --sunk: #ece9e7;
  --ink: #1c1a1a;
  --ink-2: #4b4646;
  --ink-3: #6e6969;
  --rule: #e3dfdd;
  --rule-strong: #cbc6c4;
  --grey: #8f8989;
  --on-ink: #f6f4f3;
  --ink-hover: #3a3535;
  --shadow: rgba(28, 26, 26, 0.14);

  --f-display: "Archivo", "Arial Black", system-ui, sans-serif;
  --f-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Martian Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --header-h: 60px;
  color-scheme: light;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

p, h1, h2, h3, dl, dd, pre, ol, ul, figure { margin: 0; }
button, input, select { font: inherit; color: inherit; }

a {
  color: var(--ink);
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule-strong);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

strong { font-weight: 650; }

h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; }

code, pre, kbd { font-family: var(--f-mono); font-stretch: 87.5%; }
:not(pre) > code { font-size: 0.82em; background: var(--sunk); padding: 0.12em 0.4em; border-radius: 6px; overflow-wrap: anywhere; }

/* Mono labels: section titles, table heads, chips. */
.label, th {
  font-family: var(--f-mono);
  font-stretch: 87.5%;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.muted { color: var(--ink-3); }
.note { color: var(--ink-3); font-size: 0.8125rem; line-height: 1.5; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.icon { width: 16px; height: 16px; flex: none; }

/* ---------- OHQ wordmark and lockup ---------- */

/* OHQ drawn as walls on a 48-unit grid, the O for Open in grey. */
.wordmark { flex: none; display: block; width: 2.792em; height: 1em; overflow: visible; }
.wordmark path { fill: none; stroke: var(--ink); stroke-width: 6; }
.wordmark .wm-o { stroke: var(--grey); }

.lockup { display: inline-flex; align-items: center; gap: 10px; font-size: 1.25rem; line-height: 1; color: var(--ink); text-decoration: none; }
.lockup-sep { font-family: var(--f-display); font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--rule-strong); }

/* ---------- buttons ---------- */

/* Ruled in ink like the site's buttons, at a tool's size; the primary one is filled. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px 9px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-family: var(--f-display);
  font-stretch: 106%;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--sunk); }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }
.btn-go::after { content: "→"; transition: transform 0.15s; }
.btn-go:hover::after { transform: translateX(3px); }
.btn-block { width: 100%; }

/* Small mono actions: copy, revoke, remove. */
.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 5px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--f-mono);
  font-stretch: 87.5%;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}
.chip-btn:hover { border-color: var(--ink-3); }
.chip-btn::-webkit-details-marker { display: none; }

/* ---------- chips: role and status, told apart by fill ---------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--f-mono);
  font-stretch: 87.5%;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip-solid { background: var(--ink); color: var(--on-ink); }
.chip-line { border-color: var(--ink); color: var(--ink); }
.chip-soft { background: var(--sunk); border-color: var(--rule-strong); color: var(--ink-2); }
.chip-dashed { border-color: var(--rule-strong); border-style: dashed; color: var(--ink-3); }
.chip-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- forms ---------- */

.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-weight: 600; font-size: 0.8125rem; color: var(--ink); }
.field .optional { color: var(--ink-3); font-weight: 400; }
.field .hint { font-size: 0.8125rem; color: var(--ink-3); }

input, select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.3;
}
input:hover, select:hover { border-color: var(--ink-3); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
input::placeholder { color: var(--grey); }
select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%236e6969' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px;
  cursor: pointer;
}

.stack { display: grid; gap: 16px; }

/* ---------- panels: a framed form or setting ---------- */

.panel { min-width: 0; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--rule);
}
.panel-head .label { color: var(--ink); }
.panel-body { display: grid; gap: 14px; padding: 18px 20px 20px; }
.panel-body > p { color: var(--ink-2); }
.panel-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.panel-row > .field { flex: 1 1 260px; }
.panel-row > .field-narrow { flex: 0 1 160px; }
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--rule);
  border-radius: 0 0 16px 16px;
  background: var(--paper);
}

/* ---------- callouts: told apart by icon and rule, not by color ---------- */

.callout {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink);
}
.callout > svg { width: 18px; height: 18px; margin-top: 2px; }
.callout-info { background: var(--sunk); border-color: transparent; }
.callout-done { background: var(--surface); }
.callout-warn { background: var(--surface); border: 2px solid var(--ink); }
.callout-error { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

/* ---------- code ---------- */

.code { min-width: 0; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); overflow: hidden; }
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px 9px 18px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-stretch: 87.5%;
  font-size: 0.75rem;
  color: var(--ink-3);
}
.code pre { padding: 16px 18px 18px; overflow-x: auto; font-size: 0.8125rem; line-height: 1.75; color: var(--ink-2); }
.code .k { color: var(--ink); font-weight: 600; }
.code .s { color: var(--ink); }
.code .c { color: var(--ink-3); }
.code-secret pre { color: var(--ink); font-weight: 600; }

/* One value to copy: an ID, a URL, a link. */
.copy-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 5px 5px 5px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  background: var(--surface);
}
.copy-field pre { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; font-size: 0.8125rem; line-height: 1.6; color: var(--ink); white-space: pre; }

/* ---------- tables ---------- */

.table-wrap { min-width: 0; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.table th, .table td { padding: 12px 16px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--rule); }
.table th { background: var(--paper); vertical-align: bottom; padding-block: 10px; }
.table thead th:first-child { border-top-left-radius: 15px; }
.table thead th:last-child { border-top-right-radius: 15px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td { color: var(--ink-2); }
.table td.strong { color: var(--ink); font-weight: 600; }
.table .actions { text-align: right; width: 1%; white-space: nowrap; }
.table .revoked td { color: var(--ink-3); }
.table .revoked td.strong { font-weight: 500; text-decoration: line-through; text-decoration-color: var(--rule-strong); }
.table .by { display: block; font-size: 0.8125rem; color: var(--ink-3); }
.table code { white-space: nowrap; }

.person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-text { display: grid; min-width: 0; line-height: 1.35; }
.person-name { color: var(--ink); font-weight: 600; }
.person-email { font-size: 0.8125rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.you { margin-left: 6px; font-weight: 400; color: var(--ink-3); }

/* Initials in a ruled square, like the wordmark's walls. */
.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--f-display);
  font-stretch: 106%;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.avatar-sm { width: 28px; height: 28px; border-radius: 8px; font-size: 0.6875rem; }

.role-form { display: flex; gap: 6px; align-items: center; }
.role-form select { width: auto; min-height: 32px; padding-block: 4px; font-size: 0.875rem; }
.js .role-form button { display: none; }

/* A destructive action asks once more, without a dialog: the summary opens a small panel. */
.confirm { position: relative; display: inline-block; text-align: left; }
.confirm[open] > summary { background: var(--sunk); border-color: var(--ink-3); }
.confirm form {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  display: grid;
  gap: 12px;
  width: 300px;
  padding: 16px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 40px var(--shadow);
  white-space: normal;
  font-size: 0.875rem;
  color: var(--ink);
}
.confirm form p { color: var(--ink-2); }

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 24px;
  border: 1.5px dashed var(--rule-strong);
  border-radius: 16px;
  text-align: center;
  color: var(--ink-2);
}
.empty h2 { font-size: 1.125rem; font-weight: 760; color: var(--ink); }
.empty p { max-width: 46ch; }

/* ---------- getting started ---------- */

/* Facts about the organization's AgentFGA, in one framed strip. */
.stats { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.7fr) minmax(0, 1fr); border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.stat { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 16px 20px 18px; }
.stat + .stat { border-left: 1px solid var(--rule); }
.stat-num { font-family: var(--f-display); font-size: 1.75rem; font-weight: 800; font-stretch: 110%; line-height: 1.1; letter-spacing: -0.02em; text-decoration: none; }
.stat-links { display: grid; gap: 4px; }
.stat-links a { font-weight: 600; }

/* Numbered steps joined by a rule, as in the docs. A done step's number is filled. */
.steps { list-style: none; padding: 0; display: grid; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; display: grid; gap: 12px; justify-items: start; min-width: 0; padding: 0 0 36px 48px; }
.steps > li > * { max-width: 100%; }
.steps > li > .code { width: 100%; }
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 600 0.6875rem/1 var(--f-mono);
  font-stretch: 87.5%;
}
.steps > li.done::before { content: "✓"; background: var(--ink); color: var(--on-ink); font-size: 0.875rem; }
.steps > li::after { content: ""; position: absolute; top: 38px; bottom: 8px; left: 14px; width: 2px; background: var(--rule); }
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps h2 { font-size: 1.125rem; font-weight: 760; font-stretch: 108%; line-height: 30px; }
.steps p { color: var(--ink-2); max-width: 68ch; }
.step-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- stores ---------- */

.empty > .icon { width: 28px; height: 28px; color: var(--ink-3); }
.empty > .code { width: min(100%, 40rem); text-align: left; }
.row-link { color: var(--ink); text-decoration: none; }
.row-link:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.pager { display: flex; gap: 20px; justify-content: flex-end; margin-top: 14px; font-size: 0.875rem; }
.pager a { color: var(--ink-2); }
.pager a:hover { color: var(--ink); }
.page-head .eyebrow a { color: inherit; text-decoration: none; }
.page-head .eyebrow a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.page-head .eyebrow a::before { content: "← "; }

.store-meta { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-top: -10px; }
.store-id { display: grid; gap: 8px; width: min(100%, 26rem); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: -6px; overflow-x: auto; scrollbar-width: none; }
.tabs a {
  padding: 10px 14px 11px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink-3);
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* The model: its version, the diagram, a card per type, the DSL. */
.model-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.model-id { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.model-id code { font-size: 0.8125rem; overflow-wrap: anywhere; }
.versions > summary { gap: 8px; }
.versions .count { font-family: var(--f-mono); font-size: 0.6875rem; color: var(--ink-3); }
.versions .menu-panel { right: 0; width: min(22rem, calc(100vw - 32px)); }
.version { display: grid; gap: 2px; min-width: 0; }
.version code { font-size: 0.75rem; background: none; padding: 0; }

.graph-wrap { margin-top: 14px; padding: 8px; overflow-x: auto; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.type-graph { display: block; margin-inline: auto; font-family: var(--f-mono); font-stretch: 87.5%; }
.type-graph .edge path { fill: none; stroke: var(--rule-strong); stroke-width: 1.5; }
.type-graph .edge:hover path { stroke: var(--ink); }
.type-graph .edge text { font-size: 10.5px; fill: var(--ink-3); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.type-graph .edge:hover text { fill: var(--ink); }
.type-graph marker path { fill: var(--ink-3); }
.type-graph .node rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.type-graph .node:hover rect { fill: var(--sunk); }
.type-graph .node-name { font-size: 13px; font-weight: 600; fill: var(--ink); }
.type-graph .node-sub { font-size: 10px; fill: var(--ink-3); letter-spacing: 0.02em; }

/* Masonry: cards run down two columns, so a short card leaves no gap. */
.type-cards { columns: 2 20rem; column-gap: 14px; }
.type-card { break-inside: avoid; margin-bottom: 14px; min-width: 0; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); scroll-margin-top: calc(var(--header-h) + 16px); }
.type-card:target { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.type-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--rule); }
.type-card h3 { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 0.9375rem; font-weight: 600; overflow-wrap: anywhere; }
.type-card .count { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 0.6875rem; color: var(--ink-3); white-space: nowrap; }
.type-card > .note, .type-card > .cond-sig { padding: 12px 16px; }
.type-card dl { display: grid; }
.rel { display: grid; gap: 4px; padding: 10px 16px; scroll-margin-top: calc(var(--header-h) + 16px); }
.rel + .rel { border-top: 1px solid var(--rule); }
.rel:target { background: var(--sunk); }
.rel dt { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 0.8125rem; font-weight: 600; color: var(--ink); }
.rel dd { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 0.8125rem; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.tk-kw { color: var(--ink-3); font-weight: 400; }
.tk-type, .tk-rel, .tk-cond { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.tk-type:hover, .tk-rel:hover, .tk-cond:hover { text-decoration-color: var(--ink); }
.tk-type { font-weight: 600; }
.cond-sig code { font-size: 0.8125rem; }
.cond-expr { margin: 0 16px 14px; padding: 10px 12px; border-radius: 10px; background: var(--paper); font-size: 0.8125rem; line-height: 1.6; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }

/* Tuples: a filter, then the table. */
.filter-row { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1.1fr) auto; align-items: end; gap: 12px; }
.filter-actions { display: flex; gap: 8px; }
.panel-body > .hint { font-size: 0.8125rem; color: var(--ink-3); }
.table code.obj, .table .rel-code { font-size: 0.8125rem; background: none; padding: 0; color: var(--ink); overflow-wrap: anywhere; }
.obj-type { color: var(--ink-3); }
.tuple-cond { display: block; margin-top: 2px; font-size: 0.8125rem; color: var(--ink-3); }

/* Check. */
.check-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
.check-result { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; border: 2px solid var(--ink); background: var(--surface); }
.check-result.allowed { background: var(--ink); color: var(--on-ink); }
.check-result.allowed code { background: rgba(246, 244, 243, 0.14); color: var(--on-ink); }
.check-result.allowed .note { color: var(--rule-strong); }
.check-mark { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; font-size: 1.125rem; font-weight: 700; border: 2px solid currentColor; }
.check-verdict { font-family: var(--f-display); font-size: 1.375rem; font-weight: 800; font-stretch: 110%; letter-spacing: -0.02em; line-height: 1.2; }
.check-result p + p { margin-top: 4px; overflow-wrap: anywhere; }

/* ---------- home ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 8px 24px;
  padding: 32px 28px 32px 36px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.hero-text { display: grid; gap: 14px; justify-items: start; min-width: 0; }
.hero-text h2 { font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem); font-weight: 800; font-stretch: 112%; line-height: 1.05; letter-spacing: -0.03em; }
.hero-text p { color: var(--ink-2); max-width: 40ch; }
.hero-text .btn { margin-top: 6px; }
.hero-art { min-width: 0; }
.btn-copy { white-space: normal; text-align: left; }
.btn-copy .icon { flex: none; width: 17px; height: 17px; }

/* The onboarding prompt, under the hero, across both columns. */
.prompt { grid-column: 1 / -1; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--rule); }
.prompt > summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; cursor: pointer; font-weight: 600; font-size: 0.875rem; color: var(--ink-2); }
.prompt > summary::-webkit-details-marker { display: none; }
.prompt > summary:hover { color: var(--ink); }
.prompt > summary .chev { width: 16px; height: 16px; transform: rotate(-90deg); transition: transform 0.15s; }
.prompt[open] > summary .chev { transform: none; }
.prompt > .code { margin-top: 12px; }
.prompt pre { max-height: 26rem; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }

/* The headquarters art (src/views/art.ts), as on the OHQ site. */
.hq-art { display: block; width: 100%; height: auto; overflow: visible; }
#hq-art-dots circle { fill: var(--ink-3); }
.hq-art .hero-lanes polyline { fill: none; stroke: var(--ink-3); stroke-width: 0.3; stroke-dasharray: 1 1.4; }
.hq-art .hero-shadow path { fill: none; stroke: var(--ink); stroke-width: 7; opacity: 0.22; }
.hq-art .hero-sides polygon { stroke-width: 0.25; stroke-linejoin: round; }
.hq-art .hero-tops path { fill: none; stroke: var(--ink); stroke-width: 6; }
.hq-art .hero-tops path.o { stroke: var(--grey); }
.hq-art .hero-ag polygon { stroke-width: 0.15; stroke-linejoin: round; }
.hq-art .ag-front { fill: var(--ink-2); stroke: var(--ink-2); }
.hq-art .ag-side { fill: var(--ink); stroke: var(--ink); }
.hq-art .ag-top { fill: var(--grey); stroke: var(--grey); }
.hero-ag--a { animation: hero-a 12s linear infinite; }
.hero-ag--b { animation: hero-b 12s linear infinite; }
.hero-ag--c { animation: hero-c 21s linear infinite; }
.hero-ag.d0 { animation-delay: -0s; }
.hero-ag.d1 { animation-delay: -1s; }
.hero-ag.d2 { animation-delay: -2s; }
.hero-ag.d3 { animation-delay: -3s; }
.hero-ag.d4 { animation-delay: -4s; }
.hero-ag.d5 { animation-delay: -5s; }
.hero-ag.d6 { animation-delay: -6s; }
.hero-ag.d7 { animation-delay: -7s; }
.hero-ag.d8 { animation-delay: -8s; }
.hero-ag.d9 { animation-delay: -9s; }
.hero-ag.d10 { animation-delay: -10s; }
.hero-ag.d11 { animation-delay: -11s; }
.hero-ag.d14 { animation-delay: -14s; }
.hero-ag.d17 { animation-delay: -17s; }
.hero-ag.d20 { animation-delay: -20s; }
@keyframes hero-a { 0% { transform: translate(-33.16px, 81.17px); opacity: 0; } 8.33% { opacity: 1; } 66.67% { transform: translate(-10.62px, 49.67px); } 91.67% { opacity: 1; } 100% { transform: translate(0.65px, 33.92px); opacity: 0; } }
@keyframes hero-b { 0% { transform: translate(-53px, 32.92px); opacity: 0; } 8.33% { opacity: 1; } 66.67% { transform: translate(-10.62px, 49.67px); } 91.67% { opacity: 1; } 100% { transform: translate(0.65px, 33.92px); opacity: 0; } }
@keyframes hero-c { 0% { transform: translate(79.44px, 85.26px); opacity: 0; } 4.76% { opacity: 1; } 80.95% { transform: translate(-10.62px, 49.67px); } 95.24% { opacity: 1; } 100% { transform: translate(0.65px, 33.92px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hero-ag { animation-play-state: paused; } }

/* What's new: posts, reports and changelog entries (src/updates.ts). */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.section-link {
  font-family: var(--f-mono);
  font-stretch: 87.5%;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
}
.section-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }
.updates { list-style: none; padding: 0; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); overflow: hidden; }
.updates > li + li { border-top: 1px solid var(--rule); }
.update { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 14px; gap: 6px 20px; align-items: start; padding: 18px 20px; color: inherit; text-decoration: none; }
a.update:hover { background: var(--paper); }
.update-date { padding-top: 5px; }
.update-text { display: grid; gap: 6px; min-width: 0; }
.update-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.update-title { font-family: var(--f-display); font-size: 1.0625rem; font-weight: 760; font-stretch: 106%; line-height: 1.3; color: var(--ink); }
a.update:hover .update-title { text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.update-sum { font-size: 0.9375rem; line-height: 1.55; color: var(--ink-2); max-width: 72ch; }
.update-go { width: 14px; height: 14px; margin-top: 5px; color: var(--ink-3); }
a.update:hover .update-go { color: var(--ink); }

/* ---------- signed out: one card ---------- */

.card-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 0 16px; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; max-width: 1200px; padding: 22px 8px; }
.card {
  width: min(440px, 100%);
  margin: 7vh 0 32px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--rule);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 24px; border-bottom: 1px solid var(--rule); }
.card-body { display: grid; gap: 18px; justify-items: start; padding: 26px 28px 30px; }
.card-body > form, .card-body > .stack { width: 100%; }
.card-body h1 { font-size: 1.75rem; font-weight: 800; font-stretch: 110%; line-height: 1.1; letter-spacing: -0.025em; }
.card-body .lede { color: var(--ink-2); }
/* Between sign-in methods. */
.or { display: flex; align-items: center; gap: 12px; width: 100%; color: var(--ink-3); font-size: 0.8125rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.card-foot { padding-bottom: 32px; font-size: 0.8125rem; color: var(--ink-3); }
.card-foot a { color: var(--ink-3); }

/* ---------- the console ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--header-h);
  padding: 0 20px 0 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.top-end { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.top-link {
  font-family: var(--f-mono);
  font-stretch: 87.5%;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-decoration: none;
  padding-block: 6px;
  border-bottom: 2px solid transparent;
}
.top-link:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }

/* Menus: the organization switcher and the account menu. */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 40;
  min-width: 260px;
  padding: 6px;
  border: 1px solid var(--rule-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 16px 40px var(--shadow);
}
.menu-panel .label { display: block; padding: 8px 10px 6px; }
.menu-panel ul { list-style: none; padding: 0; display: grid; gap: 1px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 0.9rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-item:hover { background: var(--sunk); }
.menu-item[aria-current] { font-weight: 650; }
.menu-item .check { margin-left: auto; color: var(--ink); }
.menu-item .chip { margin-left: auto; }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--rule); }

.switcher > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 300px;
  padding: 6px 10px 6px 6px;
  border-radius: 10px;
}
.switcher > summary:hover, .switcher[open] > summary { background: var(--sunk); }
.switcher-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--f-display); font-weight: 750; font-stretch: 106%; font-size: 1rem; }
.switcher .chev { color: var(--ink-3); }
.switcher .menu-panel { left: 0; }

.account > summary { display: block; border-radius: 10px; }
.account > summary:hover .avatar, .account[open] > summary .avatar { background: var(--sunk); }
.account .menu-panel { right: 0; }
.account-who { display: grid; gap: 2px; padding: 10px 10px 8px; line-height: 1.35; }
.account-who strong { font-weight: 650; }
.account-who span { font-size: 0.8125rem; color: var(--ink-3); overflow-wrap: anywhere; }

/* In the console, the account sits at the bottom of the navigation and opens upwards. */
/* Pinned to the bottom edge: the navigation above takes the rest of the height. */
.side-account { margin: 24px -16px 0 -20px; padding: 8px 12px 10px; border-top: 1px solid var(--rule); background: var(--paper); }
.account-side > summary { display: flex; align-items: center; gap: 10px; padding: 7px 8px; }
.account-side > summary:hover, .account-side[open] > summary { background: var(--sunk); }
.account-side > summary:hover .avatar, .account-side[open] > summary .avatar { background: var(--surface); }
.account-text { display: grid; min-width: 0; line-height: 1.3; }
.account-name { font-weight: 650; font-size: 0.875rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-email { font-size: 0.75rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-side .chev { margin-left: auto; color: var(--ink-3); }
.account-side .menu-panel { top: auto; bottom: calc(100% + 8px); left: 0; right: 0; min-width: 0; }

.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }

.side {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  padding: 28px 16px 0 20px;
  border-right: 1px solid var(--rule);
  font-size: 0.9rem;
}
.side > nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-inline: -4px; padding-inline: 4px; }
.side-group + .side-group { margin-top: 28px; }
.side-home { margin-bottom: 24px; }
.side-title {
  margin-bottom: 8px;
  padding: 0 10px 8px;
  border-bottom: 2px solid var(--ink);
  font-family: var(--f-mono);
  font-stretch: 87.5%;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.side-list { list-style: none; padding: 0; display: grid; gap: 1px; }
.side-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  line-height: 1.4;
  text-decoration: none;
}
.side-list a:hover { color: var(--ink); background: var(--sunk); }
.side-list a[aria-current="page"] { color: var(--ink); background: var(--sunk); font-weight: 650; box-shadow: inset 3px 0 0 var(--ink); }
.side-list .icon { color: var(--ink-3); }
.side-list a[aria-current="page"] .icon { color: var(--ink); }
.side-list .ext { margin-left: auto; width: 12px; height: 12px; color: var(--ink-3); }

.content { min-width: 0; padding: 40px 48px 96px; }
.page { display: grid; gap: 28px; max-width: 62rem; margin-inline: auto; align-content: start; }
/* Wide content (the type diagram, tables) scrolls inside its frame rather than widening the page. */
.page > * { min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.page-head-text { display: grid; gap: 10px; min-width: 0; }
.eyebrow {
  font-family: var(--f-mono);
  font-stretch: 87.5%;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.page-head h1 { font-size: clamp(2rem, 1.6rem + 1.2vw, 2.5rem); font-weight: 800; font-stretch: 112%; line-height: 1.05; letter-spacing: -0.03em; }
.lede { font-size: 1.0625rem; line-height: 1.55; color: var(--ink-2); max-width: 64ch; }
.section-title { display: flex; align-items: baseline; gap: 10px; font-size: 1.25rem; font-weight: 780; font-stretch: 110%; letter-spacing: -0.015em; }
.section-title .count { font-family: var(--f-mono); font-stretch: 87.5%; font-size: 0.75rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.section { display: grid; gap: 14px; min-width: 0; }

.settings-list { display: grid; gap: 0; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px 32px; padding: 20px; border-bottom: 1px solid var(--rule); }
.setting:last-child { border-bottom: 0; }
.setting-text { display: grid; gap: 4px; align-content: start; }
.setting-text h3 { font-family: var(--f-body); font-size: 0.9375rem; font-weight: 650; }
.setting-text p { font-size: 0.875rem; color: var(--ink-3); }
.setting-control { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.setting-control > input, .setting-control > .copy-field { flex: 1; min-width: 0; }

@media (max-width: 1023.98px) {
  .filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { grid-column: 1 / -1; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; overflow: visible; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .side-account { margin: 6px -12px 0; padding: 6px 4px 0; }
  .account-side .menu-panel { top: calc(100% + 8px); bottom: auto; right: auto; min-width: 260px; }
  .side nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
  .side-group + .side-group { margin-top: 0; }
  .side-home { margin-bottom: 0; }
  .side-title { display: none; }
  .side-list { display: flex; flex-wrap: wrap; gap: 2px; }
  .content { padding: 28px 20px 72px; }
}
@media (max-width: 720px) {
  .top { padding: 0 12px; gap: 8px; }
  .top .lockup-sep, .top-link { display: none; }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--rule); }
  .setting { grid-template-columns: minmax(0, 1fr); }
  .table .by, .table .hide-sm { display: none; }
  .table-wrap { overflow-x: auto; }
  .filter-row, .check-row { grid-template-columns: minmax(0, 1fr); }
  .store-meta { margin-top: -6px; }
  .hero { grid-template-columns: minmax(0, 1fr); padding: 20px 20px 24px; }
  .hero-art { order: -1; margin: 0 -4px 4px; }
  .update { grid-template-columns: minmax(0, 1fr) 14px; padding: 16px; }
  .update-date { padding-top: 0; }
  .update-text { grid-column: 1; }
  .update-go { grid-column: 2; grid-row: 1; margin-top: 0; }
  .confirm form { position: fixed; top: auto; right: 12px; bottom: 12px; left: 12px; width: auto; z-index: 50; }
}
