.home-page { --font-maker-gutter: clamp(12px, 1.7vw, 24px); padding: 0; background: #f7f8fa; }
.home-styles { padding: clamp(22px, 3vw, 46px) clamp(12px, 3vw, 48px) 0; background: #fff; }
.prebuilt-heading { margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid #e2e6ec; }
.prebuilt-heading h2 { margin: 0 0 4px; font-size: clamp(23px, 3vw, 36px); line-height: 1.2; letter-spacing: -.035em; }
.prebuilt-heading p { margin: 0; color: var(--muted); font-size: 14px; }

#font-maker {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: calc(100% - 2 * var(--font-maker-gutter));
  margin: var(--font-maker-gutter);
  color: var(--ink);
  scroll-margin-top: -12px;
}
#font-maker [hidden] { display: none; }
.fm-intro-card, .fm-workspace {
  padding: clamp(18px, 2.7vw, 38px) clamp(14px, 3vw, 48px);
  background: #fff;
  border: 1px solid #e2e6ec;
  border-radius: 16px;
}
.fm-workspace { display: flex; flex-direction: column; min-height: 600px; }
.fm-workspace > .fm-controls { margin-top: 0; }
.fm-header, .fm-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 16px;
}
.fm-header h2, .fm-editor-head h2 {
  margin: 0;
  letter-spacing: -.04em;
  line-height: 1.15;
}
.fm-header h2 { font-size: clamp(29px, 3.5vw, 49px); }
.fm-editor-head h2 { font-size: clamp(24px, 3vw, 32px); }
.fm-header p, .fm-editor-head p {
  margin: 6px 0 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.4;
}
.fm-header > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.fm-header > a:hover, .fm-rights a:hover { color: var(--red); }
.fm-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 22px;
  margin-top: clamp(15px, 2.6vw, 27px);
  align-items: end;
}
.fm-field label, .fm-progress label, .fm-brush label, .fm-edit-pick label {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}
.fm-field input, .fm-edit-pick select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  border: 1px solid #cbd0d8;
  border-radius: 8px;
  background: #fff;
}
.fm-progress { padding-bottom: 7px; }
.fm-progress progress {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 9px;
  border: 0;
  border-radius: 999px;
  appearance: none;
  accent-color: var(--red);
  background: #e0e3e8;
}
.fm-progress progress::-webkit-progress-bar { background: #e0e3e8; border-radius: 999px; }
.fm-progress progress::-webkit-progress-value { background: var(--red); border-radius: 999px; }
.fm-progress progress::-moz-progress-bar { background: var(--red); border-radius: 999px; }
#fm-grid-help {
  margin: 13px 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.fm-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: clamp(6px,1.1vw,14px);
  padding: 0;
  margin: 0;
}
.fm-step {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: clamp(5px,.8vw,13px);
  width: 100%;
  min-height: 60px;
  padding: 6px clamp(7px,1vw,14px);
  border: 1px solid #cbd0d8;
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}
.fm-step:hover, .fm-step[aria-pressed=true] { border-color: var(--red); background: #fff7f7; }
.fm-step-number {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #edf0f4;
  font-size: 13px;
  font-weight: 750;
}
.fm-step[aria-pressed=true] .fm-step-number { background: var(--red); color: #fff; }
.fm-step.is-complete .fm-step-number { background: #245b44; color: #fff; }
.fm-step-name { font-size: 14px; font-weight: 700; line-height: 1.18; }
.fm-step-name small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 500; }
.fm-step-count { color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fm-work-area { display: flex; flex: 1; flex-direction: column; margin-top: 14px; }
.fm-grid-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px 10px; margin-bottom: 7px; }
.fm-grid-heading h3 { margin: 0; font-size: clamp(14px,2vw,19px); line-height: 1.25; }
.fm-grid {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  grid-auto-rows: minmax(69px, 1fr);
  flex: 1;
  gap: 8px;
  min-height: min(30vh, 305px);
}
.fm-grid#fm-numbers { grid-template-columns: repeat(10,minmax(0,1fr)); }
.fm-grid#fm-symbols { grid-template-columns: repeat(16,minmax(0,1fr)); }
.fm-tile {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 30px;
  justify-items: center;
  min-width: 0;
  min-height: 58px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cbd0d8;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}
.fm-tile:hover { border-color: var(--red); }
.fm-tile.is-drawn { background: #fffafa; color: #9d0000; }
.fm-tile.is-drawn::after {
  position: absolute;
  top: 6px;
  right: 6px;
  color: #245b44;
  font: 750 13px/1 system-ui, sans-serif;
  content: "✓";
}
.fm-ink {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 30px;

}
.fm-ink canvas { width: min(100%, 72px); height: auto; max-height: 82px; aspect-ratio: 1; object-fit: contain; }
.fm-tile-label { display: grid; place-items: center; width: 100%; height: 30px; padding: 6px 0; border-top: 1px solid #e5e8ee; font: 700 13px/17px ui-monospace, Consolas, monospace; }
.fm-export {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #dde0e5;
}
.fm-export p, .fm-feedback p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
#fm-export-help { color: var(--ink); font-weight: 700; }
#fm-draft, .fm-export .fm-rights { margin-top: 3px; }
.fm-rights a { text-underline-offset: 2px; }
.fm-actions, .fm-modes, .fm-edit-actions, .fm-editor-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.fm-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  min-width: 44px;
  padding: 5px 11px;
  border: 1px solid #cbd0d8;
  border-radius: 8px;
  background: #fff;
  color: var(--charcoal);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
}
.fm-button:enabled:hover, .fm-button[aria-pressed=true] { color: #fff; background: var(--charcoal); border-color: var(--charcoal); }
.fm-primary { color: #fff; background: var(--red); border-color: var(--red); }
.fm-button:disabled { opacity: 1; color: #656c77; background: #eceef1; border-color: #dce0e5; }
.fm-feedback { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.fm-feedback:has(p:empty) .fm-reset:disabled { display: none; }
.fm-reset { padding: 3px 4px; border: 0; background: transparent; color: var(--muted); font-size: 12px; white-space: nowrap; }
.fm-reset:hover:enabled { color: var(--red); text-decoration: underline; }
.fm-dialog {
  width: min(560px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 26px);
  padding: clamp(12px, 2.4vw, 22px);
  overscroll-behavior: contain;
}
.fm-dialog::backdrop { background: #171b258c; }
html:has(.fm-dialog[open]) { overflow: hidden; }
.fm-editor-head h2 { overflow-wrap: anywhere; }
#fm-character { color: var(--red); }
.fm-close { padding: 0; font-size: 26px; font-weight: 400; }
.fm-editor-layout { display: block; margin-top: 12px; }
.fm-canvas-viewport {
  width: 100%;
  margin: 0 auto;
  aspect-ratio: 1;
  overflow: auto;
  border: 1px solid #cbd0d8;
  border-radius: 8px;
  background: #fbfcfd;
}
.fm-rule {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed #b7bdc7;
  pointer-events: none;
}
.fm-rule span { position: absolute; left: 4px; top: 2px; color: #5f6670; font-size: 10px; line-height: 1; }
.fm-cap { top: 11.67%; }
.fm-xheight { top: 30.83%; }
.fm-baseline { top: 77.08%; border-color: var(--red); }
.fm-baseline span { color: #9d0000; }
.fm-descender { top: 91.67%; }
.fm-artboard canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: none; }
.fm-artboard canvas:focus-visible { outline-offset: -3px; }
.fm-dialog[data-mode=edit] canvas { cursor: grab; }
.fm-dialog[data-mode=edit] canvas:active { cursor: grabbing; }
.fm-editor-tools { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 12px; min-width: 0; margin-top: 12px; padding: 12px; border: 1px solid #e1e5eb; border-radius: 9px; background: #f9fafb; }
.fm-modes { align-self: end; }
.fm-main-tool { display: grid; gap: 4px; min-width: 0; font-size: 12px; font-weight: 600; }
.fm-main-tool select { width: 100%; min-height: 44px; padding: 6px 8px; border: 1px solid #cbd0d8; border-radius: 7px; background: #fff; font-size: 13px; }
.fm-editor-tools > .fm-advanced { grid-column: 1 / -1; }
.fm-editor-tools > .fm-edit-actions { align-items: center; flex-wrap: nowrap; gap: 5px; }
.fm-editor-tools > .fm-edit-actions .fm-button { padding-inline: 7px; font-size: 12px; }
.fm-edit-actions .fm-button { flex: 1; min-width: 0; }
.fm-advanced { min-width: 0; border-top: 1px solid #e1e5eb; }
.fm-advanced > summary { min-height: 44px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.fm-advanced > summary::after { content: "+"; margin-left: auto; font-size: 18px; }
.fm-advanced[open] > summary::after { content: "−"; }
.fm-advanced-body { display: grid; gap: 10px; padding-bottom: 6px; }
.fm-precision-title { margin: 9px 0; font-size: 12px; font-weight: 700; }
.fm-modes .fm-button { flex: 1; }
.fm-dialog #fm-drawing-help { margin: 0; font-size: 12px; line-height: 1.4; }
.fm-brush {
  display: grid;
  grid-template-columns: auto minmax(62px, 1fr) 27px;
  min-width: 0;
  align-items: center;
  gap: 7px;
}
.fm-smoothing { grid-template-columns: auto minmax(62px, 1fr); }
.fm-brush label { margin: 0; white-space: nowrap; }
.fm-brush output { display: inline-block; min-width: 2ch; margin-left: 2px; font-variant-numeric: tabular-nums; }
.fm-brush input { width: 100%; margin: 0; min-height: 44px; accent-color: var(--red); }
.fm-brush-sample { display: grid; place-items: center; fill: var(--ink); }
.fm-editor-actions { justify-content: flex-end; margin-top: 14px; padding-top: 11px; border-top: 1px solid #e5e8ee; }
@media (max-width: 1080px) {
  .fm-grid, .fm-grid#fm-symbols { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .fm-header { flex-direction: column; gap: 0; }
  .fm-header p { font-size: 14px; }
  .fm-header > a { min-height: 41px; }
  .fm-controls { margin-top: 3px; }
  .fm-grid, .fm-grid#fm-numbers, .fm-grid#fm-symbols { grid-template-columns: repeat(6, minmax(0,1fr)); grid-auto-rows: minmax(59px,1fr); min-height: 0; gap: 5px; }
  .fm-steps { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .fm-step { min-height: 52px; }
  .fm-step-number { width: 23px; height: 23px; }
  .fm-step-name { font-size: 13px; }
  .fm-step-count { font-size: 11px; }
  .fm-editor-layout { grid-template-columns: 1fr; gap: 10px; margin-top: 8px; }
  .fm-editor-tools { gap: 8px; padding: 10px; }
  .fm-editor-actions { margin-top: 8px; padding-top: 7px; }
}
@media (max-width: 369px) {
  .fm-controls { grid-template-columns: 1fr; gap: 8px; }
  .fm-progress { padding-bottom: 0; }
  .fm-grid, .fm-grid#fm-numbers, .fm-grid#fm-symbols { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; }
  .fm-actions { gap: 5px; }
  .fm-actions .fm-button { padding-inline: 7px; font-size: 12px; }
}
#fm-pdf-progress { min-width: 3ch; font-variant-numeric: tabular-nums; }
/* Keep save actions visible while editor controls scroll on compact screens. */
.fm-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
.fm-editor-head, .fm-editor-actions { flex-shrink: 0; }
.fm-editor-layout { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1px 3px; }
@media(min-width:900px) {
  .fm-dialog { --fm-drawing-size: min(660px, calc(100dvh - 220px), calc(100vw - 440px)); width: calc(var(--fm-drawing-size) + 420px); padding:20px; }
  .fm-editor-layout { display: grid; grid-template-columns: var(--fm-drawing-size) minmax(0,1fr); gap: 20px; align-items: stretch; padding-inline:0; }
  .fm-canvas-viewport { width: 100%; height: var(--fm-drawing-size); }
  .fm-editor-tools { grid-template-columns: minmax(0,1fr); align-content:start; margin-top: 0; height:var(--fm-drawing-size); max-height:var(--fm-drawing-size); overflow-y:auto; }
  .fm-main-tool { display: flex; align-items: center; gap: 12px; }
  .fm-main-tool select { width: 0; flex: 1; }
}
@media(max-width:680px) {
  .fm-editor-actions { flex-wrap: nowrap; gap: 5px; }
  .fm-editor-actions .fm-button { min-width: 0; padding-inline: 8px; font-size: 12px; }
}
@media(max-width:680px) {
  .fm-editor-layout { display: block; }
  .fm-canvas-viewport { margin-bottom: 10px; }
}


.fm-header .fm-header-detail{font-size:13px;margin-top:4px}
.fm-quick-exports{display:flex;align-items:center;gap:7px;flex:none;align-self:flex-start}
.fm-quick-button{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-width:44px;min-height:44px;padding:8px;border:1px solid #d9dfe7;border-radius:9px;background:#fff;color:#353a40}
.fm-quick-button:enabled:hover{background:#eef1f5;border-color:#9ca5b2}
.fm-quick-button:disabled{opacity:1;color:#929aa6;background:#f7f8fa;cursor:default}
.fm-quick-button [data-pdf-progress]{font-size:11px;font-variant-numeric:tabular-nums}
.fm-quick-button{position:relative;display:grid;grid-template-columns:1fr;justify-items:center;gap:3px;min-width:48px;min-height:56px;padding:6px 8px;color:#3f4b5d;background:#fff;border-color:#d9dfe7;border-radius:10px}
.fm-quick-button svg{width:24px;height:24px;stroke-width:1.7}
.fm-format-label{font-size:11px;font-weight:750;line-height:1;letter-spacing:.04em}
.fm-quick-button:disabled{color:#7b8492;background:#f6f8fa}
.fm-quick-button:has([data-pdf-progress]:not([hidden])){grid-template-columns:auto 1fr}
.fm-quick-button [data-pdf-progress]{grid-row:1 / 3;align-self:center}
.fm-character-count{display:inline-flex;align-items:center;min-height:26px;padding:2px 8px;margin-left:12px;border:1px solid #e1e5eb;border-radius:6px;color:#626a76;font-size:14px;letter-spacing:0;font-weight:600;vertical-align:middle;font-variant-numeric:tabular-nums}
.fm-artboard{position:relative;width:calc(100% * var(--fm-zoom,1));aspect-ratio:1;overflow:hidden;background:#fbfcfd;touch-action:none}
.fm-canvas-viewport[data-guides=false] .fm-rule{display:none}
.fm-tool-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.fm-tool-fields label{display:flex;flex-direction:column;gap:3px;min-width:0;font-size:12px;font-weight:600}
.fm-tool-fields select,.fm-edit-pick select{min-height:40px;padding:6px 8px;border:1px solid #cbd0d8;border-radius:7px;background:#fff;width:100%;font-size:13px}
.fm-tool-fields label:only-child{grid-column:1/-1}
.fm-precision{border:1px solid #e1e5eb;border-radius:8px;padding:0 10px 8px;background:#f9fafb}
.fm-precision>summary{cursor:pointer;min-height:39px;display:flex;align-items:center;font-size:13px;font-weight:700}
.fm-precision>summary::after{content:"−";margin-left:auto}
.fm-precision:not([open])>summary::after{content:"+"}
.fm-view-options{display:flex;flex-wrap:wrap;gap:5px 12px;align-items:center;margin-top:8px;font-size:12px}
.fm-view-options label{display:flex;gap:5px;align-items:center;min-height:32px}
.fm-view-options input{accent-color:var(--red);width:15px;height:15px;margin:0}
#fm-coordinates{margin-left:auto;color:#626a76;font-variant-numeric:tabular-nums;white-space:nowrap;font-size:11px}
.fm-transform-actions{display:flex;flex-wrap:wrap;gap:5px;margin-top:5px}
.fm-transform-actions .fm-button{min-height:36px;font-size:11px;padding-inline:7px}
@media(max-width:680px){.fm-header{gap:8px}.fm-character-count{font-size:12px;margin-left:7px}.fm-grid,.fm-grid#fm-numbers,.fm-grid#fm-symbols{grid-auto-rows:minmax(70px,1fr)}}
@media(max-width:560px){.fm-editor-tools > .fm-brush,.fm-editor-tools > .fm-edit-actions{grid-column:1 / -1}}
@media(max-width:400px){.fm-editor-tools{grid-template-columns:minmax(0,1fr)}.fm-modes{flex-wrap:nowrap}.fm-main-tool{display:flex;align-items:center;gap:12px}.fm-main-tool select{width:0;flex:1}.fm-editor-head h2{font-size:24px}.fm-edit-actions{gap:5px}.fm-edit-actions .fm-button{font-size:12px;padding-inline:7px}}
@media(max-width:400px) {
  .fm-step{grid-template-columns:24px minmax(0,1fr);gap:2px 6px;padding:6px}
  .fm-step-number{grid-row:1 / span 2}
  .fm-step-name small{display:none}
  .fm-step-count{grid-column:2;text-align:left}
}

@media(min-width:1024px){.fm-header h2{font-size:clamp(30px,2.4vw,35px)}}
.fm-header h2{text-wrap:balance;font-weight:800}

@media(max-width:680px){.fm-workspace{min-height:0}.fm-intro-card{padding-block:22px}}

/* Dark introductory card, separate from the white drawing workspace. */
.fm-intro-card{background:#11151b;border-color:#252d38;color:#fff;align-items:center}
.fm-intro-card h2{color:#fff}
.fm-intro-card p{color:#d0d6df}
.fm-intro-card .fm-header-detail{color:#b7c0cc}
.fm-intro-card .fm-quick-exports{align-self:center}
.fm-intro-card .fm-quick-button{background:#202731;border-color:#3c4654;color:#edf1f7}
.fm-intro-card .fm-quick-button:disabled{background:#1a212a;border-color:#35404e;color:#b7c0cc}
.fm-intro-card .fm-quick-button:enabled:hover{background:#d30000;border-color:#d30000;color:#fff}
@media(max-width:680px){.fm-intro-card{align-items:flex-start}.fm-intro-card .fm-quick-exports{align-self:flex-start;margin-top:12px}}
