@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url(fonts/plus-jakarta-sans-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: InkSignature; font-weight: 400; font-display: block; src: url(fonts/signature.woff2) format("woff2"); }

:root {
  /* Blue Orb brand: teal #05252B from the logo, blue for actions, orange for signer fields */
  --ink: #05252B; --muted: #4A5E63; --line: #DCE4E5; --soft: #E8EEEF; --bg: #F3F6F6;
  --accent: #1C5BD9; --accent-dark: #12409E; --pink: #FDE8E7; --err: #B42318; --blue: #B45309; --bluebg: #FDF1E0;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 15px/1.5 Inter, "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { font-family: "Plus Jakarta Sans", Inter, sans-serif; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 30px; line-height: 1.2; }
h2 { font-size: 19px; }
:focus-visible { outline: 3px solid #1C5BD9; outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* shell */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side { flex: 1 1 232px; max-width: 100%; background: #fff; border-right: 1px solid var(--line); padding: 28px 20px; display: flex; flex-direction: column; gap: 32px; }
.brand { display: flex; flex-direction: column; gap: 10px; padding: 18px 16px; border-radius: 12px; background: var(--ink); text-decoration: none; color: #fff; }
.brand img { width: 132px; height: auto; display: block; }
.brand .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand .app { font: 700 22px "Plus Jakarta Sans", Inter, sans-serif; color: #fff; }
.brand .tag { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #A7C4C6; }
.brand:hover { color: #fff; }
.navlinks { display: flex; flex-direction: column; gap: 4px; }
.navlinks a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.navlinks a:hover { background: var(--bg); color: var(--ink); }
.navlinks a[aria-current] { background: var(--ink); color: #fff; }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.who { margin-top: auto; font-size: 13px; color: var(--muted); }
@media (min-width: 721px) { .side { position: sticky; top: 0; height: 100vh; overflow-y: auto; align-self: flex-start; } }
.main { flex: 999 1 560px; min-width: 0; padding: 36px 48px 56px; display: flex; flex-direction: column; gap: 24px; }
@media (max-width: 720px) {
  .side { padding: 16px; gap: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 14px; }
  .brand img { width: 104px; }
  .brand .tag { display: none; }
  .navlinks { flex-direction: row; flex-wrap: wrap; }
  .who { display: none; }
  .main { padding: 20px 16px 40px; }
}

/* pieces */
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head .sub { font-size: 14px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.cols { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.cols > .wide { flex: 3 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.cols > .narrow { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.btn { min-height: 44px; padding: 0 18px; border-radius: 8px; font: 600 15px Inter, sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; border: 1px solid #C9D5D7; background: #fff; color: var(--ink); white-space: nowrap; }
.btn:hover { background: #F5F8F8; color: var(--ink); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn.dark { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn.dark:hover { background: #0B3A42; color: #fff; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { background: var(--line); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.iconbtn { width: 44px; height: 44px; border-radius: 8px; border: 1px solid #C9D5D7; background: #fff; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  min-height: 44px; padding: 0 12px; border: 1px solid #C9D5D7; border-radius: 8px; background: #fff; font: 400 15px Inter, sans-serif; color: var(--ink); width: 100%; }
textarea { padding: 10px 12px; line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 2px rgba(31,95,191,.25); }
.check { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.check input { width: 20px; height: 20px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.flash { padding: 14px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px; }
.flash a { color: #fff; font-weight: 600; }
.flash.err { background: var(--pink); color: var(--err); }
.alert { padding: 12px 14px; border-radius: 8px; background: var(--pink); color: var(--err); font-size: 14px; }
.note { padding: 12px 14px; border-radius: 8px; background: var(--bg); font-size: 14px; }
.chip { font-size: 13px; font-weight: 600; padding: 3px 12px; border-radius: 999px; white-space: nowrap; border: 1.5px solid; display: inline-block; }
.chip.wait { background: #fff; color: var(--ink); border: 1.5px dashed var(--ink); }
.chip.done { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.draft { background: var(--soft); color: var(--ink); border-color: var(--soft); }
.chip.bad { background: var(--pink); color: var(--err); border-color: var(--pink); }

/* documents list */
.drop { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; min-height: 110px; padding: 20px; border: 2px dashed #AEBFC2; border-radius: 12px; background: #fff; cursor: pointer; text-align: left; }
.drop.over { border-color: var(--accent); background: #EEF3FD; }
.drop .circle { width: 44px; height: 44px; border-radius: 22px; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs a { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #C9D5D7; background: #fff; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; font-size: 14px; font-weight: 500; }
.tabs a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.scrollx { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; min-width: 720px; }
table.list th { text-align: left; font-size: 13px; font-weight: 400; color: var(--muted); padding: 0 8px 10px; border-bottom: 1px solid var(--soft); }
table.list td { padding: 14px 8px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.docname { display: flex; align-items: center; gap: 12px; }
.pdfic { flex: none; width: 36px; height: 44px; border-radius: 4px; border: 1px solid #C9D5D7; background: #fff; display: inline-flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; font-size: 10px; font-weight: 600; color: var(--accent-dark); }

/* login */
.split { display: flex; flex-wrap: wrap; min-height: 100vh; }
.split .dark { flex: 1 1 420px; background: var(--ink); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.split .big { font: 600 88px/1 "Plus Jakarta Sans", Inter, sans-serif; letter-spacing: -0.03em; }
.split .lead { font-size: 20px; line-height: 1.5; color: #D7E4E5; max-width: 480px; }
.split .fine { font-size: 14px; color: #A7C4C6; max-width: 440px; }
.split .right { flex: 1 1 480px; padding: 56px 24px; display: flex; align-items: center; justify-content: center; }
.authcard { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 36px; display: flex; flex-direction: column; gap: 18px; }
.authcard img { width: 140px; }
@media (max-width: 720px) { .split .dark { padding: 28px 24px; } .split .big { font-size: 56px; } }

/* signature pad modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal .box { width: 100%; max-width: 440px; background: #fff; border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 14px; max-height: 100%; overflow: auto; }
.modal .top { display: flex; justify-content: space-between; align-items: center; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink); border-radius: 8px; overflow: hidden; }
.seg button { min-height: 44px; border: 0; background: #fff; color: var(--ink); font: 600 15px Inter, sans-serif; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; }
.padwrap { position: relative; border: 1px solid #C9D5D7; border-radius: 8px; background: #F8FAFA; }
.padwrap canvas { display: block; width: 100%; height: 150px; touch-action: none; cursor: crosshair; }
.padwrap .baseline { position: absolute; left: 16px; right: 16px; bottom: 30px; border-bottom: 1px solid #AEBFC2; pointer-events: none; }
.padwrap .hint { position: absolute; right: 10px; bottom: 6px; font-size: 12px; color: var(--muted); pointer-events: none; }
.sigprev { height: 96px; border: 1px solid var(--line); border-radius: 8px; background: #F8FAFA; display: flex; align-items: center; justify-content: center; }
.sigprev img { max-height: 80px; max-width: 90%; }

/* PDF pages (editor, signing, status) */
.pagesbox { background: #E1E8E9; border-radius: 12px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 24px; overflow-x: auto; }
.pdfpage { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); flex: none; }
.pdfpage canvas { display: block; }
.pdfpage .layer { position: absolute; inset: 0; }
.pagelabel { font-size: 12px; color: var(--muted); margin-bottom: -16px; align-self: center; }
.it { position: absolute; box-sizing: border-box; }
.it.text { white-space: pre; line-height: 1.2; font-family: Helvetica, Arial, sans-serif; padding: 0; outline: none; min-width: 8px; }
.it.hl { background: rgba(255, 228, 92, .5); mix-blend-mode: multiply; }
.it.white { background: #fff; }
.it.img img { width: 100%; height: 100%; display: block; object-fit: contain; }
.it.check svg { width: 100%; height: 100%; display: block; }
.it.field { border: 1.5px dashed; border-radius: 3px; display: flex; align-items: center; justify-content: center; gap: 5px; font: 600 12px Inter, sans-serif; overflow: hidden; white-space: nowrap; padding: 0 4px; }
.it.field.mine { border-style: solid; border-width: 2px; cursor: pointer; }
.it.field.mine:hover { filter: brightness(.96); }
.it.field.done { border-color: transparent !important; background: transparent !important; }
.it.field.done img { max-width: 100%; max-height: 100%; }
.editing .it { cursor: move; }
.editing .it.sel { outline: 2px solid var(--ink); outline-offset: 1px; }
.editing .it.text.sel { cursor: text; }
.grip { position: absolute; right: -6px; bottom: -6px; width: 11px; height: 11px; background: var(--ink); border: 1px solid #fff; cursor: nwse-resize; }

/* editor */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; position: sticky; top: 0; z-index: 5; }
.toolbar button { min-height: 44px; padding: 0 14px; border-radius: 8px; border: 0; background: transparent; color: var(--ink); font: 500 14px Inter, sans-serif; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.toolbar button:hover { background: var(--bg); }
.toolbar button[aria-pressed=true] { background: var(--ink); color: #fff; }
.toolbar .hint { margin-left: auto; padding: 0 10px; font-size: 14px; color: var(--muted); }
.edgrid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.edgrid .pagesbox { flex: 1 1 520px; min-width: 0; }
.edgrid aside { flex: 1 1 260px; max-width: 340px; min-width: 240px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 76px; }
.who-btn { min-height: 48px; padding: 0 12px; border-radius: 8px; border: 2px solid var(--line); background: #fff; cursor: pointer; display: flex; align-items: center; gap: 10px; font: 500 14px Inter, sans-serif; color: var(--ink); text-align: left; width: 100%; }
.who-btn .sw { width: 14px; height: 14px; border-radius: 3px; flex: none; }
.who-btn .n { margin-left: auto; font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .edgrid aside { position: static; max-width: none; } }

/* signer page */
.signbar { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--line); padding: 12px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.signbar img { width: 110px; }
.signbar .t { flex: 1 1 260px; display: flex; flex-direction: column; min-width: 0; }
.signbody { padding: 24px 12px 48px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.signbody .pagesbox { background: transparent; padding: 0; width: 100%; }
.banner { width: 100%; max-width: 760px; padding: 18px 22px; border-radius: 12px; background: var(--ink); color: #fff; display: flex; flex-direction: column; gap: 6px; }
.banner.light { background: #fff; color: var(--ink); border: 1px solid var(--line); }

/* activity */
.evt { display: grid; grid-template-columns: 170px minmax(0, 1.6fr) minmax(0, 1.4fr) 130px; gap: 16px; padding: 12px 4px; border-top: 1px solid var(--soft); font-size: 14px; }
.person { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-top: 1px solid var(--soft); flex-wrap: wrap; }
.dot { flex: none; width: 36px; height: 36px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; border: 2px solid #C9D5D7; color: var(--muted); }
.dot.done { background: var(--ink); color: #fff; border-color: var(--ink); }
.dot.wait { border: 2px dashed var(--ink); color: var(--ink); }
.dot.bad { background: var(--pink); color: var(--err); border-color: var(--pink); }

.tplgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.thumbbox { height: 120px; border-radius: 6px; background: var(--bg); display: flex; align-items: center; justify-content: center; }

/* 1.1 editor additions */
.toolbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 6px 4px; }
.toolbar button[disabled] { opacity: .35; cursor: default; background: transparent; }
.toolselect { width: auto; min-height: 36px; padding: 0 8px; font-size: 13px; border-radius: 8px; }
.fieldbtns { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px solid var(--soft); }
.fieldbtns .btn[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.it.draw svg { width: 100%; height: 100%; display: block; overflow: visible; }
.it.note { width: 22px !important; height: 22px !important; cursor: pointer; z-index: 3; }
.it.note svg { width: 22px; height: 22px; display: block; }
.it.note .notetext { display: none; position: absolute; left: 26px; top: 0; width: 220px; padding: 8px 10px; background: #FFF6BF; border: 1px solid #E5CF6A; border-radius: 6px; font: 400 13px/1.4 Inter, sans-serif; color: var(--ink); white-space: pre-wrap; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.it.note:hover .notetext, .it.note.sel .notetext, .it.note.open .notetext { display: block; }
.it.field.f-check { padding: 0; }
.it.field.f-check svg { width: 85%; height: 85%; }
.it.field.f-para { align-items: flex-start; padding-top: 4px; white-space: normal; text-align: left; justify-content: flex-start; }
.pagerow { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--soft); border-radius: 8px; }
.pagerow canvas { border: 1px solid #C9D5D7; flex: none; background: #fff; cursor: pointer; }
.pagerow .pn { font-size: 13px; font-weight: 600; min-width: 18px; }
.pagerow .pbtns { margin-left: auto; display: flex; gap: 2px; }
.pagerow .pbtns button { width: 34px; height: 34px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.pagerow .pbtns button:hover { background: var(--bg); }
.pagerow .pbtns button[disabled] { opacity: .3; cursor: default; }
.busy { position: fixed; inset: 0; background: rgba(255,255,255,.6); display: flex; align-items: center; justify-content: center; z-index: 60; font-weight: 600; }

/* Blue Orb sign-in panel */
.orbtop { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.orbtop img { width: 180px; max-width: 60%; height: auto; display: block; }
.orbtop .tag { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #A7C4C6; }