/* Crofter access pages: client and operator.
   Tokens mirror the Figma file ekGoryODH76kXVYLUSAe4H (Client Onboarding, rows H and I, 16 Nov 2026).
   Fonts: GT Standard is the brand face. No web licence files are in brand/assets/fonts/ yet, so the
   stacks below fall back to system faces. When web files exist, add @font-face rules here that point
   at a hosted copy (never commit the font files). */
:root {
  /* Colour */
  --ink: #101010;          /* Crofter/Ink */
  --paper: #f7f6f4;        /* Crofter/Paper */
  --stone: #d2cdb0;        /* Crofter/Stone */
  --clay: #c6a383;         /* Crofter/Clay */
  --red: #d04119;          /* Crofter/Red */
  --sand: #ebe6db;         /* Crofter/Sand */
  --rule: #724428;         /* Crofter/Rule */
  --mid-gray: #cccabf;     /* Neutral/Mid Gray 1 */
  --dark-gray: #292825;    /* Neutral/Dark Gray */
  --white: #ffffff;
  --muted: #474641;        /* Primary/Muted text */
  --copy-bg: #f0eee6;      /* Copy Row fill */

  /* Type */
  --font: "GT Standard", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "GT Standard Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --h1: 72px;
  --h2: 36px;
  --para-lg: 18px;
  --body: 16px;
  --small: 14px;
  --eyebrow: 12px;

  /* Layout */
  --margin: 30px;
  --radius: 8px;
  --field-radius: 3px;
  --index: 246px;
  --dur: 300ms;
  --fade: 150ms;
}
@media (max-width: 767px) {
  :root { --h1: 40px; --h2: 25px; --para-lg: 16px; --margin: 18px; --index: 0px; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--body)/1.4 var(--font);
}
img { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Type styles ---------------------------------------------------- */
.h1 { font-size: var(--h1); font-weight: 700; line-height: 1; letter-spacing: -0.01em; }
.h2 { font-size: var(--h2); font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; }
.lede { font-size: var(--para-lg); line-height: 1.3; }
.eyebrow { font: 500 var(--eyebrow)/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.direction { font: 400 var(--small)/1.2 var(--mono); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: var(--small); line-height: 1.3; }

/* ---- Header --------------------------------------------------------- */
.hero {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff);
  padding: 20px var(--margin) 64px;
}
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.topbar .avatar { width: 37px; height: 37px; }
.topbar .logo { width: 124px; height: 35px; }
.topbar nav { justify-self: end; display: flex; gap: 4px 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.topbar nav .eyebrow { font-weight: 400; padding: 8px 0; }
.intro { display: flex; gap: 20px; align-items: flex-end; padding-top: 180px; }
.intro-title { width: 716px; max-width: 50%; display: flex; flex-direction: column; gap: 24px; }
.intro-title .lede { max-width: 473px; }
.intro .meta, .intro .intro-side { flex: 1 1 0; min-width: 0; }
.meta { margin: 0; }
.meta > div { display: flex; gap: 16px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--mid-gray); }
.meta dt { width: 180px; flex: none; padding-top: 3px; }
.meta dd { margin: 0; flex: 1 1 0; min-width: 0; }
@media (max-width: 767px) {
  .hero { padding: 14px var(--margin) 32px; }
  .topbar .avatar { width: 30px; height: 30px; }
  .topbar .logo { width: 106px; height: 30px; }
  .intro { flex-direction: column; align-items: stretch; gap: 32px; padding-top: 48px; }
  .intro-title { width: auto; max-width: none; gap: 20px; }
  .meta > div { flex-direction: column; gap: 6px; }
  .meta dt { width: auto; padding-top: 0; }
}

/* ---- Body and sections ---------------------------------------------- */
.body { padding: 0 var(--margin); }
.steps { padding: 21px 0; }
.section { display: flex; align-items: flex-start; gap: 20px; padding: 49px 0 53px; border-top: 1px solid var(--rule); }
.section:first-child { border-top: 0; }
.section-left { width: 739px; max-width: 50%; flex: none; }
.section-left .h2 { max-width: 470px; }
.section-right { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.section-right > * { max-width: 100%; }
.section-right > .lede, .section-right > .card, .section-right > .notice, .section-right > .register { width: 100%; }
.section.plain { border-top-color: var(--muted); }
@media (max-width: 767px) {
  .section { flex-direction: column; gap: 14px; padding: 28px 0 32px; }
  .section-left { width: auto; max-width: none; }
}

/* Clay panel for the reference sections on the client page */
.panel { background: var(--clay); color: var(--ink); border-radius: var(--radius); padding: 0 21px; margin-bottom: 0; }
.panel .section { border-top-color: var(--rule); }
.panel .secondary-text { color: var(--dark-gray); }
@media (max-width: 767px) { .panel { padding: 0 16px; } }

/* Register: what Crofter can see */
.register { width: 100%; }
.reg-head, .reg-cells { display: flex; gap: 16px; align-items: flex-start; }
.reg-head { padding-bottom: 10px; }
.reg-head .eyebrow { color: var(--dark-gray); }
.reg-row { border-top: 1px solid var(--mid-gray); padding: 12px 0 14px; display: flex; flex-direction: column; gap: 6px; }
.panel .reg-row { border-top-color: rgba(16, 16, 16, 0.25); }
.reg-cells > :nth-child(1), .reg-head > :nth-child(1) { width: 220px; flex: none; }
.reg-cells > :nth-child(2), .reg-head > :nth-child(2) { width: 130px; flex: none; }
.reg-cells > :nth-child(3), .reg-head > :nth-child(3) { width: 120px; flex: none; }
.reg-cells > :nth-child(4), .reg-head > :nth-child(4) { flex: 1 1 0; min-width: 0; }
.reg-remove { color: var(--dark-gray); }
.reg-since { display: none; }
@media (max-width: 1100px) and (min-width: 768px) {
  .reg-cells > :nth-child(1), .reg-head > :nth-child(1) { width: 34%; }
  .reg-cells > :nth-child(2), .reg-head > :nth-child(2) { width: 18%; }
  .reg-cells > :nth-child(3), .reg-head > :nth-child(3) { width: 20%; }
}
@media (max-width: 767px) {
  .reg-head { display: none; }
  .reg-row:first-of-type { border-top: 0; }
  .reg-cells { display: block; }
  .reg-cells > * { display: inline; width: auto !important; font-size: var(--small); color: var(--dark-gray); }
  .reg-cells > :nth-child(1) { display: block; font-size: var(--body); color: var(--ink); margin-bottom: 4px; }
  .reg-cells > :nth-child(n+3)::before { content: " / "; }
  .reg-since { display: inline; }
}

/* ---- Footer --------------------------------------------------------- */
.foot { padding: 120px var(--margin) 30px; display: flex; flex-direction: column; gap: 24px; }
.foot .wordmark { width: 100%; height: auto; aspect-ratio: 1384 / 390; }
.foot-base { display: flex; justify-content: space-between; gap: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.foot-base a { text-decoration: none; }
.foot.slim { padding-top: 96px; }
@media (max-width: 767px) {
  .foot { padding-top: 48px; gap: 16px; }
  .foot-base { flex-direction: column; gap: 8px; }
  .foot-base .foot-mid { order: -1; }
}

/* ---- Buttons -------------------------------------------------------- */
.btn {
  -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 500 var(--eyebrow)/1.4 var(--font); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  border-radius: 999px; padding: 8px 15px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  background: transparent; color: var(--ink); min-height: 33px;
}
.btn.primary { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn.secondary { border-color: var(--ink); }
.btn.text { padding: 8px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary:not(:disabled):hover { background: var(--dark-gray); }
.btn.secondary:not(:disabled):hover, .btn.text:not(:disabled):hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.panel :focus-visible { outline-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
@media (max-width: 767px) { .btn { min-height: 40px; } }

/* ---- Status pills ---------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; flex: none; white-space: nowrap;
  font: 500 var(--eyebrow)/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px; border: 1px solid transparent;
  transition: background-color var(--dur) ease-out, color var(--dur) ease-out, border-color var(--dur) ease-out;
}
.pill.waiting { background: var(--ink); color: var(--white); border-color: var(--ink); }
.pill.received { border-color: var(--ink); color: var(--ink); }
.pill.checked { background: var(--stone); color: var(--ink); }
.pill.issue { background: var(--red); color: var(--white); }
.pill.removed { background: var(--sand); color: var(--ink); }
.pill.sitting { background: var(--sand); color: var(--muted); }

/* ---- Step rows ------------------------------------------------------- */
.row { border-top: 1px solid var(--rule); padding-bottom: 43px; }
.row-head { position: relative; display: flex; align-items: center; padding-top: 48px; gap: 0; }
.row-index { width: var(--index); flex: none; display: flex; align-items: center; gap: 10px; }
.tag { font: 500 var(--eyebrow)/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid var(--ink); border-radius: 5px; padding: 5px; }
.row-num { font-size: var(--h2); font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; }
.row-title { flex: 1 1 0; min-width: 0; font-size: var(--h2); font-weight: 500; line-height: 1.1; letter-spacing: -0.01em; }
.row-toggle {
  -webkit-appearance: none; appearance: none; background: none; border: 0; padding: 0; margin: 0; color: inherit;
  font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer;
}
.row-toggle::after { content: ""; position: absolute; inset: 0; }
.row-toggle:focus-visible { outline: none; }
.row-toggle:focus-visible::after { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 4px; }
.row.static .row-toggle { cursor: default; }
.row-detail { font: 400 var(--small)/1.3 var(--mono); color: var(--muted); text-align: right; margin-left: 24px; max-width: 46%; }
.row-head .undo { position: relative; z-index: 1; margin-left: 4px; margin-right: 40px; }
.row-head .pill { position: relative; margin-left: 24px; }
.row-head .row-detail + .pill { margin-left: 24px; }
.row-head .undo + .pill { margin-left: 0; }
.row:hover .row-toggle:not(:disabled) { text-decoration: none; }
.row[data-state="collapsed"]:not(.static) .row-head:hover .row-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }

.row-body {
  display: grid; grid-template-rows: 1fr; opacity: 1;
  transition: grid-template-rows var(--dur) ease-out, opacity var(--dur) ease-out;
}
.row-body-inner { min-height: 0; overflow: hidden; }
.row-body-pad { padding: 34px 0 0 var(--index); }
.row[data-state="collapsed"] .row-body {
  grid-template-rows: 0fr; opacity: 0; visibility: hidden;
  transition: grid-template-rows var(--dur) ease-out, opacity var(--fade) ease-out, visibility 0s linear var(--dur);
}

@media (max-width: 767px) {
  .row { padding-bottom: 22px; }
  .row-head { padding-top: 22px; gap: 10px; }
  .row-index { width: auto; }
  .row-index .tag, .row-detail, .row-head .undo { display: none; }
  .row-num { font-size: var(--h2); }
  .row-head .pill { margin-left: 8px; }
  .row-body-pad { padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .row-body, .row[data-state="collapsed"] .row-body, .pill { transition: none; }
}

/* ---- Cards, fields, copy rows, notices -------------------------------- */
.card { background: var(--white); border-radius: var(--radius); padding: 20px 21px 28px; display: flex; flex-direction: column; gap: 30px; }
.card.outline { background: transparent; border: 1px solid var(--ink); }
.card-group { display: flex; flex-direction: column; gap: 16px; }
.card .purpose { color: var(--muted); }
.open-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 21px; }
.open-line .direction { flex: 1 1 320px; min-width: 0; }
@media (max-width: 767px) { .card { padding: 18px 16px 22px; gap: 22px; } .open-line .direction { flex-basis: 100%; } }

.field { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 460px; }
.field.wide { max-width: none; }
.field label { display: block; }
.input, .field input:not([type="checkbox"]), .field select, .field textarea {
  width: 100%; font: 400 var(--body)/1.4 var(--font); color: var(--ink); background: var(--white);
  border: 1px solid var(--ink); border-radius: var(--field-radius); padding: 13px 16px; min-height: 50px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field select { -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field input:not([type="checkbox"]):focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.fields .field { max-width: none; }
.fields.asset { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 767px) { .fields, .fields.asset { grid-template-columns: 1fr; } }

.copy-row { display: flex; align-items: center; gap: 12px; background: var(--copy-bg); border-radius: var(--radius); padding: 8px 8px 8px 16px; width: 100%; }
.copy-row code { flex: 1 1 0; min-width: 0; font: 400 var(--body)/1.2 var(--mono); word-break: break-all; }
.role-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.role-line .role { font: 500 var(--body)/1.2 var(--mono); }

.notice { border-radius: var(--radius); padding: 12px 16px; font-size: var(--small); line-height: 1.3; }
.notice.warning { background: var(--sand); border-left: 3px solid var(--red); }
.notice.error { border: 1px solid var(--red); color: var(--red); }
.notice.info { background: var(--sand); }
.notice .actions { margin-top: 14px; }
.notice.info.big { padding: 20px 18px; font-size: var(--body); }

/* Screen-by-screen guide inside a step card (Meta's permissions dialog) */
.guide { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--mid-gray); padding-top: 16px; }
.guide-title { font-weight: 500; }
.guide-list { display: flex; flex-direction: column; }
.guide-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; padding: 10px 0; border-top: 1px solid var(--mid-gray); }
.guide-head { border-top: 0; padding-top: 0; }
.guide-on { font-weight: 500; }
.guide-label { display: none; color: var(--muted); font-weight: 400; }
@media (max-width: 767px) {
  .guide-head { display: none; }
  .guide-row { grid-template-columns: 1fr; gap: 2px; }
  .guide-head + .guide-row { border-top: 0; }
  .guide-type { font-weight: 500; }
  .guide-label { display: inline; }
}

/* Operator: checkboxes, client rows */
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; }
.checks label { display: flex; gap: 8px; align-items: flex-start; font-size: var(--body); line-height: 1.3; cursor: pointer; min-height: 27px; }
.checks input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
@media (max-width: 767px) { .checks { grid-template-columns: 1fr; } }
.fixed-value { font-size: 18px; line-height: 1.3; }

.client-row { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--rule); padding: 30px 0; }
.client-row:first-child { border-top-color: var(--muted); }
.client-row .row-num { width: 195px; flex: none; }
.client-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.client-counts { font-size: var(--small); line-height: 1.3; text-align: right; margin-right: 8px; }
@media (max-width: 767px) {
  .client-row { flex-wrap: wrap; padding: 20px 0; gap: 10px; }
  .client-row .row-num { width: auto; }
  .client-counts { order: 3; width: 100%; text-align: left; }
}

/* ---- Demo flag ------------------------------------------------------- */
.demo-flag { background: var(--ink); color: var(--white); font: 400 var(--eyebrow)/1.4 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; padding: 6px var(--margin); text-align: center; }

/* ---- Print: white ground, dark type ----------------------------------- */
@media print {
  :root { --h1: 34pt; --h2: 16pt; --margin: 0; --index: 120px; }
  body { background: #ffffff; font-size: 10.5pt; }
  .hero { background: none; padding: 0 0 18pt; }
  .intro { padding-top: 24pt; }
  .panel { background: #ffffff; padding: 0; border: 0; }
  .row-head { padding-top: 14pt; }
  .row { padding-bottom: 12pt; break-inside: avoid; }
  .section { padding: 16pt 0; break-inside: avoid; }
  .card { border: 1px solid var(--mid-gray); }
  .btn, .actions, .demo-flag, .no-print, .row-head .undo { display: none !important; }
  .row-index .tag, .row-detail { display: initial !important; }
  .row-body { transition: none !important; }
  .pill { border: 1px solid var(--ink); }
  .pill.waiting, .pill.issue { background: #ffffff; color: var(--ink); }
  .foot { padding: 24pt 0 0; }
  .foot .wordmark { width: 40%; }
  a { color: inherit; text-decoration: none; }
}
