/* Signature Studio, MIT license. Part of jackjaillet.com. */
@font-face{font-family:"Instrument Sans";font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/instrument-sans-400.woff2) format("woff2")}
@font-face{font-family:"Instrument Sans";font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/instrument-sans-500.woff2) format("woff2")}
@font-face{font-family:"Instrument Sans";font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/instrument-sans-600.woff2) format("woff2")}
@font-face{font-family:"Instrument Sans";font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/instrument-sans-700.woff2) format("woff2")}
@font-face{font-family:"Playfair Display";font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/playfair-600.woff2) format("woff2")}
@font-face{font-family:"Playfair Display";font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/playfair-700.woff2) format("woff2")}
@font-face{font-family:"Playfair Display";font-style:italic;font-weight:600;font-display:swap;src:url(../fonts/playfair-600-italic.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/plex-mono-400.woff2) format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/plex-mono-500.woff2) format("woff2")}
/* Layout: three-pane workbench (layers | live email canvas | inspector), stacked on phones.
   Colors, type and shapes follow jackjaillet.com: cobalt accent, Playfair Display headings,
   Instrument Sans text, pill buttons. Dark by default; the site's theme switch (localStorage "theme") carries over. */
:root{
  color-scheme:dark;
  --bg:#10131a; --panel:#151923; --panel2:#1b2130; --ink:#e9ecf3; --muted:#a3acbf; --line:#29303e; --line-strong:#576885;
  --accent:#1e4fa3; --accent-ink:#e9ecf3; --accent-soft:#192338; --sel:#9db8f3; --accent-hover:#2a5fbd;
  --warn:#f0b35a; --warn-soft:#3a2c17; --danger:#ff8a80; --ok:#6fd39d; --ok-soft:#1b3326; --canvas:#ffffff;
  --glow:0 6px 28px rgba(42,95,189,.45);
  --ui:"Instrument Sans",-apple-system,"Segoe UI",Arial,sans-serif;
  --serif:"Playfair Display",Georgia,"Times New Roman",serif;
  --mono:"IBM Plex Mono",ui-monospace,Consolas,monospace;
  --radius:14px;
}
:root[data-theme="light"]{
  color-scheme:light;
  --bg:#f7f8fa; --panel:#ffffff; --panel2:#eef1f6; --ink:#14171d; --muted:#49505f; --line:#dce0e9; --line-strong:#7e8aa0;
  --accent:#1e4fa3; --accent-ink:#ffffff; --accent-soft:#e9eef9; --sel:#1e4fa3; --accent-hover:#163d82;
  --warn:#a15c00; --warn-soft:#fdf0dc; --danger:#b42318; --ok:#1d7a4b; --ok-soft:#e1f3e9;
  --glow:0 6px 24px rgba(58,118,245,.35);
}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 var(--ui);-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--sel);outline-offset:2px}
a{color:var(--sel)}

.app{display:grid;grid-template-rows:auto 1fr auto;height:100%}
/* the jackjaillet.com footer (same markup on every page, filled in by /js/footer.js), compact here;
   the editor hides it so the workbench keeps the full height */
.app[data-view="editor"] .site-footer{display:none}
.site-footer{border-top:1px solid var(--line);padding:2px 16px}
.site-footer .wrap{display:flex;flex-wrap:wrap;align-items:center;gap:0 20px}
.site-footer .brand{display:inline-block;padding:3px;border-radius:50%}
.site-footer .brand img{display:block;width:22px;height:22px;border-radius:50%}
.footer-links{display:flex;flex-wrap:wrap;align-items:center;gap:0 18px;list-style:none;margin:0;padding:0;font-size:12px;line-height:1.4}
.footer-links li{display:flex}
.footer-links a,.footer-links button{display:block;color:var(--muted);font:inherit;background:none;border:0;padding:6px 0;cursor:pointer;text-decoration:none}
.footer-links a:hover,.footer-links button:hover{color:var(--ink);text-decoration:underline}
.site-footer small{margin-left:auto;color:var(--muted);font-size:12px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* cookie choice (/js/footer.js), same as the main site */
.consent{position:fixed;z-index:100;left:16px;right:16px;bottom:16px;max-width:34rem;margin-left:auto;padding:14px 16px;display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 8px 32px rgba(0,0,0,.3)}
.consent p{flex:1 1 16rem;margin:0;color:var(--muted)}
.consent-actions{display:flex;gap:8px}
header.top{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 18px;border-bottom:1px solid var(--line);background:var(--panel);min-height:60px}
/* logo, site name, "/", app name in one line; on phones the two names stack beside the logo */
.brandwrap{display:flex;align-items:center;gap:8px;min-width:0}
.sitelogo{display:block;line-height:0;margin-right:2px}
.sitelogo img{width:32px;height:32px;border-radius:50%}
.sitebrand{color:var(--ink);text-decoration:none;font-weight:600;letter-spacing:.01em}
.crumb{color:var(--muted);margin:0 2px}
button.brand{border:0;background:none;padding:4px 6px;border-radius:8px;font-family:inherit;font-size:inherit;font-weight:600;letter-spacing:.01em;color:var(--ink);margin-right:6px}
button.brand:hover{background:var(--panel2)}
/* sun and moon switch, same as the main site's */
.themebtn{position:relative;display:inline-flex;align-items:center;justify-content:space-between;width:58px;height:28px;padding:0 6px;border:1px solid var(--line-strong);border-radius:999px;background:var(--panel2);cursor:pointer;flex:none}
.themebtn svg{position:relative;z-index:1;transition:color .25s,opacity .25s}
.themebtn .knob{position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:var(--panel);border:1px solid var(--line);transform:translateX(30px);transition:transform .25s}
.themebtn .icon-sun{color:var(--muted);opacity:.55}
.themebtn .icon-moon{color:var(--ink)}
:root[data-theme="light"] .themebtn .knob{transform:translateX(0)}
:root[data-theme="light"] .themebtn .icon-sun{color:var(--ink);opacity:1}
:root[data-theme="light"] .themebtn .icon-moon{color:var(--muted);opacity:.55}
@media (prefers-reduced-motion:reduce){.themebtn .knob,.themebtn svg{transition:none}}
.tname{flex:1 1 180px;min-width:0;max-width:320px;padding:7px 12px;border:1px solid var(--line-strong);border-radius:999px;background:var(--panel2)}
.dirty{font-size:12px;color:var(--muted)}
.spacer{flex:1}
.btn{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border:1px solid var(--line-strong);border-radius:999px;background:transparent;white-space:nowrap;font-weight:500;color:var(--ink);text-decoration:none;transition:background .18s,border-color .18s,box-shadow .18s,transform .18s}
.btn:hover{background:var(--panel2)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink);font-weight:600}
.btn.primary:hover{background:var(--accent-hover);border-color:var(--accent-hover);box-shadow:var(--glow);transform:translateY(-1px)}
.btn.ghost{border-color:transparent;background:transparent}
.btn.sm{padding:4px 11px;font-size:12px}
.btn.danger{color:var(--danger)}
.btn:disabled{opacity:.45;cursor:default;transform:none;box-shadow:none}
@media (prefers-reduced-motion:reduce){.btn.primary:hover{transform:none}}
.btn svg{width:12px;height:12px;fill:currentColor}

.work{display:grid;grid-template-columns:290px minmax(0,1fr) 340px;min-height:0}
.pane{background:var(--panel);overflow:auto;min-height:0}
.pane.left{border-right:1px solid var(--line)}
.pane.right{border-left:1px solid var(--line)}
.tabs{display:flex;border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--panel);z-index:2}
.tabs button{flex:1;padding:10px 4px;border:0;background:none;border-bottom:2px solid transparent;color:var(--muted);font-weight:500}
.tabs button[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--sel)}
.section{padding:14px 14px 4px}
.label{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:600;margin:0 0 8px}
.addto{margin:-2px 0 12px;font-size:12px;line-height:1.45;color:var(--muted)}
.addto b{color:var(--ink);font-weight:600}
.addgrp+.addgrp{margin-top:10px}
.addgl{display:block;font-size:12px;font-weight:600;color:var(--ink);margin:0 0 5px}
.addtiles{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}
.addgrid button{display:flex;flex-direction:column;align-items:center;gap:3px;padding:7px 2px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);font-size:11px}
.addgrid button:hover{border-color:var(--sel)}
.addgrid svg{width:14px;height:14px;fill:currentColor;opacity:.8}
.laysec{border-top:1px solid var(--line);margin-top:12px;padding-bottom:6px}
.laysec .note{margin:-2px 0 0;font-size:12px}

.blist{list-style:none;margin:0;padding:0 8px 10px;display:flex;flex-direction:column;gap:2px}
.bitem{display:flex;align-items:center;gap:7px;padding:6px 8px;border-radius:8px;border:1px solid transparent;cursor:pointer;background:var(--panel);min-height:34px}
.bitem:hover{background:var(--panel2)}
.bitem.sel{border-color:var(--sel);background:var(--accent-soft)}
.bitem.drag{opacity:.4}
.bitem.over,.emptycol.over{box-shadow:0 -2px 0 var(--sel) inset}
.bitem.rowh{margin-top:6px;background:var(--panel2)}
.bitem.colh{padding-left:22px;font-size:12px;color:var(--muted);min-height:28px}
.bitem.blk{padding-left:22px}
.bitem.blk.in{padding-left:36px}
.bitem .ic{width:22px;height:22px;border-radius:5px;background:var(--panel2);display:grid;place-items:center;flex:none}
.bitem.rowh .ic{background:var(--panel)}
.bitem .ic svg{width:12px;height:12px;fill:var(--muted)}
.bitem .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.bitem .acts{display:none;gap:1px}
.bitem:hover .acts,.bitem.sel .acts,.bitem:focus-within .acts{display:flex}
@media (hover:none){.bitem .acts{display:flex}}
.emptycol{margin-left:36px;padding:6px 8px;border:1px dashed var(--line);border-radius:8px;font-size:12px;color:var(--muted)}
.bitem .nm small{display:block;font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis}
.colsel{flex:none;max-width:104px;padding:3px 6px;border:1px solid var(--line);border-radius:6px;background:var(--panel);font-size:12px;cursor:pointer}
.bitem.colh .ic,.bitem.divh .ic{width:18px;height:18px;background:none}
.bitem.divh{padding-left:22px;font-size:12px;color:var(--muted);min-height:28px}
.divadd{padding:1px 0 1px 22px}
.divadd button{display:flex;align-items:center;gap:6px;width:100%;padding:4px 8px;border:1px dashed var(--line);border-radius:8px;background:none;color:var(--muted);font-size:12px;text-align:left}
.divadd button:hover{border-color:var(--sel);color:var(--ink)}
.divadd svg{width:10px;height:10px;fill:currentColor}
.addrow{position:sticky;bottom:0;z-index:1;display:flex;align-items:center;gap:6px;padding:10px 12px;border-top:1px solid var(--line);background:var(--panel);font-size:12px;color:var(--muted)}
.addrow label{white-space:nowrap}
.addrow select{flex:1;min-width:96px;padding:5px 6px;border:1px solid var(--line);border-radius:6px;background:var(--panel2);font-size:12px;color:var(--ink)}
.addrow .btn{flex:none;gap:5px}
.iconbtn{width:24px;height:24px;display:grid;place-items:center;border:0;background:none;border-radius:5px;color:var(--muted)}
.iconbtn:hover{background:var(--line);color:var(--ink)}
.iconbtn svg{width:12px;height:12px;fill:currentColor}

.lib{padding:12px;display:flex;flex-direction:column;gap:8px}
.card{border:1px solid var(--line);border-radius:8px;padding:10px;background:var(--panel)}
.card.cur{border-color:var(--sel)}
.card .t{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.card .m{font-size:12px;color:var(--muted)}
.card .row{display:flex;gap:4px;flex-wrap:wrap;margin-top:8px}
.card input[type=text]{width:100%;padding:4px 6px;border:1px solid var(--line);border-radius:5px;background:var(--panel2)}
.pgrid{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.pcard{border:1px solid var(--line);border-radius:8px;background:var(--canvas);padding:0;overflow:hidden;text-align:left;display:flex;flex-direction:column}
.pcard:hover{border-color:var(--sel)}
.pcard .pv{height:84px;overflow:hidden;position:relative;pointer-events:none}

.pcard .pn{font-size:12px;padding:6px 8px;border-top:1px solid var(--line);background:var(--panel);color:var(--ink);font-weight:500}
.note{font-size:12px;color:var(--muted);line-height:1.5;margin:0}
.empty{border:1px dashed var(--line);border-radius:8px;padding:14px;color:var(--muted);font-size:13px}

.stage{overflow:auto;padding:20px 16px 40px;display:flex;flex-direction:column;align-items:center;gap:14px;min-width:0}
.stagebar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;width:100%;max-width:760px}
.stagebar select{padding:4px 8px;border:1px solid var(--line);border-radius:6px;background:var(--panel);max-width:200px}
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--panel2);flex-wrap:wrap;padding:2px;gap:2px}
.seg button{border:0;background:none;padding:5px 10px;min-height:26px;border-radius:6px;font-size:12px;color:var(--muted);cursor:pointer}
.seg button:hover{color:var(--ink)}
.seg button[aria-pressed="true"]{background:var(--panel);color:var(--ink);font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.12),0 0 0 1px var(--line)}
.mail{width:100%;max-width:760px;background:var(--canvas);color:#202124;border-radius:var(--radius);box-shadow:0 1px 2px rgba(0,0,0,.08),0 8px 30px rgba(0,0,0,.08);overflow:hidden;transition:max-width .2s}
.mail.phone{max-width:380px}
.mail.dark{background:#202124;color:#e8eaed}
.mailhead{padding:12px 18px;border-bottom:1px solid #e6e8eb;font:13px/1.4 Arial,sans-serif;color:#5f6368;display:grid;gap:4px}
.mail.dark .mailhead{border-color:#3c4043;color:#9aa0a6}
.mailbody{padding:18px 18px 28px;font:14px/1.5 Arial,sans-serif;overflow-x:auto}
.mailbody .dash{color:#888;margin:14px 0 10px}
.sigwrap img{max-width:none}
.sigwrap [data-bid],.sigwrap [data-cid]{cursor:pointer}
.sigwrap [data-bid]:hover{outline:1px dashed rgba(36,83,230,.55);outline-offset:1px}
.sigwrap [data-bid].on,.sigwrap [data-cid].on{outline:2px solid var(--sel);outline-offset:1px}
.sigwrap [data-rid].on{outline:2px dashed var(--sel);outline-offset:2px}
.sigwrap [data-did],.sigwrap [data-dhit]{cursor:pointer}
.sigwrap [data-did].on{outline:2px solid var(--sel);outline-offset:2px}
.meter{font-family:var(--mono);font-size:12px;color:var(--muted)}
.checks{width:100%;max-width:760px;display:flex;flex-direction:column;gap:6px}
.chkline{display:flex;gap:8px;align-items:flex-start;border-radius:8px;padding:7px 10px;font-size:12.5px;background:var(--panel);border:1px solid var(--line)}
.chkline .dot{width:8px;height:8px;border-radius:50%;margin-top:5px;flex:none;background:var(--muted)}
.chkline.warn{background:var(--warn-soft);border-color:transparent;color:var(--warn)}
.chkline.warn .dot{background:var(--warn)}
.chkline.ok{background:var(--ok-soft);border-color:transparent;color:var(--ok)}
.chkline.ok .dot{background:var(--ok)}
.chkline button{margin-left:auto}

/* settings panel: a sticky header (where it is, what it is, its name, tabs) over cards of settings */
.insp{display:flex;flex-direction:column;min-height:100%;background:var(--bg)}
.insp h3{margin:0;font-size:16px;line-height:1.3}
.ihead{position:sticky;top:0;z-index:3;display:flex;flex-direction:column;gap:8px;padding:12px 14px 10px;background:var(--panel);border-bottom:1px solid var(--line)}
.ihead:has(.itabs){padding-bottom:0}
.ibar{display:flex;align-items:center;gap:8px;min-height:30px}
.crumbs{flex:1;min-width:0;display:flex;align-items:center;flex-wrap:wrap;gap:2px 4px;font-size:12px;color:var(--muted)}
.crumbs button{border:0;background:none;padding:2px 4px;margin:0 -2px;border-radius:5px;color:var(--muted);font:inherit;cursor:pointer;white-space:nowrap}
.crumbs button:hover{color:var(--ink);background:var(--panel2)}
.crumbs span{opacity:.6}
.imain{display:flex;align-items:center;gap:10px}
.itype{flex:none;width:38px;height:38px;border-radius:10px;display:grid;place-items:center;background:var(--accent-soft)}
.itype svg{width:17px;height:17px;fill:var(--sel)}
.iwho{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.ikind{font-size:12px;color:var(--muted)}
.iname{display:flex;align-items:center;gap:4px}
.iname input{flex:1;min-width:0;margin:0 -6px;padding:2px 6px;border:1px solid transparent;border-radius:6px;background:none;color:var(--ink);font:inherit;font-size:16px;font-weight:600;text-overflow:ellipsis}
.iname input::placeholder{color:var(--ink);opacity:1}
.iname input:hover{border-color:var(--line)}
.iname input:focus{border-color:var(--sel);background:var(--panel2);outline:none}
.iname .pen{display:grid;margin-left:6px}
.iname .pen svg{width:11px;height:11px;fill:var(--muted);opacity:.7}
.iname input:focus~.pen{display:none}
.ihead>.note{margin:0}
.itabs{display:flex;margin:2px -14px 0;padding:0 8px}
.itabs button{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:9px 4px 10px;border:0;border-bottom:2px solid transparent;background:none;color:var(--muted);font-size:13px;font-weight:500;cursor:pointer}
.itabs button svg{width:12px;height:12px;fill:currentColor}
.itabs button:hover{color:var(--ink)}
.itabs button[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--sel);font-weight:600}
.itabs button:focus-visible{outline:2px solid var(--sel);outline-offset:-2px;border-radius:6px}
.ibody{flex:1;display:flex;flex-direction:column;gap:10px;padding:12px}
.ipanel{display:flex;flex-direction:column;gap:10px}
.ipanel[hidden]{display:none}
.grp{display:flex;flex-direction:column;gap:12px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--panel)}
.grp>.label{margin:0}
.ghead{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;margin:-12px;padding:12px;width:calc(100% + 24px);border:0;border-radius:12px;background:none;text-align:left;cursor:pointer;color:var(--ink)}
.ghead .label{margin:0;font-size:13px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--ink)}
.grp:not(.closed)>.ghead{margin-bottom:-4px;padding-bottom:4px}
.ghead svg{width:10px;height:10px;fill:var(--muted);transition:transform .15s}
.ghead:hover svg{fill:var(--ink)}
.ghead:focus-visible{outline:2px solid var(--sel);outline-offset:-2px}
.grp.closed{padding-bottom:12px}
.grp.closed>:not(.ghead){display:none}
.grp.closed .ghead svg{transform:rotate(-90deg)}
@media (prefers-reduced-motion:reduce){.ghead svg{transition:none}}
.grp .sub{display:flex;flex-direction:column;gap:10px}
.grp .sub[hidden]{display:none}
.help{display:inline-grid;place-items:center;width:15px;height:15px;margin-left:5px;padding:0;border:1px solid var(--line);border-radius:50%;background:var(--panel2);color:var(--muted);font-size:10px;font-weight:600;line-height:1;vertical-align:1px;cursor:help;flex:none}
.help:hover,.help[aria-expanded="true"]{border-color:var(--sel);color:var(--ink)}
.help:focus-visible{outline:2px solid var(--sel);outline-offset:1px}
.helptip{position:fixed;z-index:1000;max-width:260px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--ink);font-size:12px;line-height:1.45;box-shadow:0 6px 24px rgba(0,0,0,.18);pointer-events:none}
.helptip[hidden]{display:none}
@media (pointer:coarse){.help{width:22px;height:22px;font-size:12px}}
.field{display:flex;flex-direction:column;gap:4px;min-width:0}
.field>span{display:flex;align-items:center;font-size:12px;font-weight:500;color:var(--ink)}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:10px;align-items:end}
.field input[type=text],.field input[type=number],.field select,.field textarea{width:100%;padding:7px 9px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);min-width:0}
.field input:hover,.field select:hover,.field textarea:hover{border-color:var(--line-strong)}
.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--sel);outline:none;box-shadow:0 0 0 3px var(--accent-soft)}
.field textarea{resize:vertical;min-height:60px;font-family:inherit}
.field textarea.code{font-family:var(--mono);font-size:12px;min-height:120px}
.rng{display:flex;align-items:center;gap:8px}
.rng input[type=range]{flex:1;min-width:0;accent-color:var(--sel)}
.rng input[type=number]{width:58px;flex:none;text-align:right}
.row2 .rng input[type=number]{width:52px}
.clr{display:flex;flex-direction:column;gap:8px}
.clrpick{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.clrpick[hidden]{display:none}
.clr input[type=color]{width:32px;height:32px;padding:2px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);flex:none;cursor:pointer}
.clr input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.clr input[type=color]::-webkit-color-swatch{border:0;border-radius:5px}
.clr input[type=color]::-moz-color-swatch{border:0;border-radius:5px}
.field .clr input[type=text]{font-family:var(--mono);font-size:12px;flex:1 1 74px;width:auto;min-width:64px}
.sw5{display:flex;gap:4px}
.sw5 button.on{outline:2px solid var(--sel);outline-offset:1px}
.sw5 button{width:22px;height:22px;border-radius:6px;border:1px solid var(--line);padding:0;cursor:pointer}
.row2 .clrpick{gap:5px}
.row2 .clr input[type=text]{flex-basis:60px}
.row2 .sw5 button{width:18px;height:18px;border-radius:5px}
.chk{display:flex;align-items:center;gap:8px;font-size:13px;cursor:pointer}
.chk input{accent-color:var(--sel)}
/* on/off settings in the panel are switches */
.insp .chk input[type=checkbox]{appearance:none;-webkit-appearance:none;position:relative;flex:none;width:30px;height:18px;margin:0;border-radius:999px;background:var(--line-strong);cursor:pointer;transition:background .15s}
.insp .chk input[type=checkbox]::before{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s}
.insp .chk input[type=checkbox]:checked{background:var(--accent)}
.insp .chk input[type=checkbox]:checked::before{transform:translateX(12px)}
.insp .chk input[type=checkbox]:focus-visible{outline:2px solid var(--sel);outline-offset:2px}
.insp .chk input[type=checkbox]:disabled{opacity:.5}
/* bold / italic / all caps */
.tgls{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.tgls button{display:flex;align-items:center;justify-content:center;gap:6px;padding:6px 4px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);color:var(--muted);font-size:12px;cursor:pointer}
.tgls button .g{display:grid;place-items:center;min-width:14px;color:var(--ink);font-size:13px}
.tgls button:hover{border-color:var(--line-strong);color:var(--ink)}
.tgls button[aria-pressed="true"]{border-color:var(--sel);background:var(--accent-soft);color:var(--ink);font-weight:600}
/* insert a person's detail */
.insf{position:relative;display:flex;align-items:center;gap:6px}
.insf select{flex:1;min-width:0;padding:6px 8px 6px 28px;border:1px dashed var(--line-strong);border-radius:8px;background:var(--panel);color:var(--ink);font-size:12.5px;cursor:pointer}
.insf select:hover{border-color:var(--sel)}
.insic{position:absolute;left:10px;top:50%;transform:translateY(-50%);display:grid;pointer-events:none}
.insic svg{width:10px;height:10px;fill:var(--sel)}
.insp .seg{display:flex}
.insp .seg button{flex:1 1 auto}
.sides{display:flex;gap:10px;flex-wrap:wrap}
.iconpick{display:flex;align-items:center;gap:8px}
.iconpick .sw{width:32px;height:32px;border:1px solid var(--line);border-radius:6px;display:grid;place-items:center;background:var(--panel2);flex:none}
.iconpick .sw svg,.iconpick .sw img{width:16px;height:16px;fill:var(--ink)}
.items{display:flex;flex-direction:column;gap:8px}
.item{border:1px solid var(--line);border-radius:8px;padding:8px;display:flex;flex-direction:column;gap:6px;background:var(--panel2)}
.item .bar{display:flex;align-items:center;gap:4px}
.item .bar .grow{flex:1;font-size:12px}
.item .field input{background:var(--panel)}
.thumb{width:100%;max-height:120px;object-fit:contain;background:repeating-conic-gradient(var(--panel2) 0 25%,var(--panel) 0 50%) 50%/14px 14px;border:1px solid var(--line);border-radius:6px}
.badge{display:inline-block;font-size:11px;padding:2px 6px;border-radius:4px;background:var(--warn-soft);color:var(--warn)}
.badge.ok{background:var(--ok-soft);color:var(--ok)}
.chips{display:flex;flex-wrap:wrap;gap:4px;align-items:center}
.chips>span{font-size:11px;color:var(--muted);margin-right:2px}
.chip{font-family:var(--mono);font-size:11px;padding:2px 7px;border-radius:20px;border:1px solid var(--line);background:var(--panel)}
.chip:hover{border-color:var(--sel);color:var(--sel)}
.shapes{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.shapes button{display:flex;flex-direction:column;align-items:center;gap:5px;padding:8px 2px;border:1px solid var(--line);border-radius:8px;background:var(--panel2);font-size:11px}
.shapes button[aria-pressed="true"]{border-color:var(--sel);background:var(--accent-soft)}
.shapes i{display:block;width:24px;height:24px;background:var(--muted)}

.person{border:1px solid var(--line);border-radius:8px;background:var(--panel)}
.person.on{border-color:var(--sel)}
.person>.ph{display:flex;align-items:center;gap:8px;padding:8px 10px;cursor:pointer}
.person .av{width:28px;height:28px;border-radius:50%;background:var(--panel2);overflow:hidden;flex:none;display:grid;place-items:center;font-size:11px;color:var(--muted)}
.person .av img{width:100%;height:100%;object-fit:cover}
.person .pn{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500;font-size:13px}
.person .pb{padding:4px 10px 10px;display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line)}

dialog{border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--ink);padding:0;width:min(720px,calc(100vw - 32px));max-height:calc(100vh - 48px)}
dialog::backdrop{background:rgba(10,14,12,.45)}
.dlg{display:flex;flex-direction:column;max-height:calc(100vh - 50px)}
.dlg header{display:flex;gap:8px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.dlg header h2{margin:0;font-size:15px;flex:1}
.dlg .body{padding:12px 14px;overflow:auto}
.dlg footer{padding:10px 14px;border-top:1px solid var(--line);display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.search{flex:1 1 200px;padding:7px 10px;border:1px solid var(--line);border-radius:6px;background:var(--panel2);min-width:0}
.igrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:6px}
.igrid button{display:flex;flex-direction:column;align-items:center;gap:4px;padding:10px 4px 6px;border:1px solid var(--line);border-radius:8px;background:var(--panel);font-size:10px;color:var(--muted);overflow:hidden}
.igrid button:hover{border-color:var(--sel);color:var(--ink)}
.igrid svg,.igrid img{width:20px;height:20px;fill:var(--ink)}
.igrid span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.steps{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px}
.code{width:100%;min-height:150px;font-family:var(--mono);font-size:11.5px;padding:8px;border:1px solid var(--line);border-radius:6px;background:var(--panel2)}

.toast{display:flex;align-items:center;gap:12px;position:fixed;left:50%;bottom:calc(20px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);background:var(--ink);color:var(--panel);padding:9px 14px;border-radius:8px;font-size:13px;z-index:50;max-width:calc(100vw - 32px)}
.toast[hidden]{display:none}
.toast button{border:0;background:none;color:inherit;font-weight:600;text-decoration:underline;padding:4px 2px;min-height:24px}

@media (max-width:1150px){.work{grid-template-columns:260px minmax(0,1fr) 300px}}
@media (max-width:880px){
  .app{height:auto}
  .work{grid-template-columns:1fr}
  .pane.left,.pane.right{border:0;border-bottom:1px solid var(--line)}
  .stage{order:-1}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}

/* ---------- v3 shell: home (companies + signatures) and a three-step editor ---------- */
.app[data-view="home"] .ed-only,.app[data-view="editor"] .home-only{display:none!important}
.hbar{display:flex;align-items:center;gap:8px;flex:1;flex-wrap:wrap;min-width:0}
button.brand{border:0;background:none;padding:2px 4px;border-radius:6px;font-size:14px}
button.brand:hover{background:var(--panel2)}
.search.top-search{max-width:420px}
.stepnav{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--panel)}
.stepnav button{border:0;background:none;padding:6px 14px;color:var(--muted);font-weight:500;display:inline-flex;align-items:center;gap:6px}
.stepnav button+button{border-left:1px solid var(--line)}
.stepnav button[aria-selected="true"]{background:var(--accent-soft);color:var(--ink);font-weight:600}
.stepnav .num{font-family:var(--mono);font-size:11px;width:18px;height:18px;border-radius:50%;display:grid;place-items:center;border:1px solid currentColor}
.savestate{font-size:12px;color:var(--muted);border:0;background:none;padding:2px 4px}
.savestate.err{color:var(--danger);text-decoration:underline;cursor:pointer}

#view-home,#view-editor{min-height:0}
.home{display:grid;grid-template-columns:260px minmax(0,1fr);min-height:0;height:100%}
.cos{background:var(--panel);border-right:1px solid var(--line);overflow:auto;padding:14px 10px;display:flex;flex-direction:column;gap:2px}
.cos .bitem{width:100%;text-align:left}
.cos .sw{width:12px;height:12px;border-radius:3px;flex:none}
.homemain{overflow:auto;padding:22px 24px 48px;display:flex;flex-direction:column;gap:18px;min-width:0}
/* the column scrolls instead of squeezing: without this the template category bar (overflow:hidden) shrank to ~6px and the cards covered its buttons */
.homemain>*{flex-shrink:0}
.homemain h1{font-size:20px;margin:0;text-wrap:balance}
.cohead{display:flex;gap:16px;align-items:center;flex-wrap:wrap}
.cohead .logo{max-width:140px;max-height:48px;object-fit:contain}
.cohead .grow{flex:1;min-width:200px}
.brandkit{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);padding:14px;display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.brandkit .field input[type=text],.brandkit select{width:100%;padding:6px 8px;border:1px solid var(--line);border-radius:6px;background:var(--panel2)}
.sgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px}
.scard{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);overflow:hidden;display:flex;flex-direction:column}
.scard:hover{border-color:var(--sel)}
.scard .thumb2{height:200px;overflow:hidden;background:var(--canvas);border:0;padding:0;text-align:left;cursor:pointer;display:block;width:100%;position:relative}
.scard .thumb2>div,.pcard .pv>div,.tgrid .pcard .pv>div{position:absolute;top:0;left:0;transform-origin:0 0;width:max-content;max-width:600px;padding:0;pointer-events:none}
.scard .meta{padding:10px 12px 12px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:6px}
.scard .t{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scard .m{font-size:12px;color:var(--muted)}
.scard .row{display:flex;gap:4px;flex-wrap:wrap;align-items:center}
.scard select{flex:1;min-width:0;padding:4px 6px;border:1px solid var(--line);border-radius:6px;background:var(--panel2);font-size:12px}
.newcard{border:1.5px dashed var(--line);border-radius:var(--radius);background:transparent;min-height:278px;display:grid;place-items:center;color:var(--muted);font-weight:600;gap:6px;align-content:center}
.newcard:hover{border-color:var(--sel);color:var(--sel)}
.newcard svg{width:22px;height:22px;fill:currentColor}
/* signatures are roughly 4:3, so a 4:3 frame lets fitThumbs show them big enough to read */
.tgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}
.tgrid .pcard .pv{height:auto;aspect-ratio:4/3}
.tgrid .pcard .pn{font-size:13px;padding:8px 10px}
#newme{margin-bottom:14px;border:1px solid var(--line);border-radius:10px;padding:10px 12px;background:var(--panel2)}
#newme summary{cursor:pointer;font-weight:600}
.mefields{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;margin:10px 0 6px}
.mefields label{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--muted)}
.mefields input{width:100%;padding:6px 8px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--ink)}

.step2{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);min-height:0;height:100%}
.step2>.pane2{overflow:auto;background:var(--panel);border-right:1px solid var(--line);min-width:0}
.pwrap{padding:20px 22px 40px;display:flex;flex-direction:column;gap:14px;max-width:900px}
.pwrap h2{font-size:18px;margin:0}
.stagehost{overflow:auto;min-width:0;display:flex}
.stagehost>.stage{flex:1}
.tablewrap{overflow-x:auto;border:1px solid var(--line);border-radius:10px}
.ptable{width:100%;border-collapse:collapse;font-size:13px}
.ptable th{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);text-align:left;padding:8px;background:var(--panel2);border-bottom:1px solid var(--line);white-space:nowrap}
.ptable td{padding:6px 8px;border-bottom:1px solid var(--line);vertical-align:middle}
.ptable tr:last-child td{border-bottom:0}
.ptable tr.on td{background:var(--accent-soft)}
.ptable input[type=text]{width:100%;min-width:120px;padding:5px 7px;border:1px solid transparent;border-radius:5px;background:transparent}
.ptable input[type=text]:hover{border-color:var(--line)}
.ptable input[type=text]:focus{border-color:var(--sel);background:var(--panel)}
.ptable .photo{display:flex;gap:6px;align-items:center;min-width:150px}
.ptable .photo img{width:28px;height:28px;border-radius:50%;object-fit:cover;flex:none}
.ptable .acts2{display:flex;gap:2px;justify-content:flex-end;white-space:nowrap}
.sharecard{border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;display:flex;flex-direction:column;gap:10px;background:var(--panel)}
.sharecard :is(h2,h3){margin:0;font-size:15px;display:flex;align-items:center;gap:8px}
.sharecard :is(h2,h3) svg{width:15px;height:15px;fill:var(--sel)}
.sharecard .row{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.teamlist{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.teamlist>div{display:flex;gap:8px;align-items:center;padding:6px 10px;border-bottom:1px solid var(--line);font-size:13px}
.teamlist>div:last-child{border-bottom:0}
.teamlist .grow{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

@media (max-width:880px){
  .home{grid-template-columns:1fr;height:auto}
  .cos{border-right:0;border-bottom:1px solid var(--line);max-height:none}
  .step2{grid-template-columns:1fr;height:auto}
  .step2>.pane2{border-right:0;border-bottom:1px solid var(--line)}
  .homemain{padding:16px}
}

[hidden]{display:none!important}
#view-editor:not([hidden]){display:grid;min-height:0}
#view-editor>*{min-height:0}

/* sharing */
.shbanner{font-size:12px;padding:3px 8px;border-radius:20px;background:var(--accent-soft);color:var(--ink);white-space:nowrap;max-width:320px;overflow:hidden;text-overflow:ellipsis}
#view-editor.ro-design #step-design .pane.left,#view-editor.ro-design #step-design .pane.right{pointer-events:none;opacity:.5}
.memlist{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:8px;overflow:hidden}
.memrow{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:10px 12px;border-bottom:1px solid var(--line)}
.memrow:last-child{border-bottom:0}
.memrow .grow{flex:1 1 260px;min-width:0;overflow-wrap:anywhere}
.memperms{display:flex;gap:4px 14px;flex-wrap:wrap;margin-top:4px}
.sharepanel select,.sharepanel input[type=email]{width:100%;padding:6px 8px;border:1px solid var(--line);border-radius:6px;background:var(--panel2)}

/* a person's own signature page */
.app:not([data-view="person"]) .person-only,.app[data-view="person"] .home-only,.app[data-view="person"] .ed-only{display:none!important}
.personview{overflow:auto;display:flex;justify-content:center;padding:28px 16px 48px}
.personview .pwrap{width:100%;max-width:760px}
.ptitle{font-size:22px;margin:0;text-wrap:balance}
.personview .mail{max-width:none}
.personview .field input{width:100%;padding:7px 9px;border:1px solid var(--line);border-radius:6px;background:var(--panel2)}
.chkline code{font-size:11px;overflow-wrap:anywhere}

/* sign-in options */
.googlebtn{justify-content:center;width:100%;padding:9px 12px;font-weight:600}
.googlebtn svg{width:15px;height:15px}
.orline{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px}
.orline::before,.orline::after{content:"";flex:1;border-top:1px solid var(--line)}
.gsiwrap{min-height:44px;display:flex;justify-content:center}

/* site typography: serif display for page and section headings */
.homemain h1,.pwrap h2,.ptitle,.dlg header h2,.sharecard :is(h2,h3){font-family:var(--serif);font-weight:600;letter-spacing:0}
.homemain h1{font-size:26px}
.pwrap h2{font-size:22px}
.ptitle{font-size:28px;line-height:1.2}
.sharecard :is(h2,h3){font-size:17px}
.dlg header h2{font-size:19px}
.bitem.sel,.bitem.rowh.sel{border-color:var(--sel)}
.stepnav{border-radius:999px}
.stepnav button[aria-selected="true"]{background:var(--accent);color:var(--accent-ink)}
.stepnav .num{border-color:currentColor}
.mail{box-shadow:var(--glow)}
:root[data-theme="light"] .mail{box-shadow:0 1px 2px rgba(0,0,0,.06),0 8px 30px rgba(20,23,29,.08)}

/* ---------- phones and small tablets ---------- */
@media (max-width:880px){
  /* the preview leads and stays pinned while you scroll the layers and settings under it */
  .stagehost{order:-1;position:sticky;top:0;z-index:4;max-height:46vh;background:var(--bg);border-bottom:1px solid var(--line)}
  .stagehost>.stage{padding:12px 10px 16px}
  .pane.right{scroll-margin-top:47vh}
  .ihead{position:static}
  /* in that small pinned window, show the signature itself, not the sample email around it */
  .mailhead,.mailbody>div:not(.sigwrap){display:none}
}
@media (max-width:640px){
  /* header: logo, title and theme switch on one line; that view's controls on full-width rows below */
  header.top{padding:8px 12px;gap:8px;min-height:0}
  .brandwrap{display:grid;grid-template-columns:auto auto;column-gap:10px;align-items:center;justify-content:start}
  .sitelogo{grid-row:1/3;margin:0}
  .sitebrand{font-size:12px;font-weight:500;color:var(--muted);line-height:1.2}
  .brandwrap button.brand{padding:0;margin:0;font-size:17px;line-height:1.2;text-align:left}
  .crumb{display:none}
  .themebtn{margin-left:auto}
  .hbar{order:3;flex:1 1 100%;gap:6px}
  .hbar .spacer{display:none}
  .search.top-search{flex:1 1 100%;max-width:none}
  /* editor rows: back + save state + undo/redo, then name + company, then steps, then copy */
  #back{order:1}
  #savestate{order:2;margin-left:auto}
  #undo,#redo{order:2}
  .tname{order:3;flex:1 1 55%;max-width:none}
  #tcompany{order:4;flex:1 1 35%;max-width:none!important}
  .stepnav{flex:1 1 100%;order:5}
  .stepnav button{flex:1;justify-content:center;padding:8px 6px}
  #copygmail{flex:1 1 100%;justify-content:center;order:6}
  .homemain{padding:14px 12px 40px}
  .newcard{min-height:96px}
  .sgrid{grid-template-columns:1fr}
  .tgrid{grid-template-columns:1fr}
  .consent{left:12px;right:12px;bottom:12px}
  /* 16px stops iPhones zooming the page whenever a field is tapped */
  input,select,textarea{font-size:16px}
}
/* fingers need bigger targets than mouse pointers */
@media (pointer:coarse){
  .btn.sm{min-height:36px}
  .iconbtn{width:36px;height:36px}
}

/* people: one card per person; the one being edited opens into a form */
.plist{display:flex;flex-direction:column;gap:6px;margin:4px 0 10px}
.pers{border:1px solid var(--line);border-radius:10px;background:var(--panel2)}
.pers.on{border-color:var(--sel);background:var(--panel)}
.phead{display:flex;align-items:center;gap:8px;padding:6px 8px}
.pick{flex:1;min-width:0;display:flex;align-items:center;gap:10px;background:none;border:0;padding:2px;color:inherit;text-align:left;cursor:pointer;font:inherit}
.pav{flex:none;width:30px;height:30px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:var(--accent-soft);font-size:11px;font-weight:700}
.pav img{width:100%;height:100%;object-fit:cover}
.pnm{min-width:0;display:flex;flex-direction:column}
.pnm b,.pnm .note{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pnm .note{margin:0;font-size:12px}
.pform{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px;padding:4px 12px 2px}
.pf{display:flex;flex-direction:column;gap:3px;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.pf input,.pf textarea{text-transform:none;letter-spacing:0;font:inherit;font-size:13px;color:var(--ink);padding:6px 8px;border:1px solid var(--line);border-radius:6px;background:var(--panel2);resize:none;min-height:0;width:100%;box-sizing:border-box}
.pf textarea{overflow:hidden;line-height:1.35}
.pf input:focus,.pf textarea:focus{border-color:var(--sel);outline:none}
.pers > .note{padding:0 12px 8px}
.phead .acts2{display:flex;flex-direction:row;align-items:center;gap:2px;flex:none}
.stage.still .sigwrap [data-bid],.stage.still .sigwrap [data-cid]{cursor:default;outline:none}
/* keep each section at its full height; a short window scrolls instead of squashing the signature preview */
.pwrap > *{flex-shrink:0}

/* reframe: the picture inside its frame; drag to move, wheel or slider to zoom */
.reframe{position:relative;overflow:hidden;background:var(--panel2);border:1px solid var(--line-strong);cursor:grab;touch-action:none;margin:2px 0 6px;max-width:100%}
.reframe.drag{cursor:grabbing}
.reframe:focus-visible{outline:2px solid var(--sel);outline-offset:2px}
.reframe .rf-img{position:absolute;background-size:100% 100%;pointer-events:none}
.reframe.empty{cursor:default;display:grid;place-items:center}
.reframe.empty .rf-img{position:static;color:var(--muted);font-size:12px;padding:10px;text-align:center}
/* the selected column shows a grab bar on its right edge: drag it to change the width */
.sigwrap [data-cid].on{box-shadow:inset -3px 0 0 var(--sel)}
.stage.still .sigwrap [data-cid].on{box-shadow:none}
