:root { --ink: #14181D; --midnight: #1E2429; --softCharcoal: #2E363C; --orange: #F28C28; --ember: #D9531E; --gold: #D8AC4A; --goldDeep: #9A7B2E; --goldHover: #C49C42; --teal: #2E7D8A; --slate: #4A6572; --mist: #C8CFD5; --cardGrey: #E8ECEF; --hairline: #E7E1D5; --cream: #FBF8F2; --paper: #FFFFFF; --green: #2F8F5B; --amber: #E0A106; --red: #C0392B; }

/* The developer site's stylesheet (SD-221, redesigned by SD-260). The generator puts a :root block of the brand
   palette (functions/src/brand.ts) in front of this, so the colours below are variables and are named there once.

   It is the whole site's shell, not only the docs': the portal (portal-src/) links it too, for the same header,
   sidebar, footer, type scale and buttons, and adds only its own components in portal.css.

   The palette is suredocs.ie's with the emphasis inverted: the broker site leads with orange and gold on cream,
   so this one leads with teal on cool white, and keeps orange for the wordmark alone. */

:root {
  --accent: var(--teal);
  --accent-strong: #236570;
  --accent-soft: color-mix(in srgb, var(--teal) 9%, var(--paper));
  --page: #F5F7F9;
  --surface: var(--paper);
  --border: #DFE4E8;
  --border-strong: var(--mist);
  --text: var(--softCharcoal);
  --text-muted: var(--slate);
  --heading: var(--ink);

  /* System faces only: the docs load nothing from another host (build-api-docs.test.ts), fonts included. */
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* One type scale for the whole site. */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 0.9375rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;

  /* Every control in a row is this tall, so buttons, fields and lozenges share a top and a bottom. */
  --control-height: 2.5rem;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-card: 0 1px 2px rgba(20, 24, 29, 0.05), 0 1px 3px rgba(20, 24, 29, 0.06);
  --shadow-raised: 0 24px 48px rgba(20, 24, 29, 0.18);
  --header-height: 4rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: var(--text-base)/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

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

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

/*
  ===================== HEADER =====================
*/

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: var(--header-height);
  padding: 0 1.5rem;
  background: var(--midnight);
  color: var(--paper);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

.brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.85rem;
}

.brand img {
  display: block;
  height: 2.1rem;
  width: auto;
}

.brand-product {
  padding-left: 0.85rem;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.top-nav {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 0.25rem;
}

.top-nav a {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  border-bottom: 3px solid transparent;
  color: var(--mist);
  font-size: var(--text-md);
  font-weight: 500;
}

.top-nav a:hover {
  color: var(--paper);
}

.top-nav a[aria-current='page'] {
  border-bottom-color: var(--teal);
  color: var(--paper);
}

.header-end {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
  font-size: var(--text-sm);
}

.header-end .external-link {
  color: var(--mist);
}

.header-end .external-link:hover {
  color: var(--paper);
}

/* Omnipresent account link, top right: a quiet outline "Sign in" until site-auth.js finds a signed-in
   Firebase user, then the filled "Your integrations" button. */
.site-header .account-link {
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
  padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--radius);
  color: var(--paper);
  font-weight: 600;
}

.site-header .account-link:hover {
  border-color: var(--paper);
}

.site-header .account-link.account-link-signed-in {
  border-color: var(--teal);
  background: var(--teal);
}

.site-header .account-link.account-link-signed-in:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

/*
  ===================== LAYOUT AND SIDEBAR =====================
*/

.layout {
  display: flex;
  flex: 1 0 auto;
  gap: 3rem;
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.site-nav {
  flex: 0 0 14rem;
}

.site-nav-inner {
  position: sticky;
  top: calc(var(--header-height) + 2.5rem);
}

.nav-group {
  margin: 1.5rem 0 0.4rem;
  padding: 0 0.75rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group:first-child {
  margin-top: 0;
}

.site-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--text-md);
  line-height: 1.4;
  text-decoration: none;
}

.site-nav a:hover {
  background: color-mix(in srgb, var(--mist) 35%, transparent);
  color: var(--heading);
}

.site-nav a[aria-current='page'] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}

main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 50rem;
}

/*
  ===================== PROSE =====================
*/

h1, h2, h3 {
  color: var(--heading);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
}

h2 {
  margin: 2.75rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 1.5rem;
}

h3 {
  margin: 2rem 0 0.75rem;
  font-size: var(--text-lg);
}

p, ul, ol {
  margin: 0 0 1rem;
}

li + li {
  margin-top: 0.35rem;
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

code {
  padding: 0.15em 0.35em;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
}

pre {
  overflow-x: auto;
  margin: 0 0 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  background: var(--midnight);
  color: var(--cardGrey);
  line-height: 1.55;
}

pre code {
  padding: 0;
  border: none;
  background: none;
}

table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 1.25rem;
  font-size: var(--text-md);
}

th, td {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--page);
  color: var(--heading);
  font-weight: 600;
}

td {
  background: var(--surface);
}

/*
  ===================== LANDING PAGE =====================
*/

.hero {
  margin-bottom: 2.5rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin-bottom: 0.75rem;
  font-size: 2.75rem;
  letter-spacing: -0.025em;
}

.lede {
  max-width: 40rem;
  margin-bottom: 2rem;
  color: var(--text-muted);
  font-size: var(--text-lg);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(20, 24, 29, 0.08);
  color: var(--text);
  transform: translateY(-2px);
}

.card-kind {
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-title {
  margin-bottom: 0.4rem;
  color: var(--heading);
  font-size: var(--text-lg);
  font-weight: 700;
}

.card-text {
  flex: 1;
  margin-bottom: 1rem;
  font-size: var(--text-md);
}

.card-action {
  color: var(--accent);
  font-size: var(--text-md);
  font-weight: 600;
}

/* The landing page's own markdown follows the hero; its first heading needs no rule above it. */
.hero + h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/*
  ===================== FOOTER =====================
*/

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 1.5rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

/*
  ===================== ICON BUTTONS =====================
  Shared by the docs' pages and the portal.
*/

.icon-button {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: var(--control-height);
  height: var(--control-height);
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.icon-button:hover {
  border-color: var(--slate);
  color: var(--heading);
}

.icon-button svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* A copy button is quiet: no border until it is pointed at. */
.copy-button {
  width: 2rem;
  height: 2rem;
  border-color: transparent;
  background: transparent;
}

.copy-button svg {
  width: 1rem;
  height: 1rem;
}

.copy-button:hover {
  border-color: var(--border);
  background: var(--page);
}

.copy-button.copied {
  color: var(--green);
}

.copy-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.copy-field .copy-button {
  width: var(--control-height);
  height: var(--control-height);
}

/* A page's title, with the button that copies the page as Markdown beside it, out of the way. */
.page-title {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.page-title .copy-markdown {
  margin-top: 0.45rem;
}

/* Getting started's prompt for an AI coding assistant: closed, one quiet line, until it is opened. */
.agent-prompt {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.agent-prompt summary {
  cursor: pointer;
}

.agent-prompt .copy-field {
  margin: 0.75rem 0 0.5rem;
}

/*
  ===================== BUTTONS =====================
  Shared by the landing page and the portal.
*/

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: var(--control-height);
  padding: 0 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--heading);
  font: 600 var(--text-md)/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.button:hover {
  border-color: var(--slate);
  background: var(--page);
  color: var(--heading);
}

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
}

.button-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: var(--paper);
}

.button-danger {
  border-color: color-mix(in srgb, var(--red) 45%, var(--paper));
  color: var(--red);
}

.button-danger:hover {
  border-color: var(--red);
  background: color-mix(in srgb, var(--red) 6%, var(--paper));
  color: var(--red);
}

.button:disabled {
  opacity: 0.55;
  cursor: default;
}

/*
  ===================== API REFERENCE =====================
*/

.reference-page main {
  max-width: none;
}

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

#swagger-ui .curl-command {
  margin: 0 0 1rem;
  padding: 0 1.25rem;
}

#swagger-ui .curl-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#swagger-ui .curl-command pre {
  margin: 0.25rem 0 0;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  border-radius: 4px;
  background: var(--midnight);
  color: var(--paper);
  font-size: 0.85rem;
  line-height: 1.5;
}

#swagger-ui .topbar {
  display: none;
}

/*
  ===================== NARROW SCREENS =====================
*/

@media (max-width: 60rem) {
  .top-nav,
  .header-end .external-link {
    display: none;
  }
}

@media (max-width: 48rem) {
  .site-header {
    gap: 1rem;
    padding: 0 1rem;
  }

  .brand img {
    height: 1.6rem;
  }

  .brand-product {
    font-size: var(--text-base);
  }

  .layout {
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem 1rem 3rem;
  }

  /* The sidebar becomes one row of links that scrolls sideways, so the page's own content starts near the top. */
  .site-nav {
    flex: none;
    margin: -0.5rem -1rem 0;
    border-bottom: 1px solid var(--border);
  }

  .site-nav-inner {
    position: static;
    display: flex;
    gap: 0.25rem;
    padding: 0 1rem 0.75rem;
    overflow-x: auto;
  }

  .nav-group {
    display: none;
  }

  .site-nav ul {
    display: flex;
    gap: 0.25rem;
  }

  .site-nav li + li {
    margin-top: 0;
  }

  .site-nav a {
    white-space: nowrap;
  }

  .hero h1 {
    font-size: 2.1rem;
  }

  h1 {
    font-size: 1.85rem;
  }
}
