/* DataLink Sign, client side. Pages of the document with the places to sign laid over them; one signature panel that stays within reach. Tokens only. */
.sg-wrap { padding-bottom: 14rem; } @media (min-width: 900px) { .sg-wrap { padding-bottom: 19rem; } }
.how { padding-left: 1.3rem; } .how li { margin: .45rem 0; } .sg-who { display: inline-block; margin-right: 1em; }
.sg-pages { display: grid; gap: 2.6rem; margin: 18px 0; }
@media (max-width: 640px) { .sg-f.auto .sg-tab { display: none; } }
.sg-page { position: relative; margin: 0; background: var(--v3-surface-1); border: var(--v3-hair-2); border-radius: var(--v3-r-1); box-shadow: var(--v3-shadow-1); container-type: inline-size; }
.sg-page img { display: block; width: 100%; height: 100%; border-radius: var(--v3-r-1); }
.sg-pn { position: absolute; left: 0; right: 0; bottom: -1.9rem; text-align: center; font-size: max(var(--min), .75rem); color: var(--v3-muted); }
/* every field is placed in fractions of the page, so it stays on the right words at any width */
.sg-f { position: absolute; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0; border: 2px solid var(--v3-accent-line); border-radius: var(--v3-r-1); background: var(--v3-accent-soft); color: var(--v3-ink); line-height: 1; font-family: var(--v3-font-sans); }
.sg-f.auto { background: var(--v3-surface-2); border-color: var(--v3-hair-color-2); color: var(--v3-muted); } .sg-f.auto .sg-v { padding: 0 .4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sg-tab { position: absolute; left: -2px; bottom: 100%; margin-bottom: 3px; padding: 2px 8px; border-radius: var(--v3-r-1) var(--v3-r-1) var(--v3-r-1) 0; background: var(--v3-accent); color: var(--v3-surface-1); font-size: max(var(--min), .62rem); font-weight: 600; letter-spacing: .02em; white-space: nowrap; line-height: 1.5; }
html[data-contrast="1"] .sg-tab { color: var(--v3-surface-0); } .sg-f.auto .sg-tab { background: var(--v3-ink-2); color: var(--v3-surface-1); bottom: auto; top: 100%; margin: 3px 0 0; border-radius: 0 var(--v3-r-1) var(--v3-r-1) var(--v3-r-1); }
.sg-f.sig { cursor: pointer; } .sg-f.sig.need { animation: pulse 1.8s var(--v3-ease) infinite; } @keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--v3-accent-line); } 50% { box-shadow: 0 0 0 6px transparent; } }
.sg-f.sig .sg-prev { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 2px 4px; } .sg-f.sig .sg-prev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sg-f.sig .sg-prev.typed { font: italic 400 1em "Instrument Serif", Georgia, "Times New Roman", serif; color: var(--v3-ink); white-space: nowrap; overflow: hidden; }
.sg-f.sig:not(.need) { background: var(--v3-surface-1); border-style: solid; border-color: var(--v3-ok); } .sg-f.sig:not(.need) .sg-tab { background: var(--v3-ok-ink); }
.sg-f.txtw { background: var(--v3-surface-1); } .sg-f.txtw .sg-txt { width: 100%; height: 100%; min-height: 0; border: 0; border-radius: 0; background: transparent; padding: 0 .4em; font-size: inherit; font-family: var(--v3-font-sans); } .sg-f.txtw .sg-txt:focus { box-shadow: none; }
.sg-f.chk { background: var(--v3-surface-1); } .sg-f.chk input { width: 70%; height: 70%; min-width: 24px; min-height: 24px; }
.sg-f.need:not(.sig) { border-color: var(--v3-watch); } .sg-f.need:not(.sig) .sg-tab { background: var(--v3-watch-ink); }
.sg-f.flash { animation: flash .9s var(--v3-ease) 2; } @keyframes flash { 50% { box-shadow: 0 0 0 8px var(--v3-accent-line); } }

/* the signature panel: a sheet at the bottom. On a phone it is a slim bar that opens full screen; on a desktop it is always open. */
.sg-panel { position: fixed; left: 0; right: 0; bottom: calc(var(--dock-h) + env(safe-area-inset-bottom)); z-index: var(--z-drawer); background: var(--v3-surface-1); border-top: var(--v3-hair-2); box-shadow: var(--v3-shadow-3); display: flex; flex-direction: column; }
.sg-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; max-width: 1040px; width: 100%; margin: 0 auto; }
.sg-prog { font-size: max(var(--min), .85rem); font-weight: 600; color: var(--v3-ink-2); white-space: nowrap; } .sg-prog .num { color: var(--v3-ink); font-size: 1.1em; } .sg-barbtns { display: flex; gap: 8px; }
.sg-body { display: none; padding: 4px 16px 16px; max-width: 1040px; width: 100%; margin: 0 auto; }
.sg-panel.open { top: 0; bottom: 0; overflow-y: auto; } .sg-panel.open .sg-body { display: block; } .sg-panel.open .sg-openbtn { display: none; } .sg-panel:not(.open) .sg-closebtn { display: none; }
@media (min-width: 900px) { .sg-panel { bottom: 0; } .sg-body { display: block; } .sg-openbtn, .sg-closebtn { display: none !important; } .sg-bar { padding-bottom: 4px; } .sg-body { display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: 10px 24px; align-items: end; } .sg-tabs { grid-column: 1; } .sg-draw, .sg-type { grid-column: 1; } .sg-finish { grid-column: 2; grid-row: 1 / span 2; align-self: end; } }
.sg-tabs { display: flex; gap: 6px; margin: 6px 0 10px; } .sg-tabs [role=tab] { min-height: 48px; padding: 0 14px; border-radius: var(--v3-r-2); border: var(--v3-hair); background: var(--v3-surface-1); font-size: max(var(--min), .8rem); font-weight: 600; color: var(--v3-ink-2); }
.sg-tabs [role=tab].on { background: var(--v3-accent-soft); color: var(--v3-accent-ink); border-color: var(--v3-accent-line); }
.sg-draw { position: relative; height: 9rem; max-height: calc(var(--app-h) * .26); border: 2px dashed var(--v3-accent-line); border-radius: var(--v3-r-3); background: var(--v3-surface-2); touch-action: none; }
.sg-panel.open .sg-draw { height: 15rem; max-height: calc(var(--app-h) * .45); }
.sg-draw canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; border-radius: var(--v3-r-3); }
.sg-hint { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); text-align: center; color: var(--v3-muted); font-size: max(var(--min), .9rem); pointer-events: none; }
.sg-line { position: absolute; left: 1.5rem; right: 1.5rem; bottom: 2.4rem; height: 1px; background: var(--v3-hair-color-2); pointer-events: none; }
.sg-clear { position: absolute; right: 6px; bottom: 6px; min-height: 44px; }
.sg-type input { max-width: 30rem; } .sg-typed { margin-top: 10px; min-height: 3.2rem; padding: .3rem .6rem; font: italic 400 2.2rem/1.3 "Instrument Serif", Georgia, "Times New Roman", serif; color: var(--v3-ink); border-bottom: 1px solid var(--v3-hair-color-2); max-width: 30rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-finish { margin-top: 12px; max-width: none; }
@media print { .sg-panel { display: none !important; } }

/* QA-PHONE: the "Sign here" tab is a thumb target even though the box sits on one line of the page; the Clear button and links reach 48px */
.sg-f.sig::before { content: ""; position: absolute; inset: -14px; }
.sg-f.sig .sg-tab { min-height: 28px; display: inline-flex; align-items: center; }
.sg-clear { min-height: 48px; min-width: 48px; }
.sg-wrap .card.quiet a, .sg-wrap .card.intro a { display: inline-block; padding: 12px 0; }
.sg-typed[aria-hidden] { pointer-events: none; }
@media (max-width: 640px) { .sg-bar { padding: 8px 12px; gap: 8px; } .sg-barbtns { flex: none; } .sg-barbtns .btn { white-space: nowrap; padding: 0 14px; min-height: 48px; } .sg-barbtns .btn .ico { display: none; } .sg-prog { font-size: max(15px, .8rem); white-space: normal; line-height: 1.2; } .sg-prog .num { font-size: 1em; } .sg-tabs { flex-direction: column; } .sg-tabs [role=tab] { width: 100%; } }
