/* /weaving-pattern-generator/ page styles. Built from /assets/polyatic.css tokens only (no new colours or fonts).
   The draft canvas reads its grid and ink colours from the same tokens at draw time; yarn colours are the visitor's. */
.nojs{margin:1.25rem 0 0;padding:0.875rem 1rem;border:1px solid var(--line);border-left:0.25rem solid var(--accent);border-radius:0.625rem;background:var(--surface);color:var(--ink);font-size:0.9375rem;line-height:1.6}

.wv-head .sub{margin-bottom:0.75rem}
@media(max-width:519px){.wv-head h1{font-size:1.5rem;margin-bottom:0.125rem}.wv-head .sub{font-size:0.9375rem;line-height:1.4;margin-bottom:0.5rem}}

/* phone: size, draft, cloth, colours, save, numbers. Desktop: settings left, draft right. */
.wv-grid{display:flex;flex-direction:column;gap:0.75rem}
.wv-col{display:contents}
.wv-setup{order:1}.wv-draft{order:2}.wv-cloth{order:3}.wv-colours{order:4}.wv-out{order:5}.wv-numbers{order:6}
@media(min-width:920px){.wv-grid{display:grid;grid-template-columns:minmax(0,.72fr) minmax(0,1.28fr);gap:1.25rem;align-items:start}
  .wv-col{display:grid;gap:0.75rem;min-width:0;align-content:start}}
.wv-card{padding:0.75rem;min-width:0}
@media(min-width:520px){.wv-card{padding:1.125rem}}

.wv-k{display:block;font-family:var(--mono);font-size:0.6875rem;font-weight:500;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);margin:0 0 0.25rem}
.wv-h{margin:0.75rem 0 0.375rem}
.wv-f{display:block;min-width:0}
.wv-f input,.wv-f select{width:100%;box-sizing:border-box;min-width:0}
.wv-colours .wv-f+.wv-f{margin-top:0.5rem}
#warpText,#weftText,#ends,#picks,#floatMax{font-family:var(--mono)}
.wv-row{display:flex;flex-wrap:wrap;gap:0.5rem 0.625rem;align-items:flex-end}
.wv-row+.wv-row{margin-top:0.5rem}
.wv-sizes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0.5rem;margin-top:0.5rem}
.wv-num{width:6.5rem}
.wv-about{margin:0.5rem 0 0;font-size:0.8125rem;line-height:1.45;color:var(--ink-2)}
@media(max-width:519px){.wv-about{font-size:0.75rem;line-height:1.4}}
.wv-hint{color:var(--muted);font-size:0.8125rem;line-height:1.5;margin:0.5rem 0 0}
.wv-bad{color:var(--bad);font-weight:600}

.wv-toggles{margin-bottom:0.5rem}
.wv-modes{margin:0;flex:1 1 9rem;flex-wrap:nowrap}
.wv-modes button{padding:0.4375rem 0.25rem;min-width:0;font-size:0.8125rem;white-space:nowrap}
.wv-modes button:disabled{opacity:.45;cursor:default}

/* the draft: a canvas that scrolls inside its card when it is wider than the screen */
.wv-scroll{overflow:auto;max-height:78vh;-webkit-overflow-scrolling:touch;border-radius:0.375rem;background:var(--surface-2);padding:0.25rem}
.wv-canvas{display:block;touch-action:manipulation;cursor:pointer}
.wv-zoomrow{margin-top:0.375rem;flex-wrap:nowrap;align-items:flex-start}
.wv-small{height:2.25rem;min-width:2.5rem;padding:0 0.625rem;font-size:1rem;flex:none}
.wv-legend{margin:0;flex:1 1 auto;font-size:0.75rem}
.wv-convert{font-family:var(--mono);font-size:0.75rem;color:var(--ink-2)}

.wv-clothc{display:block;width:100%;height:auto;margin-top:0.625rem;border-radius:0.375rem;image-rendering:pixelated}
.wv-floatrow{margin-top:0.625rem;align-items:center}
.wv-floats{margin:0;flex:1 1 12rem;font-size:0.875rem;line-height:1.5;color:var(--ink-2)}
.wv-floats b{color:var(--ink)}
.wv-floats .wv-over{color:var(--bad);font-weight:600}

.wv-swatches{display:flex;flex-wrap:wrap;gap:0.3125rem}
.wv-sw{width:2rem;height:2rem;border-radius:0.375rem;border:1px solid var(--line-2);cursor:pointer;padding:0}
.wv-sw.on{outline:2px solid var(--accent);outline-offset:2px}

.wv-actions .btn{height:auto;min-height:2.75rem;padding:0.5rem 0.875rem}
.wv-file{position:relative;display:inline-flex;align-items:center;cursor:pointer}
.wv-file input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}
.wv-file:focus-within{outline:2px solid var(--accent);outline-offset:2px}

.wv-dl{margin:0;font-size:0.8125rem;line-height:1.5}
.wv-dl dt{font-weight:650;color:var(--ink);margin-top:0.5rem}
.wv-dl dt:first-child{margin-top:0}
.wv-dl dd{margin:0.125rem 0 0;font-family:var(--mono);font-size:0.75rem;color:var(--ink-2);overflow-wrap:anywhere}

.explainer .wv-list{color:var(--ink-2);font-size:0.9375rem;margin:0 0 0.75rem;padding-left:1.25rem}
.explainer .wv-cannot,.explainer .wv-src{color:var(--muted)}
.explainer .wv-list li{margin:0 0 0.5rem}

.modes button:focus-visible,.btn:focus-visible,.wv-sw:focus-visible,.wv-f input:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
