/* Existing signature flow/editor geometry, shared by every shell. */
.signote {
  padding: 11px 13px;
  border: 1px solid var(--hair);
  border-left: 3px solid var(--blue);
  border-radius: var(--r-sm);
  background: var(--blue-lt);
  color: var(--ink-2);
  font-size: 13px; line-height: 1.55;
}
.signote--ok { border-left-color: var(--green); background: var(--green-lt); }
/* A send going out with the agent's own boxes empty. Amber rather than red on
   purpose: Greg's answer to question 5 (2026-09-17) was warn, never refuse, and
   a red panel beside a button that still works reads as a fault rather than a
   note. Found needed by the four-step send flow. */
.signote--warn { border-left-color: var(--amber); background: var(--amber-lt); }

/* The seal. Monospace and allowed to break anywhere, because 64 hex characters
   in a proportional face is unreadable and 64 that overflow their box is
   worse. */
.seal {
  font-family: var(--f-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 12px; line-height: 1.6; letter-spacing: .01em;
  color: var(--ink-2); word-break: break-all;
}

/* ---- The three-step send ------------------------------------------------ */
.steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.steps__s { display: flex; align-items: center; gap: 7px; }
.steps__s + .steps__s::before {
  content: ""; width: 22px; height: 1px; background: var(--hair); margin-right: 7px;
}
.steps__n {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  border: 1px solid var(--hair); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; color: var(--steel-lt);
}
.steps__t { font-size: 12.5px; color: var(--steel); }
.steps__s.is-on .steps__n { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps__s.is-on .steps__t { color: var(--ink); font-weight: 600; }
.steps__s.is-done .steps__n { background: var(--green-lt); border-color: var(--green-lt); color: var(--green); }

/* ---- The placement editor ----------------------------------------------- */
.fieldbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 9px 11px; border: 1px solid var(--hair); border-radius: var(--r);
  background: var(--paper);
  position: sticky; top: 0; z-index: 3;
}
.fieldbar__hint { font-size: 12px; color: var(--steel-lt); margin-right: 2px; }
.fieldbar__k {
  border: 1px solid var(--hair); background: var(--card);
  border-radius: 999px; padding: 5px 11px;
  /* Longhand: `inherit` is not a valid family inside the font shorthand, so
     `font: 600 12px/1 inherit` is dropped entirely and the button renders in
     the browser default. Same bug as the signing page's consent block. */
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1;
  color: var(--steel); cursor: pointer;
}
.fieldbar__k:hover { border-color: var(--mist); color: var(--ink); }
.fieldbar__k.is-on { background: var(--ui-raised, var(--ink)); border-color: var(--ink); color: #fff; }

.docpage {
  position: relative; border: 1px solid var(--hair); border-radius: var(--r);
  overflow: hidden; background: var(--card);
}
/* ⚠ The image is the coordinate frame every field is measured against, so it
   must fill the width exactly and carry no border of its own. A field's x is a
   fraction of THIS element's box; anything that changes that box relative to
   the rendered page moves every box on it. */
.docpage__img { display: block; width: 100%; height: auto; }
.docpage__no {
  position: absolute; right: 8px; top: 8px;
  background: rgba(16, 24, 32, .62); color: #fff;
  border-radius: 999px; padding: 2px 9px; font-size: 11px;
}

.fieldbox {
  position: absolute;
  border: 1.5px dashed var(--blue);
  background: rgba(43, 108, 176, .12);
  border-radius: 3px;
  cursor: move; touch-action: none;
  display: flex; align-items: center;
  min-width: 14px; min-height: 12px;
}
.fieldbox--signature, .fieldbox--initials {
  border-style: solid; background: rgba(43, 108, 176, .20);
}
/* Each signer gets a colour, because on a two-signer agreement the only thing
   distinguishing "the merchant signs here" from "we countersign here" is which
   box is which, and reading a number in 9px type is not that. */
.fieldbox--s2 { border-color: var(--green); background: rgba(28, 122, 86, .14); }
.fieldbox--s3 { border-color: var(--amber); background: rgba(160, 110, 20, .14); }
.fieldbox--s4 { border-color: var(--crimson); background: rgba(187, 32, 49, .12); }

/* Who fills a box, legible on the page rather than only inside the dialog that
   sets it. Greg's answer to question 4 (2026-09-17) was three sources, and an
   editor where the important property is invisible until you double-click is an
   editor where half the fields are wrong and nobody can see it.
   ⚠ These come AFTER the per-signer colours so that a record or agent box does
   not also read as signer 2's. */
.fieldbox--fill-record {
  border-style: solid; border-color: var(--steel);
  background: rgba(88, 104, 122, .12);
}
.fieldbox--fill-sender {
  border-style: solid; border-color: var(--green);
  background: rgba(28, 122, 86, .12);
}
.fieldbox__label {
  font-size: 10.5px; font-weight: 600; color: inherit;
  padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.fieldbox__x {
  position: absolute; right: -8px; top: -8px;
  width: 17px; height: 17px; border-radius: 50%;
  border: 1px solid var(--hair); background: var(--card);
  color: var(--steel); font-size: 12px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.fieldbox__x:hover { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.fieldbox__grip {
  position: absolute; right: -4px; bottom: -4px;
  width: 11px; height: 11px; border-radius: 2px;
  background: var(--card); border: 1.5px solid currentColor;
  cursor: nwse-resize;
}
/* Required, said out loud. It was always enforced in sign_document(), but the
   only way to reach it was a double-click nothing mentioned — so on the
   signing screen it read as a feature that did not exist. Mirrors __x on the
   opposite corner so the two controls read as a pair. */
.fieldbox__req {
  position: absolute; left: -8px; top: -8px;
  width: 17px; height: 17px; border-radius: 50%;
  border: 1px solid var(--hair); background: var(--card);
  color: var(--steel-lt); font: 700 13px/1 var(--f-body); cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.fieldbox__req:hover { border-color: var(--steel); color: var(--ink); }
.fieldbox__req.is-on { background: var(--crimson); border-color: var(--crimson); color: #fff; }
/* The page being dragged onto. Outline rather than border: a border would
   change .docpage's box, and every field's x is a fraction of that box. */
.docpage.is-over { outline: 2px dashed var(--crimson); outline-offset: 3px; }

