/* Tapestry workbench: home stage (dropzone + fullscreen + dock), scoped to this tool. */
.tc-tool{padding:0;background:none;border:0;box-shadow:none}
.tc-shell{padding:.85rem;background:#F8F4ED;border:1px solid #CFC3B3;border-radius:7px;box-shadow:0 14px 34px rgba(75,61,47,.1)}
.tc-tool .cg-stage{overflow:visible;border-color:#C8BBAA;border-radius:4px;background:#FCFAF6}
.tc-tool .cg-stage:not(.is-started) :is(.cg-stage-head,.cg-toolbar,.cg-quickbar,.cg-statusbar){display:none}
.tc-tool .cg-stage:not(.is-started) .cg-scroller,.tc-tool .cg-stage:not(.is-started) .cg-chart-canvas{visibility:hidden}
.tc-tool .cg-stage-head{padding:.32rem .55rem;gap:.45rem;border-radius:4px 4px 0 0;background:#FCFAF6;border-color:#D6CBBB}
.tc-tool .cg-board-title{min-width:0}
.tc-tool .cg-board-title span{flex:none}
.tc-tool .cg-stage-actions{gap:.32rem;flex-wrap:wrap}
.tc-tool .cg-stage-actions .ui-btn{display:inline-flex;align-items:center;gap:.28rem;min-height:34px;padding:.3rem .48rem;font-size:.65rem;white-space:nowrap}
.tc-tool .cg-stage-actions svg,.tc-tool .editor-expand-btn svg{flex:none}
.editor-expand-btn{white-space:nowrap}
.editor-expand-btn .collapse-icon{display:none}
.tc-shell.editor-expanded .editor-expand-btn .expand-icon{display:none}
.tc-shell.editor-expanded .editor-expand-btn .collapse-icon{display:block}
.tc-tool .cg-canvas.has-pattern{background-color:#F6F2EA;background-image:none}
.tc-tool .cg-stage:not(.is-editing) :is(.tc-toolbar-edit,.tc-edit-done,.cg-quickbar){display:none}
.tc-tool .cg-stage.is-editing .tc-toolbar-idle{display:none}
.tc-tool .cg-scroller[data-mode=preview]{cursor:default}
.tc-tool .cg-scroller[data-mode=preview].is-dragging{cursor:grabbing}
.tc-tool .cg-toolbar{border-top:1px solid #D6CBBB;border-bottom:0;background:#FCFAF6}
.tc-toolbar-idle{display:flex;align-items:center;gap:.65rem;flex:1;min-width:0}
.tc-idle-hint{font:500 .75rem/1.3 var(--ui-body);color:var(--ui-ink-soft);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tc-toolbar-edit{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem;flex:1;min-width:0}
.tc-tool .cg-stage #btnEditToggle{display:inline-flex;align-items:center;gap:.32rem;background:var(--ui-ink);border-color:var(--ui-ink);color:var(--ui-paper)}
.tc-tool .cg-stage #btnEditToggle:hover{background:#423C35;border-color:#423C35}
.tc-tool .cg-stage #btnEditDone{background:var(--ui-teal);border-color:#2FA58E;color:var(--ui-ink)}
.tc-tool .cg-stage #btnEditDone:hover{background:var(--ui-teal-hover)}
.tc-tool .cg-stage .cg-edit-modes [aria-pressed=true]{background:var(--ui-ink);border-color:var(--ui-ink);color:var(--ui-paper)}
.tc-tool .cg-stage .cg-pop[open]>summary{background:var(--ui-pink-selected);border-color:var(--ui-pink-d);color:var(--ui-ink)}
.tc-tool .cg-edit-modes button{display:inline-flex;align-items:center;justify-content:center;gap:.26rem;padding:.3rem .46rem;font-size:.64rem}
.tc-tool .cg-edit-modes svg{width:14px;height:14px;flex:none}
.tc-tool .cg-pop-body,.tc-tool .cg-toolbar .cg-tip>p{top:auto;bottom:calc(100% + 6px)}
.tc-tool .tc-view-pop .cg-pop-body{left:auto;right:0}
.tc-tool .cg-quickbar{background:#FCFAF6}
.tc-tool .cg-brush-chip{padding-left:.85rem}
.tc-tool .cg-statusbar{padding:.2rem .55rem;border-radius:0 0 4px 4px;background:#F8F4EC;font-size:.66rem}
.tc-tool .cg-stage .cg-zoom button{min-height:26px;min-width:28px;padding:.15rem .4rem;border-color:transparent;background:transparent;color:var(--ui-ink-soft)}
.tc-tool .cg-stage .cg-zoom button:hover:not(:disabled){background:#EFE9DE;border-color:#CFC3B3;color:var(--ui-ink);transform:none}
.tc-quick-label{font:600 .68rem/1.2 var(--ui-mono);color:var(--ui-ink-soft)}

/* ---------- Canvas toast ---------- */
.tc-toast{
  position:absolute;left:50%;top:12px;z-index:5;
  transform:translateX(-50%) translateY(-6px);
  display:inline-flex;align-items:center;gap:.55rem;max-width:calc(100% - 24px);
  padding:.42rem .8rem;border-radius:var(--ui-r-sm);
  background:var(--ui-ink);color:var(--ui-paper);border:1px solid rgba(255,253,248,.22);
  box-shadow:var(--ui-shadow-sm);font:700 .72rem/1.3 var(--ui-mono);
  opacity:0;pointer-events:none;transition:opacity .2s ease,transform .2s ease
}
.tc-toast.is-show{opacity:1;transform:translateX(-50%) translateY(0);pointer-events:auto}
.tc-toast[hidden]{display:none}
.tc-toast span{min-width:0;overflow-wrap:anywhere}
.tc-toast button{
  flex:none;min-height:24px;padding:.18rem .5rem;border:1px solid rgba(255,253,248,.45);
  border-radius:var(--ui-r-xs);background:rgba(255,253,248,.14);color:var(--ui-paper);
  font:800 .66rem/1 var(--ui-mono);text-transform:uppercase;letter-spacing:.04em;cursor:pointer
}
.tc-toast button:hover{background:var(--ui-pink);border-color:var(--ui-pink);color:var(--ui-ink)}
.tc-toast button:focus-visible{outline:var(--ui-focus);outline-offset:2px}

/* ---------- Starter dropzone inside canvas (matches homepage) ---------- */
.tc-dropzone{
  position:absolute;inset:12px;z-index:4;
  border:1px dashed var(--ui-line-strong);border-radius:var(--ui-r-sm);
  display:grid;place-items:center;text-align:center;
  background:rgba(255,253,248,.94);padding:1.15rem;overflow-y:auto;
  transition:border-color .2s,background .2s
}
.tc-dropzone.drag{border-color:var(--ui-flame);background:rgba(255,244,235,.96)}
.tc-dropzone[hidden]{display:none}
.tc-dz-expand{display:none}
.tc-tool:has(.cg-stage:not(.is-started)) :is(#tcCarryState,#startNewChart){display:none}
.tc-dropzone .dz-inner{max-width:560px;width:100%}
.tc-dropzone .dz-beads{display:flex;gap:7px;justify-content:center;margin-bottom:.8rem}
.tc-dropzone .dz-beads i{width:18px;height:18px;border:1px solid var(--ui-line-strong);border-radius:4px;animation:tcBob 2.4s ease-in-out infinite}
.tc-dropzone .dz-beads i:nth-child(1){background:var(--ui-flame)}
.tc-dropzone .dz-beads i:nth-child(2){background:var(--ui-sun);animation-delay:.15s}
.tc-dropzone .dz-beads i:nth-child(3){background:var(--ui-teal);animation-delay:.3s}
.tc-dropzone .dz-beads i:nth-child(4){background:var(--ui-sky);animation-delay:.45s}
.tc-dropzone .dz-beads i:nth-child(5){background:var(--ui-pink);animation-delay:.6s}
@keyframes tcBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)}}
.tc-dropzone .dz-title{margin:0;font-family:var(--ui-body);font-weight:700;font-size:clamp(1.35rem,2.2vw,1.65rem);letter-spacing:-.025em;color:var(--ui-ink)}
.tc-dropzone .dz-sub{color:var(--ui-ink-soft);font-size:.9rem;margin:.3rem 0 .95rem;line-height:1.45}
.tc-dropzone .starter-actions{display:flex;justify-content:center;gap:.6rem;flex-wrap:wrap}
.tc-dropzone .starter-actions .ui-btn{min-width:154px;min-height:46px;font-size:.76rem;padding:.55rem 1.05rem;border-radius:var(--ui-r-sm)}
.tc-dropzone .starter-actions .ui-btn--primary{background:var(--ui-pink);border-color:var(--ui-line);color:var(--ui-ink);box-shadow:var(--ui-shadow-xs)}
.tc-dropzone .starter-actions .ui-btn--primary:hover{background:var(--ui-pink-hover);box-shadow:var(--ui-shadow-sm)}
.tc-dropzone .starter-actions .ui-btn--ghost{background:var(--ui-card);border-color:var(--ui-line);color:var(--ui-ink)}
.tc-dropzone .starter-actions .ui-btn--ghost:hover{background:var(--ui-sun)}
.tc-dropzone .starter-proof{display:flex;justify-content:center;flex-wrap:wrap;gap:.35rem 1rem;margin:.95rem 0 0;padding:0;list-style:none;color:var(--ui-ink-soft);font-size:.74rem;font-weight:700}
.tc-dropzone .dz-samples{margin-top:.95rem;display:flex;flex-wrap:wrap;gap:.45rem;justify-content:center;align-items:center;font-size:.82rem;font-weight:700;color:var(--ui-ink-soft)}
.tc-dropzone .dz-samples span{flex:1 1 100%;margin-bottom:.1rem}
.tc-dropzone .dz-samples button{
  font-family:var(--ui-mono);font-weight:700;font-size:.7rem;line-height:1.25;
  background:var(--ui-card);color:var(--ui-ink);border:var(--ui-bd);border-radius:var(--ui-r-sm);
  padding:.34rem .68rem;min-height:32px;cursor:pointer;box-shadow:var(--ui-shadow-xs);
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease
}
.tc-dropzone .dz-samples button:hover{transform:translateY(-1px);border-color:var(--ui-line-strong);box-shadow:var(--ui-shadow-sm)}
.tc-dropzone .dz-samples button:focus-visible{outline:var(--ui-focus);outline-offset:2px}

/* ---------- Focused fullscreen editor view (matches homepage) ---------- */
body.editor-expanded{overflow:hidden}
.tc-shell.editor-expanded{
  position:fixed;inset:0;z-index:90;width:auto;max-width:none;margin:0;
  padding:max(.75rem,env(safe-area-inset-top)) max(.75rem,env(safe-area-inset-right))
    max(.75rem,env(safe-area-inset-bottom)) max(.75rem,env(safe-area-inset-left));
  overflow:hidden;border:0;border-radius:0;box-shadow:none;
  background-color:var(--ui-paper);
  background-image:linear-gradient(rgba(83,70,56,.045) 1px,transparent 1px),
    linear-gradient(90deg,rgba(83,70,56,.045) 1px,transparent 1px);
  background-size:16px 16px
}
.tc-shell.editor-expanded .cg-workspace{
  height:100%;grid-template-columns:minmax(0,1fr) minmax(270px,310px);
  grid-template-rows:minmax(0,1fr);align-items:stretch
}
.tc-shell.editor-expanded .cg-stage{display:flex;flex-direction:column;min-height:0;height:100%}
.tc-shell.editor-expanded .cg-canvas{height:auto!important;min-height:0;flex:1 1 auto}
.tc-shell.editor-expanded .cg-dock{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:4px;scrollbar-gutter:stable}

/* ---------- Dock ---------- */
.tc-tool .cg-dock{display:flex;gap:.45rem}
.tc-tool .cg-dock .ui-panel>summary{padding:.32rem .65rem;min-height:36px}
.tc-tool .cg-dock .ui-panel-body{padding:.48rem .65rem;gap:.28rem;position:relative}
.tc-tool #sizePanel summary em{font-size:.64rem;letter-spacing:-.02em;white-space:nowrap}
.tc-tool .cg-dock .ui-input,.tc-tool .cg-dock .ui-select{min-height:31px;padding-block:.15rem}
.tc-dock-draft{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.25rem .5rem;padding:.35rem .2rem 0;border-top:1px dashed #D6CBBB}
.tc-dock-draft .cg-note{margin:0;font-size:.74rem}
.tc-dock-draft .cg-text-button{font-size:.74rem}
.tc-photo-row{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem;margin-top:.35rem}
.tc-photo-row img{flex:none;width:36px;height:36px;object-fit:cover;border:1px solid var(--ui-line);border-radius:var(--ui-r-xs)}
.tc-inline{display:flex;align-items:center;gap:.4rem;font-size:.82rem}
.tc-inline .ui-select{width:auto;min-height:32px;padding-block:.2rem}
.tc-photo-row .ui-btn{min-height:32px}
.tc-dz-links{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:.25rem .65rem;margin-top:.6rem;font-size:.82rem}
.tc-dz-links .cg-tip{margin-left:0}
.tc-dz-links a{color:var(--ui-teal-link);font-weight:700}
#tcTemplatesSection{scroll-margin-top:86px}
.tc-section-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:.65rem 1.25rem;margin-bottom:1.25rem}
.tc-section-head h2{font-size:clamp(1.5rem,2.4vw,2.05rem);line-height:1.12;letter-spacing:-.025em;font-weight:700;margin:0 0 .55rem;text-wrap:balance}
.tc-section-head p{max-width:72ch;margin:0;color:var(--ui-ink-soft);font-size:.96rem;line-height:1.65}
.tc-browse-all{flex:none;white-space:nowrap;min-height:38px;align-self:flex-end}
.tc-template-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1rem}
.tc-template{display:flex;flex-direction:column;gap:.5rem;min-width:0;padding:.75rem;border:1px solid var(--ui-line);border-radius:var(--ui-r-sm);background:var(--ui-card);color:var(--ui-ink);box-shadow:var(--ui-shadow-xs)}
.tc-template:has(button[aria-pressed=true]){border-color:var(--ui-pink-d);box-shadow:0 0 0 2px var(--ui-pink-selected)}
.tc-thumb{display:flex;align-items:center;justify-content:center;height:160px;padding:8px;border-radius:var(--ui-r-xs);background:var(--ui-card-2);overflow:hidden}
.tc-thumb :is(img,canvas){display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;image-rendering:pixelated}
.tc-template h3{margin:0;font-size:1rem;line-height:1.25}
.tc-template small{color:var(--ui-ink-soft);font:.74rem/1.3 var(--ui-mono)}
.tc-template .ui-btn{align-self:flex-start;margin-top:auto}
@media(max-width:960px){.tc-template-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:500px){.tc-template-gallery{grid-template-columns:minmax(0,1fr)}}

/* ---------- Stage: one toolbar, warnings only when needed ---------- */
.tc-alert{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem .6rem;padding:.35rem .55rem;background:#FDECEA;border-bottom:1px solid #E7B8B1;font-size:.8rem}
.tc-alert-icon{flex:none;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:#C0392B;color:#fff;font:800 .72rem/1 var(--ui-mono)}
.tc-alert p{flex:1 1 200px;min-width:0;margin:0;color:#8f2a1f;font-weight:600}
.tc-alert-actions{display:flex;flex-wrap:wrap;gap:.35rem}
.cg-stage .tc-alert .ui-btn{min-height:30px;background:#fff;border-color:#D9A39B}
.tc-tool.is-dropping .cg-canvas{outline:3px dashed var(--ui-flame);outline-offset:-3px}

/* ---------- Dock controls ---------- */
.tc-seg{min-width:0;margin:0;padding:0;border:0}
.tc-seg legend{padding:0;margin-bottom:.12rem;font-size:.74rem;font-weight:600;color:var(--ui-ink)}
.tc-seg-options{display:grid;grid-template-columns:1fr 1fr;gap:2px;padding:2px;border:1px solid var(--ui-line);border-radius:var(--ui-r-sm);background:var(--ui-card-2)}
.tc-seg label{position:relative;display:flex;min-width:0}
.tc-seg input{position:absolute;opacity:0;width:1px;height:1px}
.tc-seg span{flex:1;display:flex;align-items:center;justify-content:center;min-height:26px;padding:.2rem .4rem;border-radius:var(--ui-r-xs);font-size:.8rem;font-weight:600;line-height:1.2;text-align:center;color:var(--ui-ink-soft);cursor:pointer;transition:background .15s,color .15s}
.tc-seg label:hover span{color:var(--ui-ink)}
.tc-seg input:checked+span{background:var(--ui-pink-selected);color:var(--ui-ink);box-shadow:inset 0 0 0 1px var(--ui-pink-d)}
.tc-seg input:focus-visible+span{outline:var(--ui-focus);outline-offset:1px}
.tc-limit-row{display:flex;align-items:center;gap:.5rem}
.tc-limit{flex:1;min-width:0;font-size:.82rem;font-weight:600}
.tc-limit-row .ui-select{width:auto;min-width:4.2rem}
.tc-terms-row .ui-select{min-width:6.6rem}
.tc-limit-row .cg-tip{margin-left:0}
.tc-carry-state{margin:-.2rem 0 0;font-size:.76rem;line-height:1.45;color:var(--ui-teal-link)}
.tc-carry-state.is-warn{color:#8f2a1f;font-weight:600}
.tc-carry-state:empty{display:none}
.tc-draft{display:flex;flex-wrap:wrap;align-items:center;gap:.3rem .6rem;padding-top:.25rem;border-top:1px dashed #D6CBBB}
.cg-dock .tc-draft .cg-note{flex:1 1 auto}
.tc-draft .cg-text-button{font-size:.78rem}

/* ---------- Pattern sheet card: Written rows + Yarn tabs ---------- */
.tc-sheet{
  margin-top:1rem;background:var(--ui-card);border:1px solid #CFC3B3;border-radius:7px;
  box-shadow:var(--ui-shadow-sm);overflow:visible;scroll-margin-top:86px
}
.tc-sheet-head{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.6rem 1rem;
  padding:.65rem 1rem;background:var(--ui-card-2);border-bottom:1px solid var(--ui-line);
  border-radius:6px 6px 0 0
}
.tc-sheet-tabs{display:inline-flex;gap:4px;padding:3px;border:1px solid var(--ui-line);border-radius:var(--ui-r-sm);background:var(--ui-paper)}
.tc-sheet-tabs button{
  display:inline-flex;align-items:center;gap:.35rem;min-height:34px;padding:.3rem .75rem;
  border:1px solid transparent;border-radius:var(--ui-r-xs);background:transparent;color:var(--ui-ink-soft);
  font:700 .8rem/1.2 var(--ui-body);cursor:pointer;transition:background .15s,color .15s,border-color .15s
}
.tc-sheet-tabs button:hover{color:var(--ui-ink)}
.tc-sheet-tabs button[aria-selected=true]{background:var(--ui-card);color:var(--ui-ink);border-color:var(--ui-line);box-shadow:var(--ui-shadow-xs)}
.tc-sheet-tabs em{font-style:normal;font:700 .68rem/1 var(--ui-mono);padding:.16rem .38rem;border-radius:999px;background:var(--ui-card-2);color:var(--ui-ink-soft)}
.tc-sheet-tabs button[aria-selected=true] em{background:var(--ui-pink-soft);color:var(--ui-ink)}
.tc-sheet-actions{display:flex;flex-wrap:wrap;align-items:center;gap:.45rem .6rem}
.tc-sheet-pane{padding:.9rem 1rem 1rem}
.tc-guide-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem .8rem;margin-bottom:.75rem}
.tc-filter-group{display:inline-flex;flex-wrap:wrap;gap:.35rem}
.tc-filter{
  display:inline-flex;align-items:center;gap:.3rem;min-height:30px;padding:.22rem .65rem;
  border:1px solid var(--ui-line);border-radius:999px;background:var(--ui-card);color:var(--ui-ink-soft);
  font:700 .72rem/1 var(--ui-mono);cursor:pointer;transition:background .15s,border-color .15s,color .15s
}
.tc-filter:hover{border-color:var(--ui-line-strong);color:var(--ui-ink)}
.tc-filter[aria-pressed=true]{background:var(--ui-pink-selected);border-color:var(--ui-pink-d);color:var(--ui-ink)}
.tc-filter em{font-style:normal;color:#8f2a1f}
.tc-guide-meta{display:flex;align-items:center;gap:.65rem}
.tc-guide-meta .cg-tip{margin-left:0}
.tc-foundation-box{
  padding:.6rem .8rem;margin-bottom:.75rem;border:1px solid var(--ui-paper-2);border-left:3px solid var(--ui-teal);
  border-radius:var(--ui-r-sm);background:#FAF6EE
}
.tc-foundation-box .cg-foundation{margin:0;font-size:.84rem;line-height:1.5;color:var(--ui-ink)}
.tc-foundation-box .cg-note{margin:.35rem 0 0;font-size:.78rem}
.tc-rows{list-style:none;margin:0;padding:0;border:1px solid var(--ui-line);border-radius:var(--ui-r-sm);overflow:hidden;background:var(--ui-card)}
.tc-rows li{
  display:grid;grid-template-columns:auto minmax(0,1fr);align-items:start;gap:.65rem;
  padding:.58rem .8rem;border-bottom:1px solid var(--ui-paper-2);background:var(--ui-card);
  transition:background .12s ease
}
.tc-rows li:last-child{border-bottom:0}
.tc-rows li:hover{background:#FCF9F2}
.tc-rows li[aria-current=true]{background:var(--ui-pink-soft);box-shadow:inset 3px 0 0 var(--ui-pink-d)}
.tc-rows li.is-over{box-shadow:inset 3px 0 0 #C0392B}
.tc-rows li[aria-current=true].is-over{box-shadow:inset 4px 0 0 #C0392B}
.tc-rows li.is-done{background:#F8F5EE}
.tc-rows li.is-done .tc-row-btn{opacity:.52}
.tc-rows li.is-done .tc-row-id{text-decoration:line-through}
.tc-rows input[type=checkbox]{width:18px;height:18px;margin:3px 0 0;accent-color:var(--ui-teal-link);cursor:pointer}
.tc-row-btn{
  display:grid;grid-template-columns:minmax(122px,auto) minmax(0,1fr) auto;align-items:center;gap:.45rem .8rem;
  width:100%;border:0;background:none;padding:0;text-align:left;color:inherit;font:inherit;cursor:pointer
}
.tc-row-head{display:flex;align-items:center;gap:.4rem;white-space:nowrap}
.tc-row-id{font:700 .8rem/1.2 var(--ui-mono);color:var(--ui-ink);font-variant-numeric:tabular-nums}
.tc-row-dir{
  display:inline-flex;align-items:center;padding:.14rem .42rem;border-radius:var(--ui-r-xs);
  border:1px solid #D9CFC0;background:var(--ui-card-2);color:var(--ui-ink-soft);
  font:700 .66rem/1 var(--ui-mono);letter-spacing:.02em
}
.tc-row-dir[data-side=ws]{background:#EEF3FA;border-color:#C5D3E8;color:#35527A}
.tc-row-runs{display:flex;flex-wrap:wrap;align-items:center;gap:.32rem}
.tc-run-chip{
  display:inline-flex;align-items:center;gap:.32rem;padding:.18rem .46rem;
  border:1px solid #DFD5C7;border-radius:var(--ui-r-xs);background:var(--ui-card);
  font-size:.78rem;line-height:1.25;color:var(--ui-ink)
}
.tc-rows li[aria-current=true] .tc-run-chip{border-color:#E5B7CE;background:#FFFDF9}
.tc-run-chip i{flex:none;width:12px;height:12px;border-radius:2px;border:1px solid rgba(0,0,0,.28)}
.tc-run-chip b{font:800 .76rem/1 var(--ui-mono);font-variant-numeric:tabular-nums}
.tc-run-chip span{color:var(--ui-ink-soft);font-size:.74rem}
.tc-row-meta{display:flex;align-items:center;gap:.35rem;white-space:nowrap}
.tc-sts{font:600 .68rem/1 var(--ui-mono);color:var(--ui-ink-soft)}
.tc-colors{display:inline-block;padding:.16rem .45rem;border-radius:999px;background:var(--ui-card-2);border:1px solid var(--ui-line);color:var(--ui-ink-soft);font:700 .68rem/1.1 var(--ui-mono);white-space:nowrap}
.is-over .tc-colors{background:#FDECEA;border-color:#C0392B;color:#8f2a1f}
.tc-rows-empty{margin:0;padding:1.25rem;text-align:center;color:var(--ui-ink-soft);font-size:.86rem;border:1px dashed var(--ui-line);border-radius:var(--ui-r-sm);background:var(--ui-card-2)}
.tc-sheet-more{display:flex;justify-content:center;padding-top:.75rem}
.tc-yarn-foot{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:1rem 1.5rem;margin-top:.9rem}
.tc-sheet .cg-counts :is(th,td):nth-child(n+3){text-align:right;font-variant-numeric:tabular-nums}
.tc-yarn-foot .cg-ball{flex:0 0 216px;width:216px;max-width:100%;margin-top:0}
.tc-yarn-foot .cg-ball-fields{grid-template-columns:minmax(120px,1fr) 76px}
.tc-yarn-estimate{flex:1 1 260px}
.tc-yarn-estimate .cg-note{margin:0}

/* ---------- Below-editor editorial rhythm & sections (P0 + P1) ---------- */
[data-page-route="tapestry-crochet-pattern-maker"] .cg-content{padding-block:clamp(2.2rem,5vw,3.4rem) 0;scroll-margin-top:86px}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-content+.cg-content{margin-top:clamp(2rem,4.5vw,3rem);border-top:1px solid var(--ui-paper-2)}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-content>h2{font-size:clamp(1.5rem,2.4vw,2.05rem);line-height:1.12;letter-spacing:-.025em;margin:0 0 .65rem}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-content>p{margin:0 0 1.25rem;font-size:.96rem;line-height:1.65}

/* Example showcase: clean before/after framing + Pattern Sheet chip rows */
#tcExample .cg-examples{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);align-items:stretch}
#tcExample .tc-example-fig{display:flex;flex-direction:column;gap:.85rem}
#tcExample .cg-example-pair{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1.35fr);align-items:stretch;gap:.75rem;flex:1 1 auto;min-height:0}
.tc-example-slot{display:flex;flex-direction:column;gap:.45rem;min-width:0;padding:.75rem;border:1px solid var(--ui-paper-2);border-radius:var(--ui-r-sm);background:var(--ui-card-2)}
.tc-example-tag{font:800 .66rem/1 var(--ui-mono);letter-spacing:.05em;text-transform:uppercase;color:var(--ui-ink-soft)}
.tc-example-slot img{width:100%;height:auto;max-height:300px;margin:auto 0;object-fit:contain;border-radius:3px}
.tc-example-arrow{align-self:center;font:700 1.2rem/1 var(--ui-mono);color:var(--ui-ink-soft)}
.tc-ex-palette{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem .85rem;padding:.55rem .75rem;border:1px solid var(--ui-paper-2);border-radius:var(--ui-r-sm);background:var(--ui-card-2)}
.tc-ex-palette-label{flex:1 0 100%;font:800 .64rem/1 var(--ui-mono);letter-spacing:.06em;text-transform:uppercase;color:var(--ui-ink-soft)}
.tc-ex-swatch{display:inline-flex;align-items:center;gap:.32rem;font-size:.78rem;font-weight:600;color:var(--ui-ink)}
.tc-ex-swatch i{width:13px;height:13px;border-radius:3px;border:1px solid rgba(0,0,0,.24);flex:none}
#tcExample .cg-examples figcaption.tc-example-cap{margin-top:auto;padding-top:.8rem;border-top:1px dashed var(--ui-line);display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.65rem 1rem}
.tc-example-cap-copy{min-width:0;flex:1 1 240px}
.tc-example-cap-copy strong{display:block;margin-bottom:.2rem;font-size:.96rem;color:var(--ui-ink)}
.tc-example-cap-copy span{display:block;font-size:.84rem;line-height:1.5;color:var(--ui-ink-soft)}
#tryExampleSection{margin-top:0;min-height:36px;flex:none}
#tcExample .cg-example-rows{display:flex;flex-direction:column;gap:1rem}
.tc-ex-group+.tc-ex-group{padding-top:.9rem;border-top:1px dashed var(--ui-line)}
.tc-ex-group h3{display:flex;align-items:baseline;justify-content:space-between;gap:.5rem;margin:0 0 .55rem;font-size:.92rem}
.tc-ex-group h3 span{flex:none;white-space:nowrap;font:700 .7rem/1 var(--ui-mono);color:var(--ui-ink-soft);text-transform:uppercase;letter-spacing:.03em}
.tc-ex-list{margin:0;padding:0;list-style:none;display:grid;gap:.45rem}
.tc-ex-list li{padding:.55rem .65rem;border:1px solid var(--ui-paper-2);border-radius:var(--ui-r-sm);background:var(--ui-card-2)}
.tc-ex-row-top{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;margin-bottom:.4rem}
.tc-ex-row-meta{margin-left:auto;font:600 .66rem/1 var(--ui-mono);color:var(--ui-ink-soft)}

/* Reading table & bag callout */
.tc-dir-line{display:flex;align-items:flex-start;gap:.45rem;line-height:1.45}
.tc-dir-line+.tc-dir-line{margin-top:.35rem}
.tc-dir-line .tc-row-dir{flex:none;margin-top:2px}
.tc-bag-callout{margin-top:1.15rem;padding:.9rem 1.1rem;border:1px solid var(--ui-line);border-left:4px solid var(--ui-teal);border-radius:var(--ui-r-sm);background:var(--ui-card);box-shadow:var(--ui-shadow-xs)}
.tc-bag-callout p{margin:0;max-width:none;font-size:.92rem;line-height:1.65;color:var(--ui-ink-soft)}
.tc-bag-callout strong{color:var(--ui-ink)}

/* Yarn planning: rounded card grid + eyebrows */
[data-page-route="tapestry-crochet-pattern-maker"] .cg-troubleshooting{border:1px solid var(--ui-line);border-radius:var(--ui-r);overflow:hidden;background:var(--ui-card);box-shadow:var(--ui-shadow-sm)}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-troubleshooting>div{padding:1.3rem 1.4rem;background:var(--ui-card);border-right:1px solid var(--ui-paper-2);border-bottom:1px solid var(--ui-paper-2)}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-troubleshooting>div:nth-child(even){border-right:0}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-troubleshooting>div:nth-last-child(-n+2){border-bottom:0}
.tc-card-eyebrow{display:inline-block;margin-bottom:.45rem;font:800 .66rem/1 var(--ui-mono);letter-spacing:.06em;text-transform:uppercase;color:var(--ui-teal-link)}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-troubleshooting dt{font-size:1.05rem;margin-bottom:.4rem}

/* FAQ: editorial 2-column split on desktop */
.tc-faq-layout{display:grid;grid-template-columns:minmax(240px,.4fr) minmax(0,1fr);gap:1.25rem 2.2rem;align-items:start}
.tc-faq-intro{position:sticky;top:88px}
.tc-faq-intro h2{font-size:clamp(1.5rem,2.4vw,2.05rem);line-height:1.12;letter-spacing:-.025em;font-weight:700;margin:0 0 .65rem;text-wrap:balance}
.tc-faq-intro p{margin:0;color:var(--ui-ink-soft);font-size:.93rem;line-height:1.6}
.tc-faq-section .ui-faq{max-width:none}

/* Related tools: 4-column desktop strip with arrow cue */
[data-page-route="tapestry-crochet-pattern-maker"] .cg-related{grid-template-columns:repeat(4,minmax(0,1fr));gap:.9rem}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-related a{display:flex;flex-direction:column;gap:.45rem;padding:1rem 1.05rem}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-related strong{display:flex;align-items:flex-start;justify-content:space-between;gap:.75rem;font-size:.94rem;line-height:1.3;color:var(--ui-teal-link)}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-related strong::after{content:"→";flex:none;font-family:var(--ui-mono);color:var(--ui-ink-soft);transition:transform .16s ease,color .16s ease}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-related a:hover strong::after{transform:translateX(3px);color:var(--ui-teal-link)}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-related span{margin-top:0;font-size:.83rem;line-height:1.5}

/* ---------- Export dialog (matches homepage #exportDialog) ---------- */
body.export-open{overflow:hidden}
#exportDialog{
  width:min(1080px,calc(100vw - 32px));max-width:1080px;
  height:min(760px,calc(100dvh - 32px));max-height:760px;
  padding:0;overflow:hidden;border:1px solid var(--ui-line-strong);border-radius:var(--ui-r);
  background:var(--ui-card);color:var(--ui-ink);box-shadow:var(--ui-shadow-card)
}
#exportDialog::backdrop{background:rgba(44,40,35,.52);backdrop-filter:blur(3px)}
.export-shell{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.export-head{display:flex;align-items:flex-start;gap:1rem;padding:.9rem 1.1rem;border-bottom:1px solid var(--ui-line);background:var(--ui-card-2)}
.export-head-copy{min-width:0}
.export-head #exportDialogTitle{display:block;margin:0;font-size:1.35rem;font-weight:700;line-height:1.15;letter-spacing:-.02em}
.tc-tool .cg-follow-head #followTitle{margin:0;font-size:1.25rem;font-weight:700;line-height:1.25}
.tc-tool .cg-crop .cg-preview-head #cropTitle{margin:0;font-size:1.05rem;font-weight:700;flex:1 1 calc(100% - 64px);order:0}
@media(min-width:601px){.tc-tool .cg-crop .cg-preview-head #cropTitle{flex:1}}
.export-head p{margin:.2rem 0 0;font-size:.78rem;color:var(--ui-ink-soft)}
.export-close{
  flex:none;margin-left:auto;width:36px;height:36px;display:grid;place-items:center;
  border:var(--ui-bd);border-radius:var(--ui-r-sm);background:var(--ui-card);color:var(--ui-ink);
  cursor:pointer;font:900 1.15rem/1 var(--ui-mono);box-shadow:var(--ui-shadow-xs)
}
.export-close:hover{background:var(--ui-pink)}
.export-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(300px,.85fr);min-height:0}
.export-preview-pane{
  min-width:0;min-height:0;display:flex;flex-direction:column;gap:.5rem;
  padding:.95rem;border-right:1px solid var(--ui-line);background:var(--ui-paper)
}
.export-preview-frame{
  position:relative;min-height:0;flex:1;overflow:hidden;display:flex;align-items:center;justify-content:center;
  padding:.75rem;border:var(--ui-bd);border-radius:var(--ui-r-sm);
  background:
    linear-gradient(45deg,#F0EAE1 25%,transparent 25%) 0 0/16px 16px,
    linear-gradient(45deg,transparent 75%,#F0EAE1 75%) 0 0/16px 16px,
    linear-gradient(45deg,transparent 75%,#F0EAE1 75%) 8px -8px/16px 16px,
    linear-gradient(45deg,#F0EAE1 25%,#FFF 25%) 8px -8px/16px 16px
}
#exportPreview{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;background:#fff;border:1px solid rgba(145,135,123,.7);box-shadow:var(--ui-shadow-sm)}
.export-preview-loading{
  position:absolute;inset:0;display:grid;place-items:center;background:rgba(255,253,248,.82);
  color:var(--ui-ink-soft);font:800 .72rem var(--ui-mono);text-transform:uppercase;letter-spacing:.04em
}
.export-preview-note{margin:0;font-size:.74rem;color:var(--ui-ink-soft)}
.export-controls{min-height:0;overflow-y:auto;padding:1rem;display:flex;flex-direction:column;gap:.9rem}
.export-section{display:flex;flex-direction:column;gap:.45rem}
.export-section-title{font:900 .7rem var(--ui-mono);text-transform:uppercase;letter-spacing:.06em;color:var(--ui-ink-soft)}
.export-controls .cg-note{margin:0;font-size:.76rem;color:var(--ui-ink-soft);line-height:1.45}
.tc-export-paper{display:flex;align-items:center;gap:.65rem}
.tc-export-paper .ui-select{flex:1;min-width:0}
.tc-export-paper output{flex:none;font:700 .76rem var(--ui-mono);color:var(--ui-ink-soft)}
.tc-export-summary{margin:0;padding:.55rem .65rem;border:1px solid var(--ui-line);border-radius:var(--ui-r-sm);background:var(--ui-card-2);font:600 .76rem/1.5 var(--ui-mono);color:var(--ui-ink)}
.tc-export-warn{margin:0;padding:.5rem .65rem;border:1px solid #E7B8B1;border-radius:var(--ui-r-sm);background:#FDECEA;color:#8f2a1f;font-size:.78rem;font-weight:600;line-height:1.4}
.export-status{margin:0;min-height:1.1rem;font:800 .72rem var(--ui-mono);color:var(--ui-teal-link)}
.export-privacy{margin:auto 0 0;display:flex;align-items:flex-start;gap:.45rem;font-size:.72rem;color:var(--ui-ink-soft);padding-top:.55rem;border-top:1px dashed var(--ui-line)}
.export-privacy::before{content:"◆";color:var(--ui-teal-link);font-family:var(--ui-mono)}
.export-actions{display:flex;align-items:center;gap:.6rem;padding:.8rem 1rem;border-top:1px solid var(--ui-line);background:var(--ui-card-2)}
.export-actions .export-action-spacer{flex:1}
.export-actions .ui-btn{min-width:155px}
.export-actions .ui-btn:first-child{min-width:0}

/* ---------- Blank chart dialog ---------- */
#blankDialog{
  width:min(420px,calc(100vw - 24px));padding:1rem;border:1px solid var(--ui-line-strong);
  border-radius:var(--ui-r);background:var(--ui-card);color:var(--ui-ink);box-shadow:var(--ui-shadow-card)
}
#blankDialog::backdrop{background:rgba(44,40,35,.48);backdrop-filter:blur(2px)}
.tc-blank-form{display:grid;gap:.8rem}
.tc-blank-head{display:flex;align-items:center;gap:.6rem}
.tc-blank-head #blankDialogTitle{margin:0;font-size:1.15rem;font-weight:700;letter-spacing:-.02em}
.tc-blank-presets{display:flex;flex-wrap:wrap;gap:.38rem}
.tc-blank-presets .ui-btn{flex:1 1 auto;padding:.34rem .55rem;font-size:.66rem}
.tc-blank-presets .ui-btn[aria-pressed=true]{background:var(--ui-pink-selected);border-color:var(--ui-pink-d)}
.tc-blank-actions{display:flex;justify-content:flex-end;gap:.5rem;padding-top:.2rem}

/* Keep the introduction intact without pushing the workbench below the fold. */
[data-page-route="tapestry-crochet-pattern-maker"] .cg-hero{padding-block:8px 12px}
[data-page-route="tapestry-crochet-pattern-maker"] .ui-crumb a{text-decoration:underline;text-underline-offset:3px}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-hero h1{font-size:clamp(1.8rem,3.1vw,2.6rem);line-height:1.14;margin:8px 0 11px}
[data-page-route="tapestry-crochet-pattern-maker"] .cg-hero>p{font-size:.93rem;line-height:1.45;max-width:105ch}

@media(min-width:1021px){
  /* Fit the full workbench (including bottom toolbar and statusbar) cleanly above the fold on 1280x800. */
  .tc-tool .cg-workspace{grid-template-rows:clamp(500px,calc(100svh - 186px),700px);align-items:stretch}
  .tc-tool .cg-stage{height:100%;min-height:0;display:flex;flex-direction:column}
  .tc-tool .cg-canvas{flex:1 1 auto;height:auto;min-height:280px}
  .tc-tool .cg-dock{contain:none;min-height:0;height:100%;overflow-y:auto;overscroll-behavior:contain;padding-right:3px;scrollbar-gutter:stable}
  .tc-tool .cg-dock .cg-tip>p{width:min(240px,calc(100% - 8px));right:0;left:auto}
  .tc-tool .tc-seg legend{position:absolute;width:1px;height:1px;min-height:0;padding:0;overflow:hidden;clip-path:inset(50%)}
}
@media(max-width:1020px){
  .tc-tool .cg-dock{order:2}
  .tc-tool .cg-stage-head{flex-wrap:wrap}
  .tc-tool .cg-stage:not(.is-started) .cg-canvas{height:auto;min-height:420px}
  .tc-shell.editor-expanded{overflow-y:auto;overscroll-behavior:contain}
  .tc-shell.editor-expanded .cg-workspace{height:auto;min-height:100%;grid-template-columns:minmax(0,1fr);grid-template-rows:auto;align-items:start}
  .tc-shell.editor-expanded .cg-stage{height:auto;min-height:0}
  .tc-shell.editor-expanded .cg-canvas{height:clamp(340px,56svh,560px)!important;min-height:340px;flex:none}
  .tc-shell.editor-expanded .cg-dock{min-height:0;overflow:visible;padding-right:0}
  #exportDialog{height:calc(100dvh - 20px);width:calc(100vw - 20px)}
  .export-layout{grid-template-columns:1fr;overflow-y:auto}
  .export-preview-pane{min-height:0;border-right:0;border-bottom:1px solid var(--ui-line)}
  .export-preview-frame{flex:none;padding:.55rem}
  #exportPreview{max-height:280px}
  .export-controls{overflow:visible}
}
@media(max-width:960px){
  .tc-faq-layout{grid-template-columns:1fr;gap:1rem}
  .tc-faq-intro{position:static}
  [data-page-route="tapestry-crochet-pattern-maker"] .cg-related{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:860px){#tcExample .cg-examples{grid-template-columns:1fr}}
@media(max-width:640px){
  #tcExample .cg-example-pair{grid-template-columns:1fr}
  .tc-example-arrow{justify-self:center;transform:rotate(90deg)}
  [data-page-route="tapestry-crochet-pattern-maker"] .cg-troubleshooting>div{border-right:0;border-bottom:1px solid var(--ui-paper-2)}
  [data-page-route="tapestry-crochet-pattern-maker"] .cg-troubleshooting>div:last-child{border-bottom:0}
  [data-page-route="tapestry-crochet-pattern-maker"] .cg-related{grid-template-columns:1fr}
}
@media(max-width:600px){
  .tc-tool{padding:0}
  .tc-shell{padding:.45rem}
  .tc-tool .cg-board-title{white-space:nowrap;flex-wrap:nowrap}
  .tc-tool .cg-stage-actions{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:.3rem}
  .tc-tool .cg-stage.is-started .cg-canvas{height:clamp(250px,34svh,360px)}
  .tc-tool .cg-stage:not(.is-started) .cg-canvas{height:auto;min-height:0}
  .tc-tool .cg-stage:not(.is-started) .tc-dropzone{position:static;margin:8px;display:flex;flex-direction:column;align-items:center;gap:.6rem;padding:.95rem .75rem 1rem;overflow:visible}
  .tc-dropzone{inset:8px;padding:.9rem .75rem}
  .tc-dropzone .starter-actions{display:grid;grid-template-columns:1fr;width:100%}
  .tc-dropzone .starter-actions .ui-btn{width:100%;min-width:0}
  .tc-dropzone .starter-proof{display:grid;gap:.25rem;text-align:left;justify-content:center}
  .tc-idle-hint{display:none}
  .tc-tool .cg-stage.is-editing .tc-toolbar-edit{display:contents}
  .tc-tool .cg-stage.is-editing .cg-toolbar .cg-tip{display:none}
  .tc-tool .tc-view-pop .cg-pop-body{left:.55rem;right:.55rem}
  .tc-tool .cg-stage .cg-zoom button{min-height:36px;min-width:36px}
  .tc-tool .cg-statusbar{gap:.18rem .5rem}
  .tc-tool .cg-edit-modes{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));flex:1 0 100%;width:100%;gap:.22rem}
  .tc-tool .cg-stage .cg-edit-modes button{flex-direction:column;gap:2px;height:46px;min-height:46px;min-width:0;white-space:nowrap;overflow:hidden;padding:.2rem .08rem;font-size:.52rem;letter-spacing:0}
  .tc-tool .cg-edit-modes svg{width:15px;height:15px}
  .tc-tool .cg-history button{height:44px}
  .tc-tool .cg-stage.is-editing .cg-toolbar .cg-pop{flex:1 1 0}
  .tc-tool .cg-stage.is-editing .cg-toolbar .cg-pop>summary{width:100%;justify-content:center}
  .tc-tool .cg-stage #btnEditDone{flex:1 0 100%;width:100%;margin-left:0}
  .tc-tool .cg-quickbar{gap:.4rem .5rem}
  .tc-tool .tc-quick-label{display:none}
  .tc-tool .cg-brush-chip{flex:1 1 auto;min-width:0;max-width:none}
  .tc-tool .cg-quickbar #jumpColors{flex:none}
  .tc-tool .cg-palette{flex:1 0 100%;order:3;width:100%;padding:2px 0}
  .tc-seg span{min-height:44px}
  .export-preview-pane{min-height:0;padding:.6rem}
  #exportPreview{max-height:210px}
  .export-controls{padding:.75rem;gap:.65rem}
  .export-actions{flex-wrap:wrap}
  .export-actions .export-action-spacer{display:none}
  .export-actions .ui-btn{flex:1 1 auto;min-width:0}
  .tc-sheet-head{padding:.6rem .7rem}
  .tc-sheet-pane{padding:.7rem}
  .tc-sheet-tabs{width:100%;display:grid;grid-template-columns:1fr 1fr}
  .tc-sheet-tabs button{justify-content:center;padding:.3rem .4rem;font-size:.74rem}
  .tc-sheet-actions{width:100%;justify-content:space-between}
  .tc-row-btn{grid-template-columns:minmax(0,1fr) auto;gap:.35rem .5rem}
  .tc-row-head{grid-column:1}
  .tc-row-meta{grid-column:2;grid-row:1}
  .tc-row-runs{grid-column:1/-1}
}
@media(max-width:400px){
  .tc-tool .cg-stage .cg-edit-modes button{padding:.2rem .05rem;font-size:.54rem}
}
@media print{.tc-shell{padding:0;border:0;box-shadow:none}.tc-alert,.tc-dropzone,.tc-toast,.editor-expand-btn,#exportDialog,#blankDialog{display:none!important}}
@media(prefers-reduced-motion:reduce){.tc-dropzone .dz-beads i,.tc-toast{transition:none;animation:none}}
