/* Create an SVG. Light, calm, readable: we tried hard to make this not hurt anyone's eyes. */
:root {
  --ink: #1d1720;
  --ink-2: #4a4150;
  --muted: #6b6270;
  --line: #e7e2ea;
  --line-2: #d6cfdb;
  --paper: #ffffff;
  --wash: #f8f6f9;
  --wash-2: #f1edf3;
  --accent: #c026d3;
  --accent-hover: #a21caf;
  --accent-text: #a21caf;   /* 5.8:1 on white, for text and links */
  --accent-soft: #fbeefd;
  --bar: #0e0f0f;
  --danger: #b42318;
  --radius: 8px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --hair: 1;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--ink); background: var(--paper); }
img, svg { display: block; }
a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #e879f9; outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 6px; z-index: 100; }
.skip:focus { top: 8px; }

/* ---------- header and footer ---------- */
.top { background: var(--bar); color: #e9e4ec; display: flex; align-items: center; gap: 20px; padding: 6px 20px; min-height: 66px; }
.brand { flex: none; border-radius: 6px; overflow: hidden; }
.brand img { width: 96px; height: 54px; object-fit: cover; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-left: auto; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: #e9e4ec; text-decoration: none; font-size: 15px; font-weight: 500; padding: 8px 12px; border-radius: 6px; white-space: nowrap; }
.nav a:hover { background: #24202a; color: #fff; }
.nav a[aria-current="page"] { background: #2a2230; color: #fff; box-shadow: inset 0 -2px 0 #e879f9; }
.nav .ext { color: #c9c0cf; }
.foot { border-top: 1px solid var(--line); background: var(--wash); margin-top: 64px; }
.foot-in { max-width: 1100px; margin: 0 auto; padding: 28px 20px 36px; display: grid; gap: 10px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot nav a { color: var(--ink-2); font-size: 15px; }
.foot-note { margin: 0; font-weight: 500; }
.foot-small { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- tool title strip ---------- */
.tool-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; padding: 12px 20px 10px; border-bottom: 1px solid var(--line); }
.tool-head h1 { font-size: 22px; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
.tool-head p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* ---------- the editor ---------- */
.app { display: grid; grid-template-rows: auto 1fr auto; height: calc(100svh - 66px - 52px); min-height: 560px; background: var(--wash); border-bottom: 1px solid var(--line); }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); }
.bar-group { display: flex; align-items: center; gap: 6px; }
.bar-group.end { margin-left: auto; }
.field-inline { font-size: 14px; color: var(--muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line-2); background: #fff; border-radius: var(--radius); font-size: 15px; font-weight: 500; cursor: pointer; color: var(--ink); text-decoration: none; }
.btn:hover { background: var(--wash-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.icon { width: 36px; padding: 0; font-size: 20px; line-height: 1; }
.btn.icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.accent { border-color: var(--accent); color: var(--accent-text); }
.btn.danger { color: var(--danger); }
.btn.link { border: 0; background: none; color: var(--ink-2); text-decoration: underline; }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: 14px; }
.btn.icon.sm { width: 34px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.btn.wide { width: 100%; margin-top: 8px; }
.zoom-val { min-width: 64px; font-variant-numeric: tabular-nums; }
.sel, .input { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; font-size: 15px; width: 100%; }
.sel { width: auto; padding-right: 28px; }
.sel-sm { min-width: 62px; }
textarea.input { resize: vertical; min-height: 64px; line-height: 1.4; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; cursor: pointer; padding: 4px 2px; }
.chk input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.chk.cut { font-weight: 600; }

.work { display: grid; grid-template-columns: 92px minmax(0, 1fr) 300px; min-height: 0; }
.tools { display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; background: #fff; border-right: 1px solid var(--line); overflow-y: auto; }
.tool { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 8px; border: 1px solid transparent; border-radius: var(--radius); background: none; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tool svg { width: 26px; height: 26px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { background: var(--accent-soft); color: var(--ink); }
.tool:hover svg { stroke: var(--accent-text); }

.stage-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--wash-2); }
.stage-wrap.dragging::after { content: 'Drop to open'; position: absolute; inset: 12px; border: 2px dashed var(--accent); border-radius: 12px; display: grid; place-items: center; font-size: 20px; font-weight: 600; color: var(--accent-text); background: rgb(251 238 253 / .85); }
#stage { width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; outline: none; }
#artboard { fill: #fff; stroke: var(--line-2); stroke-width: calc(var(--hair) * 1px); filter: drop-shadow(0 1px 2px rgb(29 23 32 / .08)); }
#grid-path { stroke: #d9cfe0; }
#objs .hit { fill: none; stroke: transparent; }
.sel-box { fill: none; stroke: var(--accent); pointer-events: none; }
.handle { fill: #fff; stroke: var(--accent); cursor: pointer; }
.handle.rot { cursor: grab; }
.h-nw, .h-se { cursor: nwse-resize; } .h-ne, .h-sw { cursor: nesw-resize; } .h-n, .h-s { cursor: ns-resize; } .h-e, .h-w { cursor: ew-resize; }
.marquee { fill: rgb(192 38 211 / .08); stroke: var(--accent); pointer-events: none; }
.empty-hint { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(92%, 460px); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; font-size: 15px; color: var(--ink-2); text-align: center; pointer-events: none; }
.empty-hint p { margin: 0; }
.drop { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(241 237 243 / .86); }
.drop-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px 26px; max-width: 420px; text-align: center; box-shadow: 0 10px 30px rgb(29 23 32 / .08); }
.drop-card p { margin: 0 0 14px; color: var(--ink-2); }
.drop-title { font-size: 20px; font-weight: 600; color: var(--ink) !important; margin-bottom: 6px !important; }
.status { position: absolute; left: 12px; right: 12px; bottom: 12px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px; padding: 8px 12px; font-size: 14px; color: var(--ink-2); }
.status:empty, .status[hidden] { display: none; }
.toast { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: max-content; max-width: min(92%, 560px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 15px; box-shadow: 0 8px 24px rgb(0 0 0 / .18); z-index: 5; }
.toast a { color: #f5d0fe; }

.props { background: #fff; border-left: 1px solid var(--line); padding: 14px 16px 24px; overflow-y: auto; font-size: 15px; }
.p-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 16px; margin-bottom: 10px; }
.tag { font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); padding: 2px 8px; border-radius: 99px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.grid2 label, .stack { display: grid; gap: 3px; font-size: 13px; color: var(--muted); font-weight: 500; }
.grid2 .chk.tight { align-self: end; font-size: 14px; color: var(--ink-2); padding-bottom: 8px; }
.row { display: grid; grid-template-columns: auto 1fr 3.2em; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); margin-top: 10px; }
.row.grow { margin-top: 0; flex: 1; }
.row output { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.sect { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.sect-t { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 10px 0 6px; }
.sect > .sect-t:first-child { margin-top: 0; }
.color-row { display: flex; align-items: center; gap: 12px; }
input[type=color] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; cursor: pointer; }
input[type=color]:disabled { opacity: .4; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgb(0 0 0 / .15); background: var(--c); cursor: pointer; padding: 0; }
.sw:hover { transform: scale(1.12); }
.btns { display: flex; flex-wrap: wrap; gap: 6px; }
.btns.align { gap: 4px; }
.fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.font-btn { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 6px 8px; cursor: pointer; height: 42px; display: grid; place-items: center; }
.font-btn img { width: 100%; height: 26px; object-fit: contain; }
.font-btn:hover { border-color: var(--line-2); background: var(--wash); }
.font-btn.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.seg { display: flex; gap: 4px; margin-top: 10px; }
.note, .tip { font-size: 14px; color: var(--ink-2); background: var(--wash); border-radius: 8px; padding: 10px 12px; margin: 10px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.keys { padding-left: 18px; margin: 0; font-size: 14px; color: var(--ink-2); }
kbd { font-family: var(--font); font-size: 12px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: #fff; }

.code { background: #fff; border-top: 1px solid var(--line); padding: 10px 12px 12px; }
.code-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 6px; }
.code textarea { width: 100%; height: 180px; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--wash); resize: vertical; }

.dlg { border: 1px solid var(--line); border-radius: 14px; padding: 18px; width: min(680px, 94vw); max-height: 86vh; box-shadow: 0 20px 50px rgb(29 23 32 / .2); }
.dlg::backdrop { background: rgb(29 23 32 / .35); }
.dlg-sm { width: min(420px, 94vw); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dlg-title { font-size: 19px; margin: 0 0 10px; }
.dlg-head .dlg-title { margin: 0; }
.icons-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; margin-top: 12px; max-height: 52vh; overflow-y: auto; padding: 2px; }
.icon-btn { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; display: grid; place-items: center; padding: 10px; }
.icon-btn svg { width: 100%; height: 100%; fill: var(--ink); }
.icon-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.icon-btn:hover svg { fill: var(--accent-text); }
.dlg-foot { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.row3 label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ---------- content below the tool, and plain pages ---------- */
.content { max-width: 760px; margin: 0 auto; padding: 40px 20px 0; }
.content h1 { font-size: clamp(30px, 5vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; }
.content h2 { font-size: 26px; line-height: 1.25; letter-spacing: -0.01em; margin: 44px 0 10px; }
.content h3 { font-size: 20px; margin: 28px 0 8px; }
.content p, .content li { color: var(--ink-2); }
.content .lede { font-size: 19px; color: var(--ink); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; position: relative; padding: 12px 14px 12px 54px; background: var(--wash); border-radius: 10px; }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px; display: grid; place-items: center; }
.steps li > strong:first-child { color: var(--ink); display: block; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); font-size: 18px; }
.faq details p { margin: 8px 0 0; }
.callout { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 14px 18px; background: #fff; margin: 22px 0; }
.callout p { margin: 0; }
.fact { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin: 32px 0; background: #fff; }
.fact-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 6px; }
.fact-text { margin: 0 0 10px; color: var(--ink) !important; font-size: 18px; }
.fact-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.fact-foot a { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 18px 0; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-decoration: none; color: var(--ink); background: #fff; }
.card:hover { border-color: var(--accent); }
.card strong { display: block; margin-bottom: 4px; }
.card span { color: var(--ink-2); font-size: 15px; }
table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 16px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink); background: var(--wash); }
.is-page .content { padding-top: 48px; }
.updated { color: var(--muted); font-size: 15px; }
.licenses li { margin-bottom: 10px; }

/* Contact form (markup and script from the house template; only the look is ours) */
.contact-form { display: flex; flex-direction: column; margin-top: 8px; max-width: 560px; }
.contact-form label { margin: 14px 0 5px; font-size: 15px; font-weight: 600; color: var(--ink); }
.contact-form label .optional { font-weight: 400; color: var(--muted); }
.contact-form input, .contact-form textarea { width: 100%; padding: 10px 12px; background: #fff; border: 1px solid var(--line-2); border-radius: 8px; font-size: 16px; }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgb(192 38 211 / .18); }
.contact-form textarea { min-height: 150px; resize: vertical; }
.contact-honeypot { display: none; }
.fs-field-error { font-size: 14px; color: var(--danger); margin-bottom: 4px; }
.fs-field-error:empty { display: none; }
.contact-submit { align-self: flex-start; margin-top: 18px; padding: 11px 24px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; font-weight: 600; font-size: 16px; cursor: pointer; }
.contact-submit:hover { background: var(--accent-hover); }
.contact-submit:disabled { opacity: .6; cursor: default; }
.contact-status { padding: 12px 14px; border-radius: 8px; }
.contact-success { background: #ecfdf3; color: #05603a; }
.contact-error { background: #fef3f2; color: var(--danger); }
.contact-note { font-size: 14px; color: var(--muted); }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) { .work { grid-template-columns: 84px minmax(0, 1fr) 260px; } }
@media (max-width: 900px) {
  .top { padding: 6px 12px; gap: 10px; }
  .brand img { width: 64px; height: 36px; }
  .nav a { font-size: 14px; padding: 8px 9px; }
  .tool-head { padding: 10px 14px 8px; }
  .tool-head h1 { font-size: 20px; }
  .tool-head p { font-size: 14px; }
  .app { height: auto; min-height: 0; }
  .bar { gap: 6px 10px; padding: 8px; }
  .bar-group.end { margin-left: 0; }
  .work { grid-template-columns: 1fr; grid-template-rows: auto 60svh auto; }
  .tools { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; }
  .tool { flex: none; min-width: 70px; font-size: 12px; }
  .tool svg { width: 22px; height: 22px; }
  .props { border-left: 0; border-top: 1px solid var(--line); }
  .fonts { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 560px) {
  .tool-head p { display: none; }
  .field-inline { display: none; }
  .fonts { grid-template-columns: 1fr 1fr; }
  .content { padding-top: 28px; }
  .content h2 { font-size: 23px; }
  .row3 { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
