/* Colour tool styles shared by the internal tool (/patterns/) and the public Pick Your Colors (/site/tools/), split out of site.css 2026-10-09. */
/* ---- color tool ---- */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 2rem; align-items: start; }
.tool-quilt { position: sticky; top: 1rem; }
.tool-quilt svg { width: 100%; height: auto; max-height: 82vh; display: block; }
.tool-quilt svg polygon { cursor: pointer; }
.tool-quilt svg.zoomed polygon { cursor: grab; }
.zoom { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.5rem; font-size: 0.85rem; flex-wrap: wrap; }
.zoom button { font: inherit; font-weight: 700; min-width: 36px; height: 36px; border: 1.5px solid var(--border); background: var(--background); border-radius: var(--radius); cursor: pointer; padding: 0 0.6rem; }
.zoom #zoom-level { min-width: 2.5em; text-align: center; font-weight: 600; }
.zoom .hint { flex-basis: 100%; }
.tool-quilt svg:not(.sewn) #base polygon:hover { opacity: 0.85; }
.tool-panel { display: flex; flex-direction: column; gap: 1.25rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.fabrics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.fabric { display: grid; grid-template-columns: 44px 1.2rem 1fr; gap: 0.75rem; align-items: center; padding: 0.4rem 0.5rem; border: 1.5px solid var(--border);
          border-radius: var(--radius); cursor: pointer; background: var(--background); text-align: left; font: inherit; width: 100%; }
.fabric.active { border-color: var(--action); background: var(--muted); }
.fabric .chip { width: 44px; height: 34px; border-radius: 4px; border: 1px solid rgba(0,0,0,0.15); }
.fabric .letter { font-weight: 700; }
.fabric .role { font-size: 0.85rem; }
.fabric .chosen { font-size: 0.85rem; font-weight: 600; }
.library { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.6rem; }
.tab { font: inherit; font-size: 0.8rem; font-weight: 600; padding: 0.3rem 0.6rem; border-radius: 999px; border: 1.5px solid var(--border); background: var(--background); cursor: pointer; }
.tab.active { background: var(--action); color: var(--action-fg); border-color: var(--action); }
.search { width: 100%; font: inherit; padding: 0.45rem 0.6rem; border: 1.5px solid var(--border); border-radius: var(--radius); margin-bottom: 0.6rem; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 4px; max-height: 300px; overflow: auto; }
.swatch { aspect-ratio: 1; border-radius: 4px; border: 1px solid rgba(0,0,0,0.12); cursor: pointer; padding: 0; }
.swatch:hover, .swatch:focus-visible { outline: 2px solid var(--action); outline-offset: 1px; }
.swatch.selected { outline: 3px solid var(--action); outline-offset: 1px; }
.custom { display: flex; gap: 0.5rem; align-items: center; }
.custom input[type=text] { font: inherit; padding: 0.4rem; border: 1.5px solid var(--border); border-radius: var(--radius); width: 7rem; }
.custom input[type=color] { width: 44px; height: 36px; border: 1px solid var(--border); border-radius: 4px; padding: 2px; background: none; }
.scale { margin-top: 0.6rem; font-size: 0.9rem; }
.scale label { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.scale input { flex: 1; }
.scale .small { font-weight: 400; font-size: 0.8rem; }
.tabs .tab.print { border-style: dashed; }
.nearest { font-size: 0.85rem; margin-top: 0.5rem; }
.nearest button { font: inherit; font-size: 0.85rem; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.req { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.req th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1.5px solid var(--foreground); padding: 0.3rem 0.4rem; }
.req td { padding: 0.35rem 0.4rem; border-bottom: 1px solid var(--border); }
.req .chip { display: inline-block; width: 1.2rem; height: 1rem; border-radius: 3px; border: 1px solid rgba(0,0,0,0.15); vertical-align: middle; margin-right: 0.4rem; }
.toggle { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 40px; font-weight: 600; }
.status { font-size: 0.85rem; min-height: 1.2em; }

/* ---- sizes ---- */
.sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.4rem; }
.size { display: grid; gap: 0.1rem; padding: 0.5rem 0.6rem; border: 1.5px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--background); }
.size.active { border-color: var(--action); background: var(--muted); }
.size input { position: absolute; opacity: 0; width: 0; height: 0; }
.size-name { font-weight: 700; }
.size-dims { font-size: 0.9rem; font-weight: 600; }
.size-blocks { font-size: 0.78rem; }
.sizes .small { grid-column: 1 / -1; margin: 0.2rem 0 0; }

/* ---- saved colorways ---- */
.savebar { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.75rem; }
.savebar input { font: inherit; padding: 0.5rem 0.6rem; border: 1.5px solid var(--border); border-radius: var(--radius); min-width: 0; }
.savebar .btn { grid-column: 1 / -1; justify-content: center; }
.saved { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.saved-card { display: grid; grid-template-columns: 96px 1fr; gap: 0.75rem; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem; }
.saved-card .thumb { padding: 0; border: 1px solid var(--border); border-radius: 4px; background: var(--background); cursor: pointer; overflow: hidden; }
.saved-card .thumb svg { display: block; width: 100%; height: auto; }
.saved-name { font-weight: 700; }
.acts { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-top: 0.25rem; }
.acts button { font: inherit; font-size: 0.85rem; font-weight: 600; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; color: var(--action); }
.small { font-size: 0.85rem; }
.pattern-card .sizes-line { font-size: 0.85rem; }

@media (max-width: 860px) {
  .tool { grid-template-columns: 1fr; }
  .tool-quilt { position: static; }
  .tool-quilt svg { max-height: 60vh; }
}
[hidden] { display: none !important; }

/* quilting overlay picker (2026-10-05): same look as the size and fabric buttons */
.quilting .qopts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }   /* 8 options = 4 x 2, no orphan (2026-10-09; a hidden old style shown for an old link makes 9: one short row, accepted) */
.qopt { --qbg: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.45rem 0.35rem 0.5rem;
  border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--background); color: var(--foreground);
  font: inherit; font-size: 0.8rem; line-height: 1.2; cursor: pointer; text-align: center; }
.qopt svg { width: 100%; max-width: 3.4rem; aspect-ratio: 1; border-radius: 3px; }
.qopt.active { --qbg: var(--background); border-color: var(--action); background: var(--muted); }
.qthreads { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.qthread { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0 0.75rem; border: 1.5px solid var(--border);
  border-radius: var(--radius); background: var(--background); font: inherit; font-size: 0.85rem; cursor: pointer; color: var(--foreground); }
.qthread .chip { width: 1rem; height: 1rem; border-radius: 50%; border: 1px solid rgba(0, 0, 0, 0.25); }
.qthread.active { border-color: var(--action); background: var(--muted); }

/* ---- colour tool, one screen (2026-10-09, Mom call: no scrolling up and down) ---- */
.tool-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; margin-bottom: 0.75rem; }
.tool-head h1 { margin: 0; font-size: clamp(1.6rem, 2.4vw, 2.2rem); }
.tool-head p { margin: 0; }
main:has(.tool-app) { padding-top: 1rem; padding-bottom: 1rem; }
body:has(.tool-app) .site-footer { display: none; }   /* placeholder footer: the tool fills the screen */
.tool-app { grid-template-columns: minmax(0, 1fr) minmax(440px, 540px); gap: 1.5rem; height: calc(100dvh - 9rem); min-height: 560px; align-items: stretch; }
.tool-app .tool-quilt { position: relative; top: 0; display: flex; flex-direction: column; min-height: 0; }
.tool-app .tool-quilt svg { flex: 1; min-height: 0; max-height: none; height: 100%; }
.tool-app .tool-panel { display: flex; flex-direction: column; gap: 0.6rem; min-height: 0; }
.cw-bar { display: grid; gap: 0.5rem; padding-bottom: 0.6rem; border-bottom: 1.5px solid var(--border); }
.cw-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; }
.cw-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.cw-name { font-weight: 700; font-size: 1.1rem; }
.cw-state { font-size: 0.85rem; font-weight: 600; }
.cw-state.is-dirty::before { content: ''; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #c2410c; margin-right: 0.35rem; vertical-align: 0.05rem; }
.cw-acts { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cw-acts .count { font-weight: 600; }
.btn:disabled { opacity: 1; cursor: default; background: var(--muted); color: var(--foreground); border-color: var(--border); }
.cw-bar .savebar { grid-template-columns: 1fr 1fr auto auto; margin: 0; }
.cw-bar .savebar .btn { grid-column: auto; }
.cw-bar .status:empty { display: none; }
.ptabs { display: flex; gap: 0.25rem; border-bottom: 1.5px solid var(--border); }
.ptab { font: inherit; font-weight: 600; padding: 0.5rem 0.8rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1.5px; background: none; cursor: pointer; color: var(--foreground); min-height: 40px; }
.ptab.active { border-bottom-color: var(--action); }
.ppane { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 1rem; padding-right: 0.25rem; }
.ppane h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }
/* Fabrics: the letters on the left, the fabric line and its swatches on the right, both visible at once */
.ppane[data-pane="fabrics"] { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 0.75rem; overflow: hidden; }
.ppane[data-pane="fabrics"][hidden] { display: none; }
.ppane[data-pane="fabrics"] .fabrics { overflow: auto; min-height: 0; padding: 2px; }
.ppane[data-pane="fabrics"] .fabric { grid-template-columns: 34px 1rem 1fr; gap: 0.5rem; padding: 0.35rem 0.45rem; }
.ppane[data-pane="fabrics"] .fabric .chip { width: 34px; height: 30px; }
.ppane[data-pane="fabrics"] .fabric .role { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ppane[data-pane="fabrics"] .library { display: flex; flex-direction: column; min-height: 0; gap: 0.5rem; margin: 0; }
.ppane[data-pane="fabrics"] .swatches { flex: 1; min-height: 0; max-height: none; align-content: start; }
.line-pick { display: grid; gap: 0.25rem; font-size: 0.8rem; font-weight: 700; }
.line-pick .tabs { display: block; margin: 0; }
.line-pick select { width: 100%; font: inherit; font-size: 0.95rem; font-weight: 600; padding: 0.45rem 0.5rem; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--background); color: var(--foreground); }
.library .search { margin: 0; }
/* saved colorways: a panel of thumbnails over the page */
.saved-drawer { position: fixed; inset: 0; z-index: 50; background: rgba(28, 28, 26, 0.45); display: flex; justify-content: flex-end; }
.saved-sheet { width: min(760px, 100%); height: 100%; overflow: auto; background: var(--background); padding: 1.25rem 1.5rem 2rem; box-shadow: -12px 0 40px rgba(0, 0, 0, 0.25); }
.saved-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.25rem; }
.saved-head h2 { margin: 0; }
.saved-drawer .saved { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.9rem; margin-top: 0.75rem; }
.saved-drawer .saved-card { grid-template-columns: 1fr; align-items: start; }
.saved-drawer .saved-card .acts { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; }
@media (max-width: 860px) {
  .tool-app { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .tool-app .tool-quilt svg { height: auto; max-height: 60vh; }
  .ppane { overflow: visible; }
  .ppane[data-pane="fabrics"] { grid-template-columns: 1fr; overflow: visible; }
  .ppane[data-pane="fabrics"] .swatches { max-height: 320px; }
  .cw-bar .savebar { grid-template-columns: 1fr 1fr; }
}

/* public Pick Your Colors (shop design, 2026-10-09): the shop's .btn and .chip are kept; tool chips are square */
.pyc .tool-app .chip { border-radius: 4px; cursor: inherit; width: auto; height: auto; }
.pyc .fabric .chip { width: 34px; height: 30px; }
.pyc .req .chip { width: 1.2rem; height: 1rem; }
.pyc .btn { min-height: 40px; padding: 0 1rem; font-size: 14px; }
.pyc .tool-head { align-items: center; }
.pyc .pyc-buy { margin-left: auto; }
.pyc .pyc-how { margin: 0; }
.pyc .fabric, .pyc .size, .pyc .qopt, .pyc .qthread { background: var(--paper, #fff); }
.mast-thin + main.pyc { padding-top: 64px; }   /* clears the hanging label (main:has(.tool-app) above is for the no-mast tool) */
.pyc .tool-head { margin-bottom: var(--s4, 1.5rem); }
/* the quilt sits in a container like the pattern page's stage (John 2026-10-09: it looked like it was floating) */
.pyc .tool-quilt { background: var(--muted); padding: var(--s4, 1.5rem) var(--s4, 1.5rem) var(--s2, 0.75rem); }
@media (max-width: 700px) { .mast-thin + main.pyc { padding-top: 56px; } }
.pyc-index { padding-block: var(--s6, 3rem); }
.pyc-grid { margin-top: var(--s5, 2rem); }
.pyc-card { display: grid; gap: 0.35rem; text-decoration: none; color: inherit; }
.pyc-card .qframe { display: block; }
.pyc-name { font-family: var(--display, serif); font-size: 1.25rem; color: var(--primary); }
.pyc-meta { font-size: 0.85rem; }
.pyc-card:hover .pyc-name { color: var(--action); }

.tool-quilt.pending svg { visibility: hidden; }   /* public tool: hidden until the starting colourway is applied */
.pyc-card .pyc-name, .pyc-card .pyc-meta { display: block; text-decoration: none; }
