@font-face{font-family:GrenzeGotisch;src:url('./fonts/grenzegotisch.ttf');font-weight:100 900}
@font-face{font-family:UnifrakturMaguntia;src:url('./fonts/unifrakturmaguntia.ttf')}
@font-face{font-family:BricolageGrotesque;src:url('./fonts/bricolagegrotesque.ttf');font-weight:200 800}
@font-face{font-family:Limelight;src:url('./fonts/limelight.ttf')}
@font-face{font-family:PoiretOne;src:url('./fonts/poiretone.ttf')}
@font-face{font-family:JosefinSans;src:url('./fonts/josefinsans.ttf');font-weight:100 700}
@font-face{font-family:Archivo;src:url('./fonts/archivo.ttf');font-weight:100 900}
@font-face{font-family:RobotoSerif;src:url('./fonts/robotoserif.ttf');font-weight:100 900}
@font-face{font-family:Recursive;src:url('./fonts/recursive.ttf');font-weight:300 1000}
:root{color-scheme:light;--ink:#1a2420;--muted:#52625a;--line:#d7e0d8;--green:#174938;--accent:#c3f683;background:#eaf0e9;color:var(--ink);font-family:system-ui,sans-serif}
*{box-sizing:border-box}
body{margin:0}
button,input,select,textarea{font:inherit;color:inherit}
button,select{cursor:pointer;border:1px solid var(--line);background:#fff;border-radius:8px;padding:.6rem .8rem;font-size:.875rem}
button:hover,select:hover{border-color:var(--green)}
button:disabled{opacity:.6;cursor:wait}
:focus-visible{outline:2px solid #397856;outline-offset:3px}
.topbar{padding:1rem clamp(1rem,4vw,4rem);background:#f9fbf8;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:1rem}
.brand{display:flex;align-items:center;gap:.7rem;text-decoration:none;color:inherit;font-weight:750}
.mark{background:var(--green);color:var(--accent);width:2.1rem;height:2.1rem;display:grid;place-items:center;border-radius:7px;font-family:RobotoSerif,serif;font-size:1.4rem}
.actions{display:flex;flex-wrap:wrap;gap:.5rem}
.primary{background:var(--green);color:white;border-color:var(--green)}
main{max-width:1440px;margin:auto;padding:clamp(1rem,4vw,3.5rem)}
.project{display:grid;gap:.25rem;margin-bottom:1.4rem}
.project label,.specimen-foot,.specimen-head label{font-size:.875rem;color:var(--muted)}
#name{background:transparent;border:0;border-bottom:1px solid var(--line);width:min(100%,40rem);font-size:clamp(1.7rem,4vw,3rem);font-weight:650;letter-spacing:-.045em;padding:.15rem 0}
#status{font-size:.875rem;margin:0;color:var(--green);min-height:1.25rem}
.studio{display:grid;grid-template-columns:minmax(230px,285px) minmax(0,1fr);gap:1.1rem;align-items:start}
.panel,.specimen{background:#fbfdf9;border:1px solid var(--line);border-radius:14px}
.panel{padding:1.15rem;max-height:var(--panel-height,clamp(13rem,calc(100dvh - 13rem),48rem));overflow-y:auto;scrollbar-gutter:stable;overscroll-behavior-y:contain}
h2{font-size:.95rem;margin:0;font-weight:720}
.starters{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem;margin-top:.8rem}
.starter{min-width:0;text-align:left;display:flex;gap:.35rem;align-items:center;padding:.45rem .65rem}
.starter[aria-pressed=true]{background:#e3f3d7;border-color:#6a9361;font-weight:650}
.tile{min-width:1.9rem;font-size:1.22rem;font-weight:500}
.divider{border-top:1px solid var(--line);margin:1.2rem 0 1rem}
.section-head,.control label,.specimen-head,.specimen-foot{display:flex;align-items:center;justify-content:space-between;gap:.75rem}
.quiet{padding:.2rem .35rem;background:transparent;border-color:transparent;color:var(--green)}
.control{margin-top:1rem}
.control label{font-size:.875rem}
.control output,#size-value{color:var(--muted);font-variant-numeric:tabular-nums}
input[type=range]{accent-color:var(--green);width:100%;margin:.45rem 0 0;cursor:pointer}
.specimen-head,.specimen-foot{padding:.9rem 1.2rem}
.specimen-head{border-bottom:1px solid var(--line);flex-wrap:wrap}
.specimen-head label{margin-left:auto}
#size{width:clamp(4rem,13vw,9rem);margin:0}
#sample{display:block;width:min(100%,var(--specimen-column-width,100%));margin-inline:auto;min-height:18rem;resize:vertical;line-height:var(--specimen-line-height,1.09);background:#fff;color:#17231d;border:0;padding:clamp(1rem,4vw,2.75rem);font-optical-sizing:none}
#sample:focus-visible{outline-offset:-3px}
.specimen-foot{border-block:1px solid var(--line);flex-wrap:wrap}
#alphabet{font-optical-sizing:none;padding:1.1rem clamp(1rem,4vw,2.75rem);font-size:clamp(1rem,2.7vw,1.6rem);overflow-wrap:anywhere;line-height:1.45}
@media(max-width:670px){.studio{grid-template-columns:1fr}.panel{padding:.9rem;max-height:19rem;overscroll-behavior-y:auto}#sample{min-height:15rem}}

.panel h3{font-size:.875rem;margin:1rem 0 -.25rem;color:var(--muted)}
.specimen-options{display:flex;flex-wrap:wrap;gap:.4rem;background:#fff;padding:.75rem 1.2rem 0}
.specimen-options button{background:#f5f8f3;padding:.4rem .65rem}

.compare-tools{display:flex;align-items:center;flex-wrap:wrap;gap:.5rem;background:#fff;padding:.75rem 1.2rem 0;font-size:.875rem}
.compare-tools button[aria-pressed=true]{background:#e3f3d7;border-color:#6a9361}
#comparison{border-bottom:1px solid var(--line);padding:1rem 1.2rem}
.comparison-pair:not([hidden]){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.comparison-pair>div{min-width:0}
.comparison-pair h3,.compare-legend{margin:0 0 .5rem;font-size:.875rem;font-weight:600}
.comparison-text{white-space:pre-wrap;overflow-wrap:anywhere}
.comparison-text,#overlay-text{font-size:var(--compare-size);line-height:var(--compare-line-height,1.15);font-optical-sizing:none}
.starter-ink{font-family:var(--starter-font);font-variation-settings:var(--starter-axes)}
.edited-ink{font-family:var(--edited-font);font-variation-settings:var(--edited-axes)}
.comparison-text.edited-ink{letter-spacing:var(--edited-spacing)}
.compare-legend{display:flex;gap:1rem}
.compare-legend span:first-child{color:#39658c}
.overlay-line{display:flex;flex-wrap:wrap;min-height:1.15em}
.overlay-cell{display:inline-grid;align-items:baseline;grid-template-columns:minmax(.38em,max-content);white-space:pre}
.overlay-cell span{grid-area:1/1}
.overlay-cell .starter-ink{color:#4a84af;opacity:.57}
.overlay-cell .edited-ink{opacity:.82}
#historical{grid-template-columns:1fr}
@media(max-width:540px){.comparison-pair:not([hidden]){grid-template-columns:1fr}}

dialog{width:min(35rem,calc(100% - 2rem));max-height:calc(100% - 2rem);border:1px solid var(--line);border-radius:14px;background:#fbfdf9;color:var(--ink);padding:1.25rem}
dialog::backdrop{background:#12282080}
dialog form{display:grid;gap:.65rem}
dialog h2{font-size:1.2rem;margin-bottom:.25rem}
dialog label,dialog p{font-size:.875rem}
dialog p{margin:0;color:var(--muted)}
dialog textarea,dialog input[type=number]{width:100%;border:1px solid var(--line);border-radius:8px;padding:.5rem;background:#fff}
dialog textarea{resize:vertical}
#subset-fields:not([hidden]){display:grid;gap:.55rem;justify-items:start}
.dialog-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:.5rem;margin-top:.35rem}
.png-settings{display:grid;grid-template-columns:repeat(auto-fit,minmax(8rem,1fr));gap:.65rem}
.png-settings label{display:grid;gap:.3rem;align-content:start}
.png-settings input[type=color]{width:100%;min-height:2.2rem;border:1px solid var(--line);border-radius:8px;background:#fff;padding:.15rem;cursor:pointer}
.png-settings input:disabled{opacity:.45;cursor:default}
.checkbox-field{display:flex;align-items:center;gap:.4rem}
.png-preview{overflow:auto;max-height:16rem;border:1px solid var(--line);border-radius:8px;background:repeating-conic-gradient(#e3eae3 0% 25%,#fff 0% 50%) 0 / 16px 16px}
.png-preview canvas{display:block;max-width:100%;height:auto;margin-inline:auto}
#png-status:empty{display:none}
.specimen-options #png-open{margin-left:auto;background:var(--green);color:#fff;border-color:var(--green)}

@media (min-width:671px) and (min-height:600px){
  main{padding-bottom:.75rem}
  .studio{height:var(--panel-height,calc(100dvh - 13rem))}
  .specimen{max-height:100%;overflow-y:auto;scrollbar-gutter:stable}
}

.specimen-layout{display:flex;align-items:center;flex-wrap:wrap;gap:.45rem .65rem;background:#fff;padding:.75rem 1.2rem 0;font-size:.875rem}
.specimen-layout input,.kerning-editor input[type=text]{border:1px solid var(--line);border-radius:8px;background:#fff;padding:.4rem .5rem}
.specimen-layout input{width:5.6rem}
#sample,.comparison-text,#kerning-preview{font-kerning:normal}
.comparison-text{max-width:var(--specimen-column-width,100%)}
.digit-control,.kerning-editor{margin-top:1rem;font-size:.875rem}
.kerning-editor summary{cursor:pointer;font-weight:650}
#kerning-controls{display:grid;gap:.4rem;margin-top:.65rem}
#kerning-controls p{font-size:.8rem;line-height:1.35;color:var(--muted);margin:0}
#kerning-preview{justify-self:start;font-optical-sizing:none;font-size:2.3rem;line-height:1.12}
#kerning-list{list-style:none;padding:0;margin:.5rem 0 0;display:grid;gap:.35rem}
#kerning-list li{display:flex;justify-content:space-between;gap:.35rem}
#kerning-list button{padding:.35rem .5rem}

.help-link{display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:8px;padding:.6rem .8rem;background:#fff;color:var(--green);font-size:.875rem;text-decoration:none}
.help-link:hover{border-color:var(--green)}
.help-page{max-width:52rem;padding-bottom:3rem;line-height:1.6}
.help-page h1{font-size:clamp(1.9rem,5vw,3rem);line-height:1.15;margin:0 0 .65rem;letter-spacing:-.035em}
.help-page h2{font-size:1.2rem}
.help-page nav{display:flex;flex-wrap:wrap;gap:.5rem 1rem;margin:1.25rem 0}
.help-page nav a{color:var(--green);text-underline-offset:.18em}
.help-page section{border-top:1px solid var(--line);padding:1rem 0;scroll-margin-top:1rem}
.help-page p,.help-page ol{margin:.6rem 0}
.help-page ol{padding-inline-start:1.45rem}
.help-page li+li{margin-top:.4rem}

.auto-hint{align-self:center;font-size:.875rem;padding:.45rem .25rem}

#glyph-dialog{width:min(62rem,calc(100% - 2rem))}
.glyph-heading{display:flex;justify-content:space-between;align-items:center;gap:1rem}
#glyph-form,#glyph-reference-form{display:flex;align-items:center;flex-wrap:wrap;margin:.6rem 0}
#glyph-character,#glyph-reference-character{width:3.5rem;padding:.4rem;border:1px solid var(--line);border-radius:8px;background:white;text-align:center}
#glyph-viewport{height:min(49dvh,28rem);min-width:0;overflow:auto;background:#fff;border:1px solid var(--line);border-radius:8px}
#glyph-stage{display:flex;align-items:center;justify-content:center;width:100%;height:100%}
#glyph-canvas:not([hidden]){display:block;width:100%;height:100%;flex:none;touch-action:none}
#glyph-guides{stroke:#9ca9a1;stroke-dasharray:5 4;fill:none}
#glyph-guides path,#glyph-handles,#glyph-starter-path,#glyph-reference-path,#glyph-edited-path,#glyph-points>*{vector-effect:non-scaling-stroke}
#glyph-starter-path{fill:#83b8e344;stroke:#527d9f;stroke-width:1.6;stroke-dasharray:4 3}
#glyph-reference-path{fill:none;stroke:#8554ae;stroke-width:2;stroke-dasharray:4 3;pointer-events:none}
#glyph-reference-status{color:#704199}
#glyph-reference-status:empty{display:none}
#glyph-edited-path{fill:#17493830;stroke:var(--green);stroke-width:1.5}
#glyph-handles{fill:none;stroke:#79775e;stroke-dasharray:3 3;opacity:.65}
#glyph-points[hidden]{display:none}
#glyph-points>*{fill:#fff;stroke:var(--green);stroke-width:1.5;cursor:grab}
#glyph-points>rect{fill:#f1cb78;stroke:#795300}
#glyph-points>*:focus,#glyph-points>*:hover{fill:#c3f683;stroke:#102d26;stroke-width:2;outline:none}
#glyph-status:not(:empty){margin:.45rem 0}

#glyph-edited-list:not([hidden]){display:flex;flex-wrap:wrap;gap:.35rem;margin:.5rem 0}
#glyph-edited-list button{padding:.3rem .55rem}

.remixes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.45rem;margin-top:.7rem}
.remixes button{background:#e7f2dd;text-align:left}
#slashed-zero-control[hidden]{display:none}

.glyph-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(14rem,18rem);align-items:start;gap:.9rem}
.glyph-donor-panel{padding:.65rem;border:1px solid var(--line);border-radius:8px;background:#f2f6ef}
.glyph-donor-panel h3{font-size:.9rem;margin:0 0 .5rem}
#glyph-donor-status:not(:empty){margin-bottom:.5rem}
#glyph-donors{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.4rem}
.donor-tile{display:grid;place-items:center;align-content:center;gap:.15rem;min-height:4.65rem;padding:.3rem;text-align:center;line-height:1.12;font-size:.78rem;color:var(--ink)}
.donor-tile svg{display:block;width:100%;height:2.45rem;fill:currentColor}
.donor-tile[aria-pressed=true]{background:#e0f1d1;border-color:#589150;color:#164831}
.donor-tile:disabled{cursor:default}
#glyph-restore-base{margin-top:.55rem}
@media(max-width:710px){.glyph-workspace{grid-template-columns:1fr}#glyph-donors{grid-template-columns:repeat(3,minmax(0,1fr))}}

#glyph-points>*[aria-pressed=true]{fill:#a6df73;stroke:#214f34;stroke-width:2}
#glyph-points>*[aria-pressed=true]:focus{stroke:#102d26;stroke-width:2.7}
#glyph-selection-box{fill:#94c96a3d;stroke:#397856;stroke-dasharray:4 3;vector-effect:non-scaling-stroke;pointer-events:none}
#glyph-canvas[hidden],#glyph-selection-box[hidden],#glyph-selection-status:empty{display:none}
#glyph-selection-status:not(:empty){margin:.4rem 0}

.glyph-tools{display:flex;align-items:center;flex-wrap:wrap;gap:.35rem .5rem;margin:.55rem 0;font-size:.875rem}
.glyph-tools button{padding:.4rem .6rem}
.glyph-tools button:disabled{cursor:default}
#glyph-zoom-value{min-width:3rem;color:var(--muted);font-variant-numeric:tabular-nums}
#glyph-add-node[aria-pressed=true],#glyph-convert-curve[aria-pressed=true]{background:#e0f1d1;border-color:#589150}
#glyph-grid[hidden]{display:none}
#glyph-grid,#glyph-guides{pointer-events:none}
#glyph-grid-lines{fill:none;stroke:#d8e5da;stroke-width:1}
#glyph-canvas.adding-node,#glyph-canvas.adding-node #glyph-points>*{cursor:crosshair}
