/* companion•project — privacy-first, zero external assets */
:root {
  color-scheme: dark;
  --bg: #242422;
  --bg-elevated: #2d2c29;
  --bg-subtle: #373633;
  --rule: #3c3a37;
  --border: #504e49;
  --border-strong: #85827b;
  --text: #dedad3;
  --text-muted: #c0bcb4;
  --text-faint: #a29e96;
  --accent: #d4b28f;
  --accent-hover: #e1c3a4;
  --accent-soft: #403831;
  --accent-ink: #282521;
  --ok-bg: #303831;
  --ok-text: #becbb7;
  --ok-border: #505d4e;
  --warn-bg: #3d362d;
  --warn-text: #ddc29b;
  --warn-border: #685946;
  --danger: #e1b0a6;
  --danger-hover: #edc3bb;
  --danger-bg: #40322f;
  --danger-border: #896c64;
  --radius: 3px;
  --radius-lg: 6px;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  /* Disciplined centered container (1088px outer / 1040px inner reading frame). */
  --measure: 42rem;
  --section-gap: clamp(3rem, 6vw, 4.5rem);
  --header-h: 4.5rem;
}

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

[hidden] {
  display: none !important;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
  text-underline-offset: 0.22em;
  transition: color 0.12s ease, text-decoration-color 0.12s ease;
}

a:hover {
  color: var(--text);
  text-decoration-color: var(--accent);
}

:focus-visible {
  outline: 2.5px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
}

.container {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

[id] {
  scroll-margin-top: calc(var(--header-h) + 1.5rem);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.header-inner {
  display: flex;
  align-items: center;
  column-gap: clamp(0.5rem, 1.6vw, 1.25rem);
  min-height: var(--header-h);
}

/* The wordmark itself is unchanged: Georgia, 1.65rem, -0.045em, accent dot. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-right: auto;
  color: var(--text);
  text-decoration: none;
  font: 1.65rem Georgia, serif;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.brand:hover {
  color: var(--text);
}

/* The 40px halo keeps its exact box. Its drawn mark sits up and left inside the
   128-unit viewBox, so the box is nudged to put the visible halo on the text
   edge and the tilted ring's centre on the lowercase x-height of Georgia
   (c/o/e ink), with the tail's extra weight balancing just below. */
.brand img {
  flex: none;
  position: relative;
  top: 2px;
  width: 40px;
  height: 40px;
  margin-left: -5px;
}

/* Lowercase-only, so the line box centre sits above the letters: raise the
   wordmark until its x-height shares one centre line with the halo, nav and avatar. */
.brand > span {
  position: relative;
  top: -0.09em;
}

.brand-dot {
  color: var(--accent);
}

/* Georgia's bullet sits slightly above the x-height centre; drop it onto the
   centre of the lowercase body (header wordmark only). */
.brand .brand-dot {
  position: relative;
  top: 0.05em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0 0.7rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  text-underline-offset: 0.55em;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.005em;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link[aria-current="page"] {
  color: var(--text);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
}

.site-nav .nav-cta {
  margin-left: 0.6rem;
  background: transparent;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  color: var(--accent);
}

.site-nav .nav-cta:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-hover);
}

.nav-toggle {
  display: none;
  position: relative;
  min-height: 2.5rem;
  padding: 0 0.8rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: 600 0.875rem/1 var(--font-sans);
  cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

/* 40px visual controls with a 44px touch target. */
.nav-toggle::after,
#account-toggle::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
}

.account-nav {
  position: relative;
  flex: none;
}

#account-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--accent);
  font: 1.2rem/1 Georgia, serif;
  cursor: pointer;
}

#account-toggle:hover,
#account-toggle[aria-expanded="true"] {
  background: var(--bg-subtle);
}

#account-menu {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: min(17rem, calc(100vw - 2rem));
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  box-shadow: 0 18px 40px rgba(18, 17, 16, 0.45);
}

#account-menu .nav-link {
  display: flex;
  width: 100%;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 0;
  background-color: transparent;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

#account-menu .nav-link:hover,
#account-menu .nav-link:focus-visible {
  background: var(--bg-subtle);
}

#account-menu .nav-link[aria-current="page"] {
  text-decoration: none;
  font-weight: 600;
}

#nav-account-email {
  padding: 0.55rem 0.75rem 0.7rem;
  margin-bottom: 0.3rem;
  border-bottom: 1px solid var(--rule);
  color: var(--text-faint);
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* ---------- Page frame ---------- */
main.container {
  flex: 1;
  padding-block: clamp(2.25rem, 5vw, 4.5rem) 0;
}

.view-panel[hidden] {
  display: none !important;
}

/* ---------- Typography ---------- */
h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--text);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 4.4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.024em;
}

h2 {
  font-size: clamp(1.3rem, 1.9vw, 1.5rem);
  line-height: 1.25;
  letter-spacing: -0.012em;
}

h3 {
  font-size: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.006em;
}

p {
  margin: 0 0 1em;
}

.lead {
  margin: 0;
  max-width: var(--measure);
  font-family: var(--font-serif);
  font-size: clamp(1.18rem, 1.7vw, 1.36rem);
  line-height: 1.5;
  letter-spacing: -0.004em;
  color: var(--text-muted);
  text-wrap: pretty;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.875rem;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--bg-subtle);
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}

/* ---------- Editorial & card layout ---------- */
.page-head {
  max-width: 46rem;
  margin: 0 auto clamp(2.25rem, 4.5vw, 3.25rem);
  text-align: center;
}

.page-head > h1 {
  font-size: clamp(2.15rem, 4vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.page-head > .lead {
  margin: 1rem auto 0;
  max-width: 42rem;
  text-wrap: balance;
}

.hero {
  max-width: 48rem;
  margin: 0 auto clamp(2.75rem, 5.5vw, 4rem);
  padding-top: clamp(0.75rem, 3.5vw, 2.5rem);
  text-align: center;
}

.hero > h1 {
  font-size: clamp(2.5rem, 5vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.hero-lead {
  margin: 1.25rem auto 0;
  max-width: 41rem;
}

.hero-actions {
  justify-content: center;
  margin-top: 1.85rem;
  gap: 0.75rem 1rem;
}

.hero-note {
  margin: 1.35rem auto 0;
  max-width: 39rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-faint);
  text-wrap: pretty;
}

.site-section + .site-section {
  margin-top: var(--section-gap);
  padding-top: clamp(2.5rem, 5vw, 3.75rem);
  border-top: 1px solid var(--rule);
}

.section-head {
  max-width: 44rem;
  margin: 0 auto clamp(1.75rem, 3.5vw, 2.35rem);
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.6rem, 2.5vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.016em;
}

.section-intro {
  margin: 0.75rem auto 0;
  max-width: 43rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-muted);
  text-wrap: balance;
}

.section-foot {
  margin: 1.75rem 0 0;
  text-align: center;
}

.more {
  font-size: 0.95rem;
  white-space: nowrap;
}

.promise {
  margin: 2.15rem auto 0;
  max-width: 40rem;
  text-align: center;
  font: italic clamp(1.35rem, 2.2vw, 1.7rem)/1.38 var(--font-serif);
  letter-spacing: -0.008em;
  color: var(--text);
  text-wrap: balance;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  margin-top: 1.6rem;
}

.actions > a:not(.btn) {
  font-size: 0.95rem;
}

/* Layered #242422 card surface with soft hairline borders. */
.surface-card {
  background: linear-gradient(180deg, rgba(222, 218, 211, 0.024) 0%, rgba(222, 218, 211, 0.004) 100%), var(--bg-elevated);
  border: 1px solid var(--rule);
  box-shadow: inset 0 1px 0 rgba(222, 218, 211, 0.045);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 2.8vw, 1.8rem);
  transition: border-color 0.14s ease;
}

.surface-card:hover {
  border-color: var(--border);
}

.surface-card h2,
.surface-card h3 {
  font-size: 1.24rem;
  line-height: 1.28;
}

.surface-card p {
  margin: 0;
  font-size: 0.975rem;
  line-height: 1.65;
  color: var(--text-muted);
  text-wrap: pretty;
}

.surface-card p + p {
  margin-top: 0.85rem;
}

.card-kicker {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Five independent services in a balanced multi-column grid (3 over 2 on desktop). */
.services-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.15rem;
}

.service-card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.service-card:nth-child(4),
.service-card:nth-child(5) {
  grid-column: span 3;
}

.card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.75rem;
}

/* Four core philosophy pillars & 2-column FAQ/setup grids. */
.pillars-grid,
.card-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.pillar-card h2,
.pillar-card h3,
.card-grid-2 .surface-card h2 {
  margin-bottom: 0.65rem;
}

/* Setup steps: hanging serif numerals keep the text edge clean. */
.guide-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
  font-size: 0.975rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.guide-list li {
  position: relative;
  padding-left: 2rem;
  counter-increment: step;
}

.guide-list li + li {
  margin-top: 0.85rem;
}

.guide-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.5;
  color: var(--text-faint);
}

/* ---------- Layout helpers ---------- */
.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack-lg {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.row-between {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.m-0 {
  margin: 0;
}

.mt-sm {
  margin-top: 0.5rem;
}

.justify-end {
  justify-content: flex-end;
}

.not-found-wrap {
  padding: 3rem 1.25rem;
}

/* ---------- Cards & account forms ---------- */
.card {
  background: linear-gradient(180deg, rgba(222, 218, 211, 0.024) 0%, rgba(222, 218, 211, 0.004) 100%), var(--bg-elevated);
  border: 1px solid var(--rule);
  box-shadow: inset 0 1px 0 rgba(222, 218, 211, 0.045);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}

.auth-shell {
  width: 100%;
  max-width: 27rem;
  margin: clamp(0rem, 2.5vw, 1.5rem) auto 0;
  overflow-wrap: anywhere;
}

.auth-shell.card {
  gap: 1.5rem;
}

.auth-shell h1,
.auth-head h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.3rem);
  line-height: 1.12;
}

.auth-intro {
  margin: 0.65rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-wrap: pretty;
}

.auth-foot {
  margin: 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.form-fieldset:disabled {
  color: var(--text-muted);
}

.form-fieldset > .btn {
  margin-top: 0.35rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  color: var(--text);
}

.field input {
  width: 100%;
  min-height: 2.875rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.12s ease;
}

.field input:hover:not(:disabled) {
  border-color: var(--border-strong);
}

.field input::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

.field input:autofill {
  box-shadow: inset 0 0 0 1000px var(--bg);
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
}

.field input:focus {
  border-color: var(--accent);
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-faint);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.925rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:disabled,
.field input:disabled {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-muted);
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--accent-ink);
}

.btn-danger-solid {
  background: var(--danger);
  color: var(--accent-ink);
}

.btn-danger-solid:hover:not(:disabled) {
  background: var(--danger-hover);
}

.btn-sm {
  min-height: 2.25rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.85rem;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.badge-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: currentColor;
}

.badge-online {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: var(--ok-border);
}

.badge-offline {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: var(--border);
}

.badge-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.badge-pending {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-border);
}

.badge-revoked {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

/* ---------- Status alert ---------- */
.alert {
  padding: 0.85rem 1.05rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 0.925rem;
  line-height: 1.5;
}

#site-alert {
  margin-bottom: 1.75rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

/* Keep the alert on the same measure as the form it reports on. */
#main-content:has(> .view-auth:not([hidden])) > #site-alert,
#main-content:has(> [data-route-view="/account"]:not([hidden]) > #dashboard-auth-gate:not([hidden])) > #site-alert {
  max-width: 27rem;
  margin-inline: auto;
}

.alert-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: var(--ok-border);
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-border);
}

.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

.alert-actions {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ---------- Dashboard ---------- */
.dash-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem 2rem;
  padding-bottom: 1.75rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.dash-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
}

.heading-dash {
  font-size: clamp(1.9rem, 3.4vw, 2.4rem);
  line-height: 1.1;
}

.dash-badges,
.dash-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.dash-facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  justify-content: start;
  gap: 1rem clamp(1.5rem, 4vw, 3.5rem);
  margin: 0;
}

.dash-facts dt {
  margin-bottom: 0.2rem;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: var(--text-faint);
}

.dash-facts dd {
  margin: 0;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.dash-facts dd strong {
  font-weight: 600;
}

#dash-active-summary {
  gap: 0.5rem;
}

.dash-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}

.panel {
  padding: 1.5rem 1.6rem 0.6rem;
  background: linear-gradient(180deg, rgba(222, 218, 211, 0.024) 0%, rgba(222, 218, 211, 0.004) 100%), var(--bg-elevated);
  border: 1px solid var(--rule);
  box-shadow: inset 0 1px 0 rgba(222, 218, 211, 0.045);
  border-radius: var(--radius-lg);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.1rem;
}

.panel-head h2 {
  font-size: 1.45rem;
}

.panel-intro {
  margin: 0.3rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.panel-head > a {
  font-size: 0.875rem;
  white-space: nowrap;
}

.entity-list {
  display: flex;
  flex-direction: column;
}

.entity-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 1.05rem 0 1.1rem;
  border-top: 1px solid var(--rule);
}

.entity-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
  flex: 1 1 16rem;
}

.entity-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.6rem;
  font-weight: 600;
}

.entity-sub {
  font-size: 0.76rem;
  line-height: 1.55;
  color: var(--text-faint);
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 1.1rem 0 1.2rem;
  border-top: 1px solid var(--rule);
  color: var(--text-muted);
  font-size: 0.925rem;
}

/* ---------- Revoke dialog ---------- */
dialog.modal-dialog {
  width: min(28rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(18, 17, 16, 0.5);
}

dialog.modal-dialog:not([open]) {
  display: none;
}

dialog.modal-dialog::backdrop {
  background: rgba(28, 27, 25, 0.78);
}

.modal-panel {
  padding: 1.6rem 1.6rem 1.4rem;
}

.modal-panel h2 {
  font-size: 1.5rem;
}

.modal-desc {
  margin: 0;
  font-size: 0.925rem;
  line-height: 1.6;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: clamp(4rem, 9vw, 7rem);
  border-top: 1px solid var(--rule);
  padding: 1.75rem 0 2.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.footer-brand {
  font: 1.2rem Georgia, serif;
  letter-spacing: -0.045em;
  color: var(--text);
  white-space: nowrap;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration-color: transparent;
}

.footer-nav a:hover {
  color: var(--text);
  text-decoration-color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }

  /* Fixed padding (not min-height) keeps the halo row on its centre line when
     the menu opens beneath it. */
  .header-inner {
    flex-wrap: wrap;
    min-height: 0;
    padding-block: calc((var(--header-h) - 2.5rem) / 2);
  }

  .site-nav {
    order: 1;
    display: none;
    width: 100%;
    max-height: calc(100dvh - var(--header-h) - 1rem);
    overflow-y: auto;
    margin-top: calc((var(--header-h) - 2.5rem) / 2);
    padding: 0 0 0.35rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border-top: 1px solid var(--rule);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav .nav-link {
    min-height: 3rem;
    padding: 0 0.15rem;
    border-bottom: 1px solid var(--rule);
    border-radius: 0;
    font-size: 1rem;
  }

  .site-nav .nav-cta {
    margin: 1.1rem 0 0;
    min-height: 2.75rem;
    font-size: 0.95rem;
  }
}

@media (max-width: 960px) {
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-card,
  .service-card:nth-child(4),
  .service-card:nth-child(5) {
    grid-column: auto;
  }

  .service-card:nth-child(5) {
    grid-column: 1 / -1;
  }

  .dash-panels {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 4rem;
    --section-gap: 2.75rem;
  }

  main.container {
    padding-top: 1.75rem;
  }

  .hero,
  .page-head,
  .section-head,
  .section-foot,
  .promise {
    text-align: left;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .hero > h1 {
    font-size: clamp(2.35rem, 11vw, 3.2rem);
    line-height: 1.04;
    letter-spacing: -0.028em;
  }

  .services-grid,
  .pillars-grid,
  .card-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .service-card:nth-child(5) {
    grid-column: auto;
  }

  .promise {
    margin-top: 1.75rem;
  }

  .dash-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.1rem;
  }

  .dash-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.85rem;
  }

  .panel {
    padding: 1.25rem 1.15rem 0.4rem;
  }

  .entity-item .row {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
  }
}

/* Narrow phones: fit halo, wordmark and controls on one line. The wordmark
   scales only as far as the available width requires (Georgia is ~8.1em wide). */
@media (max-width: 30rem) {
  .container {
    padding-inline: 1rem;
  }

  .header-inner {
    column-gap: 0.5rem;
  }

  .nav-toggle {
    padding: 0 0.7rem;
  }

  .brand {
    font-size: min(1.65rem, calc((100vw - 9rem) / 8.2));
  }

  .header-inner:has(.account-nav:not([hidden])) .brand {
    font-size: min(1.65rem, calc((100vw - 12.25rem) / 8.2));
  }
}

@media (max-width: 22.5rem) {
  .container {
    padding-inline: 0.85rem;
  }

  .brand {
    gap: 0.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
