/* Cap DST page (uses the Patch mockup layout) */
.cp-stage { background: #ffffff; grid-template-rows: 1fr auto auto; }
/* the design's details under the logo, in a row (as Wilcom's Design Information) */
.cp-design { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; width: min(900px, 100%); margin: 10px 0 0;
  padding: 8px 4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12.5px; }
.cp-design[hidden] { display: none; }
.cp-design div { display: flex; gap: 4px; white-space: nowrap; }
.cp-design dt { color: var(--muted); }
.cp-design dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
#canvas { max-width: 100%; max-height: 100%; align-self: center; justify-self: center; }
.cp-play { display: flex; align-items: center; gap: 10px; width: min(560px, 100%); margin-top: 12px; color: var(--ink); font-size: 12.5px; }
.cp-play[hidden] { display: none; }
.cp-play input[type="range"] { flex: 1; }
.cp-play button { width: 32px; height: 32px; padding: 0; border-radius: 50%; }
#stepText { min-width: 150px; text-align: right; font-variant-numeric: tabular-nums; }

.cp-dims { gap: 8px; }
.cp-dims label { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.cp-dims input { width: 72px; }
.cp-dims .unit { color: var(--muted); font-size: 13px; }
.cp-kind { gap: 16px; }
.cp-warn { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; line-height: 1.4;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.cp-warn[hidden] { display: none; }

.cp-colors { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cp-colors li { display: grid; grid-template-columns: 18px 22px 1fr auto; gap: 6px; align-items: center; }
.cp-colors .n { color: var(--muted); font-size: 12px; text-align: right; }
.cp-colors .sw { width: 22px; height: 22px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.cp-colors .sw.off { background-image: repeating-linear-gradient(45deg, rgb(0 0 0 / .25) 0 3px, transparent 3px 6px) !important; }
.cp-colors select { width: 100%; min-width: 0; font-size: 12.5px; }
.cp-colors .mv { display: flex; gap: 2px; }
.cp-colors .mv button { width: 22px; height: 22px; padding: 0; font-size: 11px; line-height: 1; }
.cp-colors li.off select { color: var(--muted); }
.cp-colors.puff li { grid-template-columns: 18px 22px 1fr auto auto; }
.cp-colors .pf { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; }

.cp-stats { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 4px 0 8px; font-size: 13px; }
.cp-stats dt { color: var(--muted); }
.cp-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-notes { margin: 0 0 8px; padding-left: 18px; font-size: 12.5px; color: var(--danger); }
.cp-notes:empty { display: none; }

/* the tool strip for editing the logo (cap-edit.js), as Wilcom's toolbox */
.cp-tools { position: absolute; left: 12px; top: 12px; display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 10px rgb(0 0 0 / .08); z-index: 2; }
.cp-tools[hidden] { display: none; }
.cp-tools button { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border-radius: 7px; color: var(--ink); }
.cp-tools button.on { background: color-mix(in srgb, #0a84ff 14%, transparent); color: #0a84ff; border-color: color-mix(in srgb, #0a84ff 40%, transparent); }
.cp-tools button:disabled { opacity: .35; }
.cp-tools .sep { height: 1px; margin: 2px 4px; background: var(--line); }
#canvas { touch-action: none; }

/* the Digitize button waits for a click after a change */
#digitizeBtn.pulse { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.top-actions .ghost.strong { font-weight: 600; }
/* a DST: the settings that only make a logo's stitches are hidden */
body.dst-mode .logo-only { display: none !important; }
body:not(.dst-mode) .dst-only { display: none !important; }
.cp-colors .pal { width: 26px; height: 26px; padding: 0; display: grid; place-items: center; }
.cp-colors li { grid-template-columns: 18px 22px 1fr auto auto; }
.cp-colors.puff li { grid-template-columns: 18px 22px 1fr auto auto auto; }
.cp-colors .nm { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the thread palette */
.cp-palette { position: fixed; z-index: 30; width: 340px; max-height: min(460px, 80vh); display: flex; flex-direction: column; gap: 8px;
  padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / .18); }
.cp-palette[hidden] { display: none; }
.cp-pal-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.cp-pal-head button { width: 26px; height: 26px; padding: 0; }
.cp-palette input { width: 100%; }
.cp-pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(22px, 1fr)); gap: 4px; overflow: auto; padding: 2px; }
.cp-pal-grid button { aspect-ratio: 1; width: 100%; padding: 0; border-radius: 5px; border: 1px solid rgb(0 0 0 / .15); min-height: 22px; }
.cp-pal-grid button:hover { outline: 2px solid #0a84ff; outline-offset: 1px; }
/* save or discard */
.cp-modal h3 { margin: 0 0 8px; font-size: 16px; }
.cp-modal p { margin: 0 0 16px; font-size: 13.5px; line-height: 1.45; color: var(--muted); }
.cp-modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* shapes and pen (cap-edit.js) */
.cp-draw { position: fixed; z-index: 25; width: 260px; display: flex; flex-direction: column; gap: 8px; padding: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / .18); }
.cp-draw[hidden] { display: none; }
.cp-draw-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cp-path-grid { grid-template-columns: repeat(4, 1fr); }
.cp-align { width: 330px; }
.cp-arrange { width: 250px; }
.cp-corner-r { display: flex; align-items: center; gap: 6px; }
.cp-corner-r input[type=range] { width: 110px; }
.cp-corner-r input[type=number] { width: 58px; }
.cp-arrange-list { display: flex; flex-direction: column; gap: 2px; }
.cp-arrange-list button { display: flex; justify-content: space-between; align-items: center; height: 32px; padding: 0 10px; border: 0; background: transparent; font-size: 13.5px; border-radius: 6px; color: var(--ink); }
.cp-arrange-list button:hover:not(:disabled) { background: color-mix(in srgb, #0a84ff 14%, transparent); }
.cp-arrange-list button:disabled { opacity: .35; }
.cp-arrange-list kbd { font: inherit; color: var(--muted); }
.cp-align-grid { grid-template-columns: repeat(7, 1fr); }
.cp-align-sub { font-size: 13px; }
.cp-draw-grid button:disabled { opacity: .35; }
.cp-draw-grid button { height: 40px; padding: 0; display: grid; place-items: center; border-radius: 8px; color: var(--ink); }
.cp-draw-grid button.on { background: color-mix(in srgb, #0a84ff 14%, transparent); color: #0a84ff; border-color: color-mix(in srgb, #0a84ff 40%, transparent); }
.cp-draw-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.cp-draw-row button { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; font-size: 12.5px; }
.cp-draw-row .sw { width: 18px; height: 18px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .2); }
.cp-draw .hint { margin: 0; }
.cp-tools button[aria-pressed="true"] { background: color-mix(in srgb, #0a84ff 14%, transparent); color: #0a84ff; border-color: color-mix(in srgb, #0a84ff 40%, transparent); }

/* text (cap-edit.js): the fonts (static/fonts, SIL Open Font License), to preview the lettering */
@font-face { font-family: "emb-block"; src: url("/static/fonts/ArchivoBlack.ttf"); font-display: swap; }
@font-face { font-family: "emb-condensed"; src: url("/static/fonts/Anton.ttf"); font-display: swap; }
@font-face { font-family: "emb-swiss"; src: url("/static/fonts/Oswald-Bold.ttf"); font-display: swap; }
@font-face { font-family: "emb-tall"; src: url("/static/fonts/BebasNeue.ttf"); font-display: swap; }
@font-face { font-family: "emb-serif"; src: url("/static/fonts/LibreBaskerville-Bold.ttf"); font-display: swap; }
@font-face { font-family: "emb-slab"; src: url("/static/fonts/AlfaSlabOne.ttf"); font-display: swap; }
@font-face { font-family: "emb-varsity"; src: url("/static/fonts/Graduate.ttf"); font-display: swap; }
@font-face { font-family: "emb-script"; src: url("/static/fonts/GreatVibes.ttf"); font-display: swap; }
@font-face { font-family: "emb-handwriting"; src: url("/static/fonts/DancingScript-Bold.ttf"); font-display: swap; }
@font-face { font-family: "emb-casual"; src: url("/static/fonts/Pacifico.ttf"); font-display: swap; }
@font-face { font-family: "emb-brush"; src: url("/static/fonts/KaushanScript.ttf"); font-display: swap; }
@font-face { font-family: "emb-oldenglish"; src: url("/static/fonts/UnifrakturMaguntia.ttf"); font-display: swap; }
@font-face { font-family: "emb-western"; src: url("/static/fonts/Rye.ttf"); font-display: swap; }
@font-face { font-family: "emb-rounded"; src: url("/static/fonts/Fredoka-SemiBold.ttf"); font-display: swap; }
.cp-text { width: 290px; }
.cp-text textarea { width: 100%; min-height: 54px; resize: vertical; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px; background: var(--panel); color: var(--ink); }
.cp-text select { max-width: 170px; }
.cp-text input[type=number] { width: 64px; }
.cp-text-preview { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #1d1d1b;
  font-size: 26px; line-height: 1.25; white-space: pre-wrap; overflow: hidden; max-height: 92px; text-align: center; }
.cp-text #textAdd { height: 34px; }
