/* Pipeline Sign: quiet, document-like UI. One accent colour (primary blue); no gradients, no card kits. */
:root {
  --navy: #0C2340; --ink: #0B1524; --primary: #185FA5; --accent: #2F7FE0; --light: #85B7EB;
  --text: #3B4A5E; --muted: #64748B; --rule: #E2E8F0; --paper: #F6F8FB; --white: #fff;
  --sig: #13305a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 15px/1.6 Inter, system-ui, sans-serif; min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: Outfit, Inter, sans-serif; color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 14px; }
h2 { font-size: 20px; margin: 0 0 12px; }
a { color: var(--primary); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden, [hidden] { display: none !important; }

/* Bar and footer */
.bar { background: var(--white); border-bottom: 1px solid var(--rule); }
.bar-in, .foot-in, .page, main.sheet-page { max-width: 880px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.wide { max-width: 1120px; }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { display: block; height: 28px; width: auto; }
.product { font: 500 15px Outfit, sans-serif; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--rule); }
.who { font-size: 13px; color: var(--muted); text-align: right; }
.who strong { color: var(--ink); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav a { color: var(--text); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.foot { margin-top: auto; border-top: 1px solid var(--rule); background: var(--white); font-size: 12.5px; color: var(--muted); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding-top: 18px; padding-bottom: 22px; }

.page { width: 100%; padding-top: 32px; padding-bottom: 64px; }
.flash { margin: 0 0 22px; padding: 10px 14px; border-left: 3px solid var(--primary); background: var(--white); color: var(--ink); }
.flash.error { border-left-color: #B42318; color: #7A271A; }

/* Forms */
form.inline { display: inline; margin: 0; }
label.field { display: block; font-size: 13px; color: var(--ink); font-weight: 500; margin: 0 0 6px; }
.input, textarea.input, select.input {
  width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; color: var(--ink); background: var(--white);
}
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(47,127,224,.15); }
.help { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.err { font-size: 13px; color: #B42318; margin: 6px 0 0; }
.row { margin-bottom: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.btn { display: inline-block; background: var(--primary); color: var(--white); border: 1px solid var(--primary); border-radius: 6px; padding: 10px 18px;
  font: 600 14.5px Inter, sans-serif; cursor: pointer; text-decoration: none; line-height: 1.4; }
.btn:hover { background: #134f8a; border-color: #134f8a; }
.btn:disabled { background: #b8c7d9; border-color: #b8c7d9; cursor: not-allowed; }
.btn.quiet { background: var(--white); color: var(--ink); border-color: #cbd5e1; }
.btn.quiet:hover { border-color: var(--ink); }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; }
.nav button.link { color: var(--text); text-decoration: none; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
fieldset { border: 0; border-top: 1px solid var(--rule); margin: 28px 0 0; padding: 20px 0 0; }
legend { font: 600 16px Outfit, sans-serif; color: var(--ink); padding: 0 10px 0 0; }

/* Admin: tables and detail pages */
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.filters { display: flex; gap: 16px; font-size: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.filters a { color: var(--muted); text-decoration: none; }
.filters a[aria-current="true"] { color: var(--ink); font-weight: 500; }
table.list { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--rule); font-size: 14px; }
table.list th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list .sub { display: block; font-size: 12.5px; color: var(--muted); word-break: break-word; }
table.list td.nowrap { white-space: nowrap; }
.empty { background: var(--white); border: 1px solid var(--rule); padding: 36px; text-align: center; color: var(--muted); }
.status { font-size: 13px; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: #a0aec0; }
.status.Sent::before, .status.Viewed::before { background: var(--accent); }
.status.Completed, .status.Signed { color: var(--ink); }
.status.Completed::before, .status.Signed::before { background: var(--ink); }
.status.Voided { color: var(--muted); }
.status.Draft, .status.Pending { color: var(--muted); }
.meta { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 28px; margin: 0 0 26px; padding: 18px 20px;
  background: var(--white); border: 1px solid var(--rule); }
.meta dt { font-size: 12.5px; color: var(--muted); }
.meta dd { margin: 2px 0 0; color: var(--ink); word-break: break-all; }
.meta dd.text { word-break: normal; }
.panel { margin: 0 0 30px; }
.note { margin: 0 0 18px; padding: 2px 0 2px 16px; border-left: 2px solid var(--accent); white-space: pre-line; }
details.danger { margin-top: 8px; }
details.danger summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.danger form { margin-top: 12px; max-width: 520px; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }

/* Login */
.login { max-width: 380px; margin: 40px auto; background: var(--white); border: 1px solid var(--rule); padding: 32px; }

/* ── Signing page (see design/signing-page.html) ── */
main.sheet-page { width: 100%; padding-top: 36px; padding-bottom: 120px; }
.kicker { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.facts b { color: var(--ink); font-weight: 500; }
.doc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 34px 0 10px; font-size: 13px; color: var(--muted); }
.pages { min-height: 200px; }
.pdf-page { position: relative; background: var(--white); border: 1px solid var(--rule); margin: 0 auto 6px; }
.pdf-page canvas { display: block; width: 100%; height: auto; }
.pageno { text-align: center; font-size: 12px; color: var(--muted); margin: 0 0 18px; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); font-size: 14px; }
.here { position: absolute; border: 1px dashed var(--light); background: rgba(133,183,235,.10); display: grid; place-items: center;
  font: 500 12px Inter, sans-serif; color: var(--primary); text-align: center; pointer-events: none; }
.sign { background: var(--white); border: 1px solid var(--rule); padding: 30px 32px 28px; margin-top: 30px; scroll-margin-top: 20px; }
.sign .sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.mode { display: flex; gap: 22px; margin-bottom: 6px; font-size: 14px; }
.mode button { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.mode button[aria-pressed="true"] { color: var(--ink); font-weight: 500; border-bottom-color: var(--ink); }
.line { position: relative; height: 170px; border-bottom: 1.5px solid var(--ink); touch-action: none; }
.line canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.line .x { position: absolute; left: 2px; bottom: 6px; font: 400 26px Inter, sans-serif; color: var(--ink); pointer-events: none; }
.line .hint { position: absolute; left: 34px; bottom: 12px; color: #a0aec0; font-size: 14px; pointer-events: none; transition: opacity .15s; }
.line input.typed { position: absolute; left: 34px; right: 0; bottom: 4px; border: 0; background: transparent; outline: none;
  font: 500 46px Caveat, cursive; color: var(--sig); padding: 0; width: calc(100% - 34px); }
.line input.typed::placeholder { color: #c3ccd8; }
.under { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin: 6px 0 24px; }
.under button { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; }
.name { max-width: 420px; }
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 22px 0; cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.consent span { color: var(--ink); }
.btn.sign-btn { padding: 12px 22px; font-size: 15px; }
.fine { font-size: 12.5px; color: var(--muted); margin: 18px 0 0; }
.jump { display: none; }
.state { background: var(--white); border: 1px solid var(--rule); padding: 40px 36px; max-width: 560px; margin: 40px auto; }
.state h1 { font-size: 24px; }
.tick { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--primary); display: grid; place-items: center; color: var(--primary); margin-bottom: 18px; }

@media (max-width: 640px) {
  .page, main.sheet-page { padding-top: 24px; }
  h1 { font-size: 24px; }
  .who span { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .nav { gap: 14px; }
  .product { display: none; }
  table.list { font-size: 13.5px; }
  table.list .hide-sm { display: none; }
  .sign { padding: 22px 18px; margin-left: -20px; margin-right: -20px; border-left: 0; border-right: 0; }
  .line { height: 150px; }
  .btn.sign-btn { width: 100%; padding: 14px; }
  .jump { display: flex; position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--white); border-top: 1px solid var(--rule); align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
  .jump a { background: var(--primary); color: var(--white); text-decoration: none; padding: 9px 14px; border-radius: 6px; font-weight: 600; white-space: nowrap; }
  .state { padding: 28px 22px; margin: 24px 0; }
}
.narrow { max-width: 720px; }
.mt { margin-top: 28px; }
