/* Sam's Free Stuff – public tools. All fonts are bundled; nothing is loaded from other sites. */

@font-face { font-family: "SFS Display"; src: url(../fonts/bricolage-grotesque-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "SFS Display"; src: url(../fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "SFS Display"; src: url(../fonts/bricolage-grotesque-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "SFS Text"; src: url(../fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "SFS Text"; src: url(../fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
/* Same face under its real name so the QR caption export can use it on a canvas. */
@font-face { font-family: "Bricolage Grotesque"; src: url(../fonts/bricolage-grotesque-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

.sfs, body.sfs-canvas {
	--paper: #edf1f7;
	--panel: #ffffff;
	--ink: #1b2440;
	--ink-soft: #4a5472;
	--rule: #c3ccdc;
	--marigold: #f5c044;
	--cobalt: #2d4fe0;
	--danger: #b42318;
	--display: "SFS Display", "Segoe UI", system-ui, sans-serif;
	--text: "SFS Text", "Segoe UI", system-ui, sans-serif;
}

/* ---------- clean layout (plugin template) ---------- */
body.sfs-canvas {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 1.0625rem/1.55 var(--text);
	-webkit-font-smoothing: antialiased;
}
.sfs-skip { position: absolute; left: -9999px; }
.sfs-skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--ink); color: #fff; padding: .5rem .9rem; border-radius: 8px; }
.sfs-bar, .sfs-main, .sfs-foot { max-width: 1160px; margin: 0 auto; padding-left: clamp(1.1rem, 4vw, 2.5rem); padding-right: clamp(1.1rem, 4vw, 2.5rem); box-sizing: border-box; }
.sfs-bar { padding-top: 1.4rem; padding-bottom: 1.4rem; }
.sfs-bar__home { font: 800 1.2rem/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.sfs-bar__home:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.sfs-main { padding-bottom: 4rem; }
.sfs-foot { border-top: 1px solid var(--rule); padding-top: 1.5rem; padding-bottom: 2.5rem; color: var(--ink-soft); font-size: .9rem; }
.sfs-foot p { margin: 0; }

/* ---------- base ---------- */
.sfs { color: var(--ink); font-family: var(--text); font-size: 1.0625rem; line-height: 1.55; }
.sfs *, .sfs *::before, .sfs *::after { box-sizing: border-box; }
.sfs a { color: var(--cobalt); }
.sfs :focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.sfs .sfs-h2 { font: 700 1.5rem/1.2 var(--display); letter-spacing: -.01em; margin: 0 0 1.25rem; color: var(--ink); }

.sfs .sfs-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
	min-height: 44px; padding: .55rem 1.1rem;
	font: 700 .98rem/1 var(--text); color: var(--ink); text-decoration: none;
	background: var(--panel); border: 1.5px solid var(--ink); border-radius: 10px; cursor: pointer;
}
.sfs .sfs-btn:hover { background: var(--paper); }
.sfs .sfs-btn--ink { background: var(--ink); color: #fff; }
.sfs .sfs-btn--ink:hover { background: #2c3963; }
.sfs .sfs-btn--quiet { border-color: transparent; background: transparent; padding-left: .4rem; padding-right: .4rem; text-decoration: underline; text-underline-offset: 3px; }
.sfs .sfs-btn--quiet:hover { background: transparent; color: var(--cobalt); }
.sfs .sfs-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- home ---------- */
.sfs-hero { position: relative; padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.sfs-hero__title {
	font: 800 clamp(2.4rem, 6.2vw, 4.75rem)/1.02 var(--display);
	letter-spacing: -.03em; margin: 0 0 1.4rem; max-width: 15ch; color: var(--ink);
}
.sfs-hero__intro { font-size: 1.2rem; max-width: 46ch; color: var(--ink-soft); margin: 0; }

.sfs-sticker {
	position: absolute; right: 4%; top: clamp(2rem, 6vw, 5rem);
	width: clamp(108px, 15vw, 168px); aspect-ratio: 1; border-radius: 50%;
	background: var(--marigold); display: grid; place-items: center;
	transform: rotate(-11deg);
	box-shadow: 0 1px 0 rgba(27,36,64,.25), 0 10px 22px -12px rgba(27,36,64,.45);
	animation: sfs-slap .55s cubic-bezier(.2,1.4,.4,1) .25s both;
}
.sfs-sticker::after { content: ""; position: absolute; inset: 7%; border-radius: 50%; border: 2px dashed rgba(27,36,64,.35); }
.sfs-sticker span { font: 800 clamp(1.7rem, 3.4vw, 2.6rem)/1 var(--display); letter-spacing: -.02em; color: var(--ink); }
@keyframes sfs-slap { from { transform: rotate(-30deg) scale(1.6); opacity: 0; } to { transform: rotate(-11deg) scale(1); opacity: 1; } }
@media (max-width: 760px) {
	.sfs-hero { padding-top: 7.5rem; }
	.sfs-sticker { top: 1rem; right: auto; left: 0; }
}

.sfs-shelf { margin-bottom: clamp(3rem, 7vw, 5rem); }
.sfs-shelf__list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.sfs-shelf__item { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.6rem 0; border-bottom: 1px solid var(--rule); }
.sfs-shelf__name { font: 700 clamp(1.4rem, 2.6vw, 1.9rem)/1.15 var(--display); letter-spacing: -.015em; margin: 0 0 .35rem; }
.sfs .sfs-shelf__name a { color: var(--ink); text-decoration: none; }
.sfs .sfs-shelf__name a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.sfs-shelf__summary { margin: 0; max-width: 60ch; color: var(--ink-soft); }
.sfs-shelf__item.is-soon .sfs-shelf__name { color: var(--ink-soft); }
.sfs-shelf__item--more { color: var(--ink-soft); font-style: italic; border-bottom: none; }
.sfs-shelf__item--more p { margin: 0; }
.sfs-tag { font-size: .85rem; padding: .3rem .7rem; border-radius: 999px; background: var(--panel); border: 1px dashed var(--rule); white-space: nowrap; }
@media (max-width: 560px) { .sfs-shelf__item { flex-direction: column; align-items: flex-start; } }

.sfs-promise__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin: 0; }
.sfs-promise__list div { border-left: 3px solid var(--marigold); padding-left: 1rem; }
.sfs-promise__list dt { font: 700 1.1rem/1.3 var(--display); margin-bottom: .35rem; }
.sfs-promise__list dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 820px) { .sfs-promise__list { grid-template-columns: 1fr; gap: 1.4rem; } }

/* ---------- QR tool ---------- */
.sfs-toolhead { padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(1.5rem, 3vw, 2.25rem); max-width: 720px; }
.sfs-toolhead__title { font: 800 clamp(2rem, 4.6vw, 3.25rem)/1.05 var(--display); letter-spacing: -.025em; margin: 0 0 .8rem; color: var(--ink); }
.sfs-toolhead__intro { margin: 0; font-size: 1.12rem; color: var(--ink-soft); max-width: 58ch; }

.sfs-qr__layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: start; }
.sfs-qr__preview { position: sticky; top: 1.25rem; }
@media (max-width: 900px) {
	.sfs-qr__layout { grid-template-columns: 1fr; }
	.sfs-qr__preview { display: contents; }
	.sfs-stage { order: -2; }
	.sfs-stage__code { max-width: 220px; }
	.sfs-status { order: -1; margin-top: 0; margin-bottom: 0; }
	.sfs-status:empty { display: none; }
	.sfs-download, .sfs-encoded { order: 1; }
	.sfs-encoded { margin-top: 0; }
}

.sfs .sfs-block { background: var(--panel); border: 1px solid var(--rule); border-radius: 16px; padding: clamp(1rem, 2.5vw, 1.6rem); margin: 0 0 1.25rem; min-width: 0; }
.sfs .sfs-block__title { font: 700 1.25rem/1.2 var(--display); margin: 0 0 1rem; padding: 0; color: var(--ink); float: left; width: 100%; }
.sfs .sfs-block__title + * { clear: both; }

.sfs-types { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.sfs-chip { position: relative; cursor: pointer; }
.sfs-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sfs-chip span { display: inline-block; padding: .5rem .95rem; border-radius: 999px; border: 1.5px solid var(--rule); font-weight: 700; font-size: .95rem; line-height: 1.2; background: var(--panel); }
.sfs-chip:hover span { border-color: var(--ink); }
.sfs-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.sfs-chip input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: 2px; }

.sfs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; align-items: end; }
.sfs-span2 { grid-column: 1 / -1; }
@media (max-width: 520px) { .sfs-grid { grid-template-columns: 1fr; } }

.sfs .sfs-field { display: flex; flex-direction: column; gap: .3rem; margin: 0; font-size: .92rem; font-weight: 700; }
.sfs .sfs-field > span { display: flex; justify-content: space-between; gap: .5rem; }
.sfs .sfs-field output { font-weight: 400; color: var(--ink-soft); }
.sfs .sfs-field input:not([type=range]):not([type=color]):not([type=file]),
.sfs .sfs-field select,
.sfs .sfs-field textarea {
	width: 100%; min-height: 44px; padding: .55rem .75rem; margin: 0;
	font: 400 1rem/1.4 var(--text); color: var(--ink);
	background: #fbfcfe; border: 1.5px solid var(--rule); border-radius: 8px; box-shadow: none;
}
.sfs .sfs-field textarea { resize: vertical; }
.sfs .sfs-field input:hover, .sfs .sfs-field select:hover, .sfs .sfs-field textarea:hover { border-color: var(--ink-soft); }
.sfs .sfs-field input:focus, .sfs .sfs-field select:focus, .sfs .sfs-field textarea:focus { border-color: var(--cobalt); outline: none; box-shadow: 0 0 0 3px rgba(45,79,224,.2); }
.sfs .sfs-field input[type=range] { width: 100%; accent-color: var(--ink); margin: .4rem 0; }
.sfs .sfs-field input[type=file] { font: inherit; font-weight: 400; }
.sfs .sfs-color input[type=color] { width: 100%; height: 44px; padding: 3px; border: 1.5px solid var(--rule); border-radius: 8px; background: #fbfcfe; cursor: pointer; }
.sfs .sfs-check { display: flex; align-items: center; gap: .55rem; min-height: 44px; font-size: .95rem; cursor: pointer; }
.sfs .sfs-check input { width: 1.15rem; height: 1.15rem; accent-color: var(--ink); margin: 0; }
.sfs .sfs-hint { font-size: .9rem; color: var(--ink-soft); margin: 0 0 .9rem; }
.sfs .sfs-panel > .sfs-btn { margin-top: .6rem; }
.sfs .sfs-panel > .sfs-hint:last-child { margin: .4rem 0 0; }
.sfs .sfs-sub { border-left: 3px solid var(--paper); padding-left: .9rem; }
.sfs .sfs-sub .sfs-btn { margin-top: .5rem; }
.sfs [hidden] { display: none !important; }

.sfs-presets { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.sfs .sfs-preset {
	width: 40px; height: 40px; padding: 0; border-radius: 50%; cursor: pointer;
	border: 2px solid var(--panel); box-shadow: 0 0 0 1.5px var(--rule);
	background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%);
}
.sfs .sfs-preset:hover { box-shadow: 0 0 0 2px var(--ink); }

.sfs-group { border-top: 1px solid var(--rule); }
.sfs-group > summary { cursor: pointer; padding: .9rem 0; font: 700 1.05rem/1.2 var(--display); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.sfs-group > summary::-webkit-details-marker { display: none; }
.sfs-group > summary::after { content: "+"; font: 500 1.4rem/1 var(--display); color: var(--ink-soft); }
.sfs-group[open] > summary::after { content: "−"; }
.sfs-group[open] { padding-bottom: 1.1rem; }

/* preview */
.sfs-stage {
	background: #fff; border: 1px solid var(--rule); border-radius: 20px; padding: 1.25rem;
	display: flex; flex-direction: column; align-items: center; transition: opacity .2s;
}
.sfs-stage.is-transparent {
	background-color: #fff;
	background-image: linear-gradient(45deg, #e3e7ef 25%, transparent 25%, transparent 75%, #e3e7ef 75%), linear-gradient(45deg, #e3e7ef 25%, transparent 25%, transparent 75%, #e3e7ef 75%);
	background-size: 18px 18px; background-position: 0 0, 9px 9px;
}
.sfs-stage__code { width: 100%; max-width: 320px; aspect-ratio: 1; }
.sfs-stage__code svg, .sfs-stage__code canvas { width: 100% !important; height: auto !important; display: block; }
.sfs-stage.is-empty .sfs-stage__code { opacity: .12; filter: grayscale(1); }
.sfs-stage__caption { margin: .5rem 0 0; font: 700 1.3rem/1.2 "Bricolage Grotesque", var(--display); text-align: center; max-width: 100%; overflow-wrap: anywhere; }

.sfs-status { min-height: 1.5em; font-size: .9rem; color: var(--ink-soft); margin: .75rem .25rem 1rem; }
.sfs-status span { display: block; }
.sfs-status span + span { margin-top: .3rem; }
.sfs-status.is-error { color: var(--danger); font-weight: 700; }

.sfs-download { background: var(--panel); border: 1px solid var(--rule); border-radius: 16px; padding: 1rem; }
.sfs-download__buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .9rem; }
.sfs-download__buttons .sfs-btn--ink { grid-column: 1 / -1; }
.sfs-download__more { display: flex; justify-content: space-between; margin-top: .5rem; }

.sfs-encoded { margin-top: .9rem; font-size: .9rem; }
.sfs-encoded summary { cursor: pointer; color: var(--ink-soft); padding: .3rem .25rem; }
.sfs-encoded pre { margin: .5rem 0 0; padding: .8rem; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; white-space: pre-wrap; word-break: break-all; font-size: .82rem; max-height: 220px; overflow: auto; }

@media (prefers-reduced-motion: reduce) {
	.sfs-sticker { animation: none; }
	.sfs-stage { transition: none; }
}

/* =================================================================== *
 * PDF toolkit
 * =================================================================== */
@font-face { font-family: "SFS Sign A"; src: url(../fonts/caveat-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "SFS Sign B"; src: url(../fonts/dancing-script-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }

.sfs .sfs-btn--sm { min-height: 36px; padding: .35rem .75rem; font-size: .9rem; border-radius: 8px; }
.sfs .sfs-btn--danger { color: var(--danger); border-color: currentColor; }
.sfs .sfs-btn--danger:hover { background: #fdf0ef; }
.sfs .sfs-btn--block { width: 100%; margin-top: 1rem; }

.sfs-drop {
	border: 2px dashed var(--rule); border-radius: 22px; background: var(--panel);
	min-height: 340px; display: grid; place-items: center; padding: 2rem 1.25rem; text-align: center;
	transition: border-color .15s, background-color .15s;
}
.sfs-pdf.is-dropping .sfs-drop, .sfs-pdf.is-dropping .sfs-pages { border-color: var(--cobalt); background-color: #eef2ff; }
.sfs-drop__icon { width: 64px; height: 64px; color: var(--ink); margin-bottom: .75rem; }
.sfs-drop__title { font: 700 clamp(1.4rem, 3vw, 1.9rem)/1.15 var(--display); letter-spacing: -.015em; margin: 0 0 .4rem; }
.sfs-drop__sub { margin: 0 auto 1.4rem; color: var(--ink-soft); max-width: 44ch; }

.sfs-pdf__work { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(1.25rem, 3vw, 2.25rem); align-items: start; }
.sfs-pdf__side { position: sticky; top: 1rem; }
@media (max-width: 900px) {
	.sfs-pdf__work { grid-template-columns: 1fr; }
	.sfs-pdf__side { position: static; }
}

.sfs-toolbar {
	position: sticky; top: 0; z-index: 5; background: var(--paper);
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem;
	padding: .7rem 0; border-bottom: 1px solid var(--rule);
}
.sfs-toolbar__group { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.sfs-selcount { font-size: .92rem; color: var(--ink-soft); margin-right: .25rem; }
.sfs .sfs-pdf__hint { margin: .8rem 0 1.25rem; }

.sfs-pages { list-style: none; margin: 0; padding: .25rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 1.6rem 1.25rem; border: 2px solid transparent; border-radius: 16px; }
.sfs-page { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.sfs-page__slot { height: 200px; display: flex; align-items: flex-end; justify-content: center; }
.sfs .sfs-page__frame {
	position: relative; display: block; height: 100%; width: auto; max-width: 100%; padding: 0; margin: 0; border: 0; border-radius: 4px;
	background: #fff; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none;
	box-shadow: 0 0 0 1px var(--rule), 0 2px 6px -2px rgba(27,36,64,.25);

}
.sfs .sfs-page__frame.is-wide { width: 100%; height: auto; }
.sfs-page__frame canvas { display: block; width: 100%; height: 100%; border-radius: 4px; }
.sfs .sfs-page__frame:hover { box-shadow: 0 0 0 2px var(--ink-soft), 0 2px 6px -2px rgba(27,36,64,.25); }
.sfs-page.is-selected .sfs-page__frame { box-shadow: 0 0 0 3px var(--cobalt), 0 2px 6px -2px rgba(27,36,64,.25); }
.sfs-page__check {
	position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%;
	background: rgba(255,255,255,.9); border: 2px solid var(--ink-soft); opacity: 0; transition: opacity .1s;
}
.sfs-page__frame:hover .sfs-page__check, .sfs-page__frame:focus-visible .sfs-page__check { opacity: 1; }
.sfs-page.is-selected .sfs-page__check { opacity: 1; background: var(--cobalt); border-color: var(--cobalt); }
.sfs-page.is-selected .sfs-page__check::after { content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.sfs-page.is-dragging { opacity: .3; }
.sfs-pdf.is-sorting .sfs-page__actions { visibility: hidden; }

.sfs-page__meta { display: flex; align-items: baseline; gap: .5rem; font-size: .82rem; min-width: 0; }
.sfs-page__num { font: 700 1rem/1 var(--display); }
.sfs-page__src { display: flex; align-items: center; gap: .35rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sfs-page__src::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.sfs-page__actions { display: flex; gap: .2rem; margin-top: -.15rem; }
.sfs .sfs-icon {
	display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 8px;
	border: 1px solid transparent; background: transparent; color: var(--ink-soft); cursor: pointer;
}
.sfs .sfs-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sfs .sfs-icon:hover { background: var(--panel); border-color: var(--rule); color: var(--ink); }
.sfs .sfs-icon--danger:hover { color: var(--danger); }

.sfs-ghost {
	position: fixed; left: 0; top: 0; z-index: 99999; pointer-events: none; padding: 0; border: 0;
	background: #fff; border-radius: 4px; box-shadow: 0 18px 40px -12px rgba(27,36,64,.55), 0 0 0 2px var(--cobalt);
}
.sfs-ghost canvas { display: block; width: 100%; height: auto; }
.sfs-ghost .sfs-page__check { display: none; }

/* signatures and text on pages */
.sfs-layer { position: absolute; inset: 0; container-type: size; pointer-events: none; }
.sfs-item { position: absolute; line-height: 1.25; white-space: pre; font-family: "SFS Text", "Segoe UI", system-ui, sans-serif; }
.sfs-item img { display: block; width: 100%; height: auto; }

.sfs-savebox { background: var(--panel); border: 1px solid var(--rule); border-radius: 16px; padding: 1.2rem; }
.sfs .sfs-savebox .sfs-block__title { margin-bottom: .25rem; }
.sfs-savebox__summary { margin: 0 0 1rem; color: var(--ink-soft); font-size: .92rem; clear: both; }
.sfs-savebox > .sfs-field { margin-bottom: 1rem; }
.sfs .sfs-radios { border: 0; padding: 0; margin: 0 0 .5rem; }
.sfs .sfs-radios legend { font-weight: 700; font-size: .92rem; padding: 0; margin-bottom: .1rem; }
.sfs .sfs-radios .sfs-check { min-height: 38px; }
.sfs-savebox .sfs-sub { margin-bottom: .75rem; display: flex; flex-direction: column; gap: .7rem; }
.sfs-savebox .sfs-sub .sfs-hint { margin: 0; }
.sfs-savebox .sfs-group { margin-top: .25rem; }
.sfs-savebox .sfs-group[open] { display: flex; flex-direction: column; gap: .6rem; }
.sfs-savebox .sfs-status { margin: .75rem 0 .5rem; }
.sfs-savebox > .sfs-hint { margin-bottom: .5rem; }

/* editor dialog */
.sfs-editor, .sfs-sigdlg { border: 0; border-radius: 18px; padding: 0; color: var(--ink); background: var(--panel); box-shadow: 0 30px 80px -20px rgba(27,36,64,.6); }
.sfs-editor::backdrop, .sfs-sigdlg::backdrop { background: rgba(27,36,64,.55); }
.sfs-editor { width: min(1120px, 96vw); height: min(94vh, 1200px); max-width: none; max-height: none; }
.sfs-editor[open] { display: flex; flex-direction: column; }
.sfs-editor__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--rule); }
.sfs-editor__title { font: 700 1.1rem/1 var(--display); margin: 0; min-width: 7.5rem; }
.sfs-editor__tools, .sfs-editor__nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.sfs-editor__props { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.1rem; padding: .6rem 1rem; background: #f6f8fc; border-bottom: 1px solid var(--rule); }
.sfs-editor__props { min-height: 57px; }
.sfs-editor__empty { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.sfs .sfs-field--inline { flex-direction: row; align-items: center; gap: .5rem; }
.sfs .sfs-field--inline textarea { min-height: 36px; width: min(320px, 60vw); padding: .35rem .6rem; }
.sfs .sfs-field--inline input[type=range] { width: 140px; }
.sfs .sfs-field--inline.sfs-color input[type=color] { width: 52px; height: 36px; }
.sfs-editor__stage { flex: 1; min-height: 0; overflow: auto; background: var(--paper); display: grid; place-items: center; padding: 12px; }
.sfs-editor__page { position: relative; background: #fff; box-shadow: 0 0 0 1px var(--rule), 0 8px 24px -10px rgba(27,36,64,.4); }
.sfs-editor__page canvas { display: block; width: 100%; height: 100%; }
.sfs-editor__page .sfs-layer { pointer-events: auto; }
.sfs-editor__page .sfs-item { cursor: move; touch-action: none; outline: 1px dashed transparent; outline-offset: 2px; }
.sfs-editor__page .sfs-item:hover { outline-color: var(--ink-soft); }
.sfs-editor__page .sfs-item.is-selected, .sfs-editor__page .sfs-item:focus-visible { outline: 2px dashed var(--cobalt); }
.sfs-item__grip { display: none; position: absolute; right: -9px; bottom: -9px; width: 16px; height: 16px; border-radius: 4px; background: var(--cobalt); border: 2px solid #fff; cursor: nwse-resize; touch-action: none; }
.sfs-item.is-selected .sfs-item__grip { display: block; }
.sfs-editor__hint { margin: 0; padding: .55rem 1rem; font-size: .85rem; color: var(--ink-soft); border-top: 1px solid var(--rule); }

/* signature dialog */
.sfs-sigdlg { width: min(600px, 94vw); padding: 1.4rem; }
.sfs-sigdlg .sfs-types { margin-bottom: 1rem; }
.sfs-pad { display: block; width: 100%; aspect-ratio: 3 / 1; height: auto; background: #fff; border: 1.5px solid var(--rule); border-radius: 12px; touch-action: none; cursor: crosshair; }
.sfs-pad__row { display: flex; justify-content: space-between; align-items: center; margin: .6rem 0 .25rem; }
.sfs-inks { display: flex; gap: .5rem; }
.sfs .sfs-ink { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; background: var(--c); box-shadow: 0 0 0 1.5px var(--rule); cursor: pointer; padding: 0; }
.sfs .sfs-ink.is-on { box-shadow: 0 0 0 2.5px var(--ink); }
.sfs-sigfonts { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .9rem; }
.sfs-sigfont { position: relative; cursor: pointer; }
.sfs-sigfont input { position: absolute; opacity: 0; }
.sfs-sigfont span { display: block; padding: .6rem .8rem; border: 1.5px solid var(--rule); border-radius: 10px; font-size: 2.1rem; line-height: 1.3; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #fff; }
.sfs-sigfont input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.sfs-sigfont input:focus-visible + span { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.sfs-saved { margin-bottom: 1rem; clear: both; }
.sfs-saved .sfs-hint { margin-bottom: .4rem; }
.sfs-saved__list { display: flex; flex-wrap: wrap; gap: .5rem; }
.sfs .sfs-saved__item { height: 56px; padding: .3rem .6rem; background: #fff; border: 1.5px solid var(--rule); border-radius: 10px; cursor: pointer; }
.sfs .sfs-saved__item:hover { border-color: var(--ink); }
.sfs-saved__item img { height: 100%; width: auto; display: block; }
.sfs-sigdlg > .sfs-hint { margin: .9rem 0 0; }
.sfs-dlg__actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.1rem; }
.sfs-sigdlg .sfs-block__title { float: none; }

@media (prefers-reduced-motion: reduce) {
	.sfs-drop, .sfs-page__check { transition: none; }
}
