.fs { padding: 22px 0 10px; }
.fs [hidden] { display: none !important; }
.fs-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fs input[type=text]:not(.fs-fld), .fs select:not(.fs-fld), .fs textarea:not(.fs-ta):not(.fs-fld) { width: 100%; font: inherit; font-size: 15px; border: 1px solid #ddd6cb; border-radius: 10px; padding: 8px 10px; background: var(--card); color: var(--text); min-height: 42px; box-sizing: border-box; }
.fs textarea:not(.fs-ta):not(.fs-fld) { min-height: 60px; resize: vertical; }
.fs input:not(.fs-fld):focus, .fs select:not(.fs-fld):focus, .fs textarea:not(.fs-fld):not(.fs-ta):focus { outline: 3px solid rgba(245, 158, 11, .35); border-color: var(--gold); }
.fs input[type=checkbox], .fs input[type=radio] { width: 18px; height: 18px; accent-color: #d97706; margin: 0; flex: none; }
.fs-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fs-msg { min-height: 22px; font-size: 14px; font-weight: 700; color: #15803d; margin: 8px 0 4px; }
.fs-msg.fs-err { color: #b42318; }
.fs-msg.fs-warn { color: #b45309; }
.fs-msg.fs-stay { color: var(--muted); }
.fs-link { font: inherit; font-size: 13px; border: 0; background: none; color: var(--gold-text); font-weight: 700; cursor: pointer; padding: 0; text-decoration: underline; }

/* ---------- start ---------- */
.fs-start { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.fs-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; border: 2px dashed #cfc6b8; border-radius: 16px; background: var(--soft); padding: 44px 16px; cursor: pointer; transition: border-color .15s, background .15s; min-height: 250px; }
.fs-drop:hover, .fs-drop.fs-over, .fs-drop:focus-within { border-color: var(--gold); background: var(--gold-soft); }
.fs-drop b { font-size: 21px; }
.fs-drop span { color: var(--muted); font-size: 15px; }
.fs-drop u { color: var(--gold-text); font-weight: 700; }
.fs-ico { width: 48px; height: 48px; color: var(--gold-text); }
.fs-trust { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--muted); }
.fs-trust span:first-child { color: #15803d; }
.fs-try { text-align: center; margin: 12px 0 0; color: var(--muted); font-size: 14.5px; }
.fs-card { border: 1px solid var(--line); border-radius: 16px; background: var(--card); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.fs-card h2 { font-size: 17px; margin: 0; }
.fs-card p { margin: 0; color: var(--muted); font-size: 14px; }
.fs-prevs { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.fs-prev { border: 1px solid var(--line); border-radius: 12px; height: 92px; display: flex; align-items: center; justify-content: center; background: #fff; padding: 8px; }
.fs-prev img { max-width: 100%; max-height: 100%; }
.fs-prev span { color: #9a948a; font-size: 13px; }
.fs-prevs small { display: block; text-align: center; color: var(--muted); font-size: 12px; margin-top: 4px; }
.fs-date { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); font-weight: 700; }
.fs-date select { width: auto; min-height: 36px; padding: 4px 8px; font-size: 14px; }

/* ---------- work ---------- */
.fs-steps { display: flex; border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; margin-bottom: 12px; }
.fs-steps > div { flex: 1; display: flex; align-items: center; gap: 8px; padding: 11px 14px; font-weight: 800; color: var(--muted); font-size: 14px; border-bottom: 3px solid transparent; min-width: 0; }
.fs-steps i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.fs-steps .on { color: var(--text); border-bottom-color: var(--gold); }
.fs-steps .on i { background: var(--gold); border-color: var(--gold); color: #1f1d1a; }
.fs-steps .done i { background: #15803d; border-color: #15803d; color: #fff; font-size: 0; }
.fs-steps .done i::after { content: "✓"; font-size: 13px; }
.fs-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.fs-viewwrap { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); min-width: 0; }
.fs-vbar { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.fs-vbar b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.fs-vbar small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.fs-vbar .fs-sp { flex: 1; }
.fs-ib { border: 1px solid var(--line); background: var(--soft); color: var(--text); border-radius: 8px; min-width: 34px; height: 32px; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; padding: 0 8px; }
.fs-ib:disabled { opacity: .4; cursor: default; }
.fs-zoom { font-size: 12.5px; font-weight: 800; color: var(--muted); min-width: 42px; text-align: center; }
.fs-view { position: relative; height: calc(100vh - 170px); min-height: 460px; max-height: 1100px; overflow: auto; background: #e7e3dc; padding: 18px 0 30px; overscroll-behavior: contain; }
:root[data-theme="dark"] .fs-view { background: #2a2723; }
.fs-page { position: relative; margin: 0 auto 18px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.fs-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.fs-layer { position: absolute; inset: 0; }
.fs-placing .fs-layer, .fs-placing .fs-item { cursor: crosshair; }

/* placed things */
.fs-item { position: absolute; cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; box-sizing: border-box; }
.fs-item img, .fs-item svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.fs-item:hover { outline: 1px dashed rgba(37, 99, 235, .55); outline-offset: 2px; }
.fs-item.fs-sel { outline: 1.5px dashed #2563eb; outline-offset: 2px; }
.fs-t { white-space: pre; pointer-events: none; }
.fs-k-rect { background: #fff; box-shadow: inset 0 0 0 1px #d9d4cb; }
.fs-k-rect.fs-sel, .fs-k-rect:hover { box-shadow: none; }
.fs-h { position: absolute; right: -8px; bottom: -8px; width: 13px; height: 13px; background: #2563eb; border: 2px solid #fff; border-radius: 3px; cursor: nwse-resize; touch-action: none; }
.fs-editing { cursor: text; outline: 1.5px solid #2563eb !important; outline-offset: 1px !important; }
.fs-ta { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; margin: 0; padding: 0; resize: none; overflow: hidden; white-space: pre; background: rgba(255, 255, 255, .85); box-sizing: border-box; outline: 0 !important; }
.fs-bar { position: absolute; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; background: #1f1d1a; border-radius: 9px; padding: 3px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); white-space: nowrap; max-width: calc(100% - 4px); box-sizing: border-box; }
.fs-bar button { border: 0; background: none; color: #fff; font: inherit; font-size: 12.5px; font-weight: 700; min-width: 28px; height: 28px; border-radius: 6px; cursor: pointer; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
.fs-bar button:hover { background: #3a3732; }
.fs-bar button.on { background: #4a463f; }
.fs-bar .fs-c i { width: 14px; height: 14px; border-radius: 50%; display: block; border: 2px solid #1f1d1a; box-shadow: 0 0 0 1px #777; }
.fs-bar .fs-c.on i { box-shadow: 0 0 0 2px var(--gold); }
.fs-bar .fs-del:hover { background: #7f1d1d; }

/* fillable fields on the page */
.fs-fld { position: absolute; box-sizing: border-box; margin: 0; padding: 0 3px; background: rgba(37, 99, 235, .09); border: 1px solid rgba(37, 99, 235, .45); border-radius: 2px; color: #111; font-family: Helvetica, Arial, sans-serif; line-height: 1.15; min-height: 0; }
.fs-fld:hover { background: rgba(37, 99, 235, .15); }
.fs-fld:focus, .fs-fld.fs-hl { outline: 2px solid var(--gold); outline-offset: 0; background: rgba(245, 158, 11, .1); }
textarea.fs-fld { resize: none; padding: 2px 3px; overflow: auto; }
select.fs-fld { padding: 0 1px; cursor: pointer; }
.fs-fld:disabled { opacity: .6; cursor: not-allowed; }
button.fs-fld { cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.fs-fchk.on::after { content: ""; width: 62%; height: 32%; border-left: 2px solid #111; border-bottom: 2px solid #111; transform: translateY(-15%) rotate(-48deg); }
.fs-frad { border-radius: 50%; }
.fs-frad.on::after { content: ""; width: 48%; height: 48%; border-radius: 50%; background: #111; }
.fs-fsig { font-weight: 800; color: #1d4ed8; border-style: dashed; font-size: 11px !important; }

/* ---------- side panel ---------- */
.fs-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.fs-box { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 14px; }
.fs-box h2 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.fs-box h2 span { margin-left: auto; text-transform: none; letter-spacing: 0; }
.fs-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fs-tool { display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1px solid var(--line); background: var(--soft); color: var(--text); border-radius: 10px; padding: 8px 4px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; min-height: 58px; justify-content: center; }
.fs-tool i { font-style: normal; font-size: 18px; line-height: 1; }
.fs-tool:hover { border-color: #cfc6b8; }
.fs-tool.on { background: var(--gold-soft); border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 158, 11, .25); }
.fs-hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.fs-hint.on { color: var(--gold-text); font-weight: 800; }
.fs-found { background: #ecfdf3; border: 1px solid #bbf7d0; color: #15803d; border-radius: 10px; padding: 8px 10px; font-weight: 700; font-size: 13px; margin-bottom: 10px; }
:root[data-theme="dark"] .fs-found { background: #12261a; border-color: #1f4d2e; color: #4ade80; }
.fs-fields { max-height: 360px; overflow: auto; padding-right: 2px; }
.fs-fl { margin-bottom: 10px; }
.fs-fl label, .fs-fl .fs-lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.fs-fl label small { font-weight: 600; }
.fs-fl label.fs-chk, .fs-rads label.fs-chk { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; margin: 0; }
.fs-rads { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.fs-fl input[type=text], .fs-fl select { min-height: 38px; font-size: 14.5px; padding: 6px 9px; }
.fs-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; }
.fs-list li { display: flex; align-items: stretch; gap: 4px; margin-bottom: 5px; }
.fs-list li > button:first-child { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--soft); color: var(--text); border-radius: 8px; padding: 6px 9px; font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.fs-list .fs-lt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-list img { height: 20px; max-width: 110px; flex: 1 1 auto; object-fit: contain; object-position: left; min-width: 0; }
.fs-list small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.fs-list .fs-none { color: var(--muted); font-size: 13px; }
.fs-x { border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 8px; width: 30px; font-size: 16px; cursor: pointer; flex: none; }
.fs-x:hover { color: #b42318; border-color: #f2b8b5; }
.fs-flat { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text); margin: 0 0 10px; cursor: pointer; line-height: 1.4; }
.fs-flat small { color: var(--muted); display: block; }
.fs-dl { width: 100%; justify-content: center; margin: 0 !important; }
.fs-acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.fs-acts .btn { flex: 1; justify-content: center; white-space: nowrap; }
.fs-acts #bNew { flex-basis: 100%; }
.fs-note { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.fs-sheethead { display: none; }

/* ---------- phone dock ---------- */
.fs-dock { display: none; }
.fs-back { position: fixed; inset: 0; background: rgba(31, 29, 26, .45); z-index: 69; }

/* ---------- windows ---------- */
.fs-modal { position: fixed; inset: 0; background: rgba(31, 29, 26, .55); display: flex; align-items: center; justify-content: center; padding: 14px; z-index: 80; }
.fs-mbox { background: var(--card); color: var(--text); border-radius: 16px; padding: 18px; width: 100%; max-width: 640px; max-height: calc(100vh - 28px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.fs-mhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fs-mhead b { font-size: 18px; }
.fs-mhead .fs-x { height: 32px; }
.fs-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.fs-tabs button { flex: 1; border: 1px solid var(--line); background: var(--soft); color: var(--text); border-radius: 999px; padding: 8px 10px; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.fs-tabs button.on { background: #1f1d1a; border-color: #1f1d1a; color: #fff; }
#fsPad { display: block; width: 100%; aspect-ratio: 3 / 1; border: 2px dashed #d8d1c4; border-radius: 12px; background: #fff linear-gradient(transparent calc(78% - 1px), #e3ded5 calc(78% - 1px), #e3ded5 78%, transparent 78%); touch-action: none; cursor: crosshair; }
.fs-padrow { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 700; }
.fs-padrow input[type=range] { width: 110px; accent-color: #d97706; }
.fs-padrow .fs-sp { flex: 1; }
.fs-inkrow { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.fs-inkrow button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #c9c2b6; cursor: pointer; padding: 0; }
.fs-inkrow button.on { box-shadow: 0 0 0 2px var(--gold); }
.fs-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.fs-font { border: 1px solid var(--line); background: #fff; border-radius: 12px; height: 70px; font-size: 32px; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 0 10px; }
.fs-font.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(245, 158, 11, .35); }
.fs-up { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px dashed #cfc6b8; border-radius: 12px; padding: 22px 12px; text-align: center; cursor: pointer; background: var(--soft); }
.fs-up b { font-size: 16px; }
.fs-up span { font-size: 13px; color: var(--muted); }
#fsUpPrev { display: block; max-width: 100%; max-height: 160px; margin: 10px auto 0; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: 8px; }
.fs-remember { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.fs-remember small { color: var(--muted); font-weight: 500; }
.fs-err { min-height: 20px; color: #b42318; font-size: 13.5px; font-weight: 700; margin: 4px 0; }
.fs-pwbox { max-width: 420px; }
.fs-pwbox p { color: var(--muted); font-size: 14px; margin: 6px 0 10px; }
.fs-pwbox input { width: 100%; font: inherit; font-size: 15px; border: 1px solid #ddd6cb; border-radius: 10px; padding: 8px 10px; min-height: 42px; box-sizing: border-box; background: var(--card); color: var(--text); }
body.fs-noscroll { overflow: hidden; }

@media (max-width: 1080px) { .fs-grid { grid-template-columns: minmax(0, 1fr) 290px; } }
@media (max-width: 860px) {
  .fs-start { grid-template-columns: minmax(0, 1fr); }
  .fs-grid { grid-template-columns: minmax(0, 1fr); }
  .fs-view { height: calc(100vh - 190px); min-height: 380px; padding: 10px 0 24px; }
  .fs-vbar b { max-width: 150px; }
  .fs-steps > div { padding: 9px 8px; font-size: 12.5px; gap: 6px; }
  .fs-side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 70; max-height: 84vh; background: var(--bg); border-radius: 18px 18px 0 0; padding: 0 12px 16px; box-shadow: 0 -10px 30px rgba(0, 0, 0, .25); transform: translateY(105%); transition: transform .22s ease; gap: 10px; }
  .fs-side.fs-open { transform: none; }
  .fs-sheethead { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; background: var(--bg); padding: 10px 2px 6px; z-index: 2; }
  .fs-sheethead b { font-size: 16px; }
  .fs-dock { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); }
  .fs-dock .fs-tool { border: 0; background: none; min-height: 50px; padding: 4px 2px; flex: 1; font-size: 11px; }
  .fs-dock .fs-tool.on { background: var(--gold-soft); }
  .fs-dock .fs-ready { color: #15803d; }
  body.fs-working { padding-bottom: 70px; }
  .fs-h { width: 20px; height: 20px; right: -11px; bottom: -11px; }
}
@media (max-width: 560px) {
  .fs-prevs { grid-template-columns: 1fr 1fr; }
  .fs-fonts { grid-template-columns: 1fr; }
  .fs-steps > div span { display: none; }
  .fs-steps > div.on span { display: inline; }
  .fs-vbar .fs-hide { display: none; }
}
@media (pointer: coarse) { .fs-h { width: 20px; height: 20px; right: -11px; bottom: -11px; } .fs-bar button { min-width: 34px; height: 34px; } }
