/* Cedilla Studio — the phone tool dock for the web apps (since 2026-11-11,
   BLEEDR first). Built by assets/js/lab-dock.js; body.dk-on is set while it
   is up. The same look as Overprint's own dock (overprint-dock.css): tabs at
   the bottom, dials with one slider above them, Compare on the canvas.
   Loaded after off-grid.css and the app's own stylesheets. */

@media (max-width: 860px) {
  /* The stage fills the first screen above the dock, so the dock and the bar
     always sit at the bottom of the screen. svh, so the browser's toolbars
     showing and hiding don't move it. */
  body.dk-on.lab-mob:not(.lab-full) .lab-stage {
    height: calc(100vh - var(--nav) - 1px - var(--bar) - var(--dk-h, 0px));
    height: calc(100svh - var(--nav) - 1px - var(--bar) - var(--dk-h, 0px));
    min-height: 200px;
  }

  .dk-dock { order: -1; position: relative; z-index: 5; padding: 4px 0 0; background: var(--ink, #000); border-top: 1px solid var(--line); }
  .dk-dock button { -webkit-tap-highlight-color: transparent; }
  .dk-dock button:focus:not(:focus-visible), .dk-compare:focus:not(:focus-visible) { outline: none; }

  /* ---------- Head: the setting and its value, its switch and Reset ---------- */
  .dk-head { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 14px 4px; }
  .dk-label {
    flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; white-space: nowrap;
    font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #fff;
  }
  .dk-label em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--faint); }
  .dk-val {
    padding: 3px 7px 2px; border-radius: 6px; background: rgba(255, 255, 255, .1);
    font: 500 11px/1 var(--mono); letter-spacing: 0; text-transform: none; color: #fff;
    overflow: hidden; text-overflow: ellipsis;
  }
  .dk-dock .dk-reset {
    flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22);
    background: none; color: #fff; font-size: 12px; line-height: 1;
  }
  .dk-dock .dk-switch {
    flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px 4px 5px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .22); background: none; color: var(--muted); font-size: 12px; line-height: 1;
  }
  .dk-switch i {
    position: relative; width: 26px; height: 16px; border-radius: 999px; background: rgba(255, 255, 255, .2); transition: background .2s;
  }
  .dk-switch i::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
    background: #fff; transition: transform .2s var(--ease);
  }
  .dk-switch[aria-checked="true"] { color: #fff; }
  .dk-switch[aria-checked="true"] i { background: var(--blue); }
  .dk-switch[aria-checked="true"] i::after { transform: translateX(10px); }
  .dk-dock .dk-reset[hidden], .dk-dock .dk-switch[hidden] { display: none; }

  /* One height for every tab, so the canvas never jumps as you switch */
  .dk-body { height: 112px; }
  .dk-dock.is-pane .dk-tools, .dk-dock:not(.is-pane) .dk-pane { display: none; }
  .dk-pane {
    display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 14px 2px; box-sizing: border-box;
    overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 14px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .dk-pane::-webkit-scrollbar { display: none; }
  /* Recipe cards (lab-guide.js) as a strip: three and a bit, so it reads as one to swipe */
  .dk-pane .recipe-grid { display: contents; }
  .dk-pane .recipe-card { flex: 0 0 calc((100vw - 14px - 3 * 8px) / 3.1); scroll-snap-align: start; border-radius: 10px; }
  .dk-pane .recipe-card:hover { transform: none; }
  .dk-pane .rc-text { padding: 5px 7px 6px; }
  .dk-pane .rc-name { font-size: 11px; gap: 4px; white-space: nowrap; overflow: hidden; }
  .dk-pane .rc-sub { display: none; }
  .dk-pane .lg-pro, .dk-pane .rc-pro { padding: 2px 4px 1px; font-size: 8px; }
  .dk-pane .recipe-grid + .recipe-grid > .recipe-card:first-child { margin-left: 10px; position: relative; overflow: visible; }
  .dk-pane .recipe-grid + .recipe-grid > .recipe-card:first-child::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
  .dk-pane .recipe-grid + .recipe-grid > .recipe-card:first-child .rc-thumb { border-radius: 9px 9px 0 0; overflow: hidden; }

  /* ---------- Dials ---------- */
  .dk-tools { display: flex; flex-direction: column; justify-content: space-between; height: 100%; }
  .dk-dials { display: flex; gap: 2px; overflow-x: auto; padding: 2px 10px 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .dk-dials::-webkit-scrollbar { display: none; }
  .dk-dock .dk-dial {
    flex: 0 0 auto; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 0 3px; border: 0; background: none; color: var(--muted); font: inherit;
  }
  .dk-dial[hidden] { display: none; }
  .dk-face {
    position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .14);
    font: 500 11.5px/1 var(--mono); color: #fff; transition: background .2s, color .2s;
  }
  /* The ring: how far the value sits along its range, from the top */
  .dk-dial:not(.dk-dial--choice) .dk-face::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%; transform: rotate(var(--rot, 0deg));
    background: conic-gradient(#fff 0 var(--b, 0deg), transparent var(--b, 0deg));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  }
  .dk-name { font-size: 10.5px; line-height: 1.2; white-space: nowrap; }
  .dk-dial.is-on .dk-face { background: #fff; color: #000; box-shadow: none; }
  .dk-dial.is-on:not(.dk-dial--choice) .dk-face::after {
    background: conic-gradient(var(--blue) 0 var(--b, 0deg), transparent var(--b, 0deg));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
            mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2.5px));
  }
  .dk-dial.is-on .dk-name { color: #fff; }
  /* An effect that's switched off: no ring, a quieter face */
  .dk-dial.is-off .dk-face::after { display: none; }
  .dk-dial.is-off:not(.is-on) .dk-face { color: var(--faint); }
  /* Changed since the recipe: a dot after the name */
  .dk-dial.is-edited .dk-name::after {
    content: ''; display: inline-block; width: 4px; height: 4px; margin-left: 4px; border-radius: 50%;
    background: var(--pink); vertical-align: 2px;
  }
  /* A switch dial (an effect with nothing to set): tap it on and off; on, it's lit */
  .dk-dial--tap:not(.is-off) .dk-face { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 2px #fff; }
  .dk-dial--tap:not(.is-off) .dk-name { color: #fff; }
  .dk-dial--tap:active .dk-face { transform: scale(.94); }

  /* Pro, for a free visitor: a padlock, and the buy sheet on tap */
  .dk-dial.is-locked .dk-face { color: var(--faint); }
  .dk-g--lock {
    width: 14px; height: 14px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V11a1 1 0 0 1 1-1h1zm2 0h6V7a3 3 0 0 0-6 0v3z'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3h1a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V11a1 1 0 0 1 1-1h1zm2 0h6V7a3 3 0 0 0-6 0v3z'/%3E%3C/svg%3E") center / contain no-repeat;
  }

  /* Choice dials: a little picture of the value (drawn by the app into <i>) */
  .dk-face i { display: block; font-style: normal; }
  .dk-g--swatch { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
  .dk-dial--choice:not(.is-on) .dk-g--swatch { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
  .dk-g--text { font: 600 9px/1 'Open Sans', sans-serif; letter-spacing: .01em; max-width: 38px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dk-g--svg svg { display: block; }

  /* ---------- The one slider, or the setting's chips ---------- */
  .dk-ctl { position: relative; display: flex; align-items: center; height: 42px; padding: 0 14px 2px; }
  .dk-tools.is-choice .dk-ctl { padding: 0 10px 2px; }
  .dk-tools:not(.is-choice) .dk-opts, .dk-tools.is-choice .dk-range { display: none; }
  .dk-tools:not(.is-choice) .dk-ctl::before {
    content: ''; position: absolute; top: 50%; left: calc(25px + var(--tf, 0) * (100% - 50px));
    width: 2px; height: 12px; margin: -7px 0 0 -1px; border-radius: 1px; background: rgba(255, 255, 255, .4);
    pointer-events: none;
  }
  .dk-ctl.no-tick::before { display: none; }
  .dk-range {
    position: relative; width: 100%; height: 36px; margin: 0; background: transparent; cursor: pointer;
    -webkit-appearance: none; appearance: none; touch-action: pan-y; -webkit-tap-highlight-color: transparent;
  }
  .dk-range::-webkit-slider-runnable-track {
    height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .18) var(--a, 0%), #fff var(--a, 0%) var(--b, 0%), rgba(255, 255, 255, .18) var(--b, 0%));
  }
  .dk-range::-moz-range-track {
    height: 3px; border-radius: 3px;
    background: linear-gradient(90deg, rgba(255, 255, 255, .18) var(--a, 0%), #fff var(--a, 0%) var(--b, 0%), rgba(255, 255, 255, .18) var(--b, 0%));
  }
  .dk-range.is-off::-webkit-slider-runnable-track { background: rgba(255, 255, 255, .18); }
  .dk-range.is-off::-moz-range-track { background: rgba(255, 255, 255, .18); }
  .dk-range::-webkit-slider-thumb {
    -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10.5px; border-radius: 50%;
    background: #fff; border: 0; box-shadow: 0 0 0 5px rgba(81, 100, 246, .45), 0 2px 8px rgba(0, 0, 0, .5);
  }
  .dk-range::-moz-range-thumb {
    width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 0;
    box-shadow: 0 0 0 5px rgba(81, 100, 246, .45), 0 2px 8px rgba(0, 0, 0, .5);
  }
  .dk-range:focus-visible { outline: none; }
  .dk-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--blue); }

  .dk-opts {
    display: flex; align-items: center; gap: 10px; width: 100%; height: 100%; padding: 0 4px; box-sizing: border-box;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .dk-opts::-webkit-scrollbar { display: none; }
  .dk-opts > * { flex: none; margin: 0; }
  .dk-opts .field { margin: 0; }
  .dk-opts .field-name { display: none; }
  .dk-opts .chips { flex-wrap: nowrap; gap: 6px; }
  .dk-opts .chip { flex: none; white-space: nowrap; }
  .dk-opts .swatches { display: flex; gap: 8px; margin: 0; }
  .dk-opts .swatch { flex: none; width: 32px; height: 32px; }
  .dk-opts .stock-row { display: flex; gap: 8px; }
  .dk-opts .stock { flex: none; width: 38px; height: 38px; }
  .dk-opts .colour-row { display: flex; gap: 10px; }
  .dk-opts .colour-row label { flex-direction: row; gap: 6px; }
  .dk-opts .colour-row input[type=color] { width: 40px; height: 32px; }

  /* ---------- Tabs ---------- */
  .dk-tabs {
    display: grid; grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr));
    margin-top: 6px; padding: 6px 4px 2px; border-top: 1px solid var(--line);
  }
  .dk-dock .dk-tab {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 4px 0; border: 0; background: none; color: #525252; /* --faint on the black dock, but solid: see-through strokes brightened where the icon's lines cross (2026-11-18) */ font: inherit; font-size: 10.5px; line-height: 1.2;
    transition: color .15s;
  }
  .dk-tab svg { width: 22px; height: 22px; }
  .dk-tab.is-on { color: #fff; }
  .dk-dock .dk-tab:focus-visible, .dk-dock .dk-dial:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 12px; }
  .dk-tab.is-edited::after {
    content: ''; position: absolute; top: 3px; left: calc(50% + 12px);
    width: 5px; height: 5px; border-radius: 50%; background: var(--pink);
  }

  /* ---------- Compare, held on the canvas ---------- */
  .dk-compare {
    position: absolute; right: 14px; bottom: 14px; z-index: 4;
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px 7px 10px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .2); background: rgba(10, 10, 14, .72); color: #fff;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    font: inherit; font-size: 12.5px; line-height: 1;
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: none;
    -webkit-tap-highlight-color: transparent;
  }
  .dk-compare svg { width: 16px; height: 16px; }
  .dk-compare[hidden] { display: none; }
  .lab-stage.is-comparing .dk-compare { background: #fff; color: #000; border-color: #fff; }
  .lab-stage.is-clean .dk-compare { display: none; }

  /* ---------- The first-visit card (lab-guide.js), moved in above the head: one line ---------- */
  .dk-dock .lg-start {
    position: static; transform: none; width: auto; display: flex; align-items: center; gap: 10px;
    margin: 4px 14px 10px; padding: 10px 10px 10px 14px; border-radius: 16px; box-shadow: none; animation: none;
  }
  .dk-dock .lg-start[hidden] { display: none; }
  .dk-dock .lg-start-eyebrow, .dk-dock .lg-start-text, .dk-dock .lg-start-or, .dk-dock .lg-start-steps, .dk-dock .lg-start-zoom { display: none; }
  .dk-dock .lg-start-title { flex: 1 1 auto; margin: 0; padding: 0; font-size: 14px; line-height: 1.25; }
  .dk-dock .lg-start-row { flex: none; margin: 0; }
  .dk-dock .pill.lg-start-go { padding: 8px 12px; font-size: 12.5px; }
  .dk-dock .lg-start-x { position: relative; top: auto; right: auto; flex: none; order: 9; }
}

/* Touch screens keep :hover after a tap: chips in the dock only show what's on */
@media (max-width: 860px) and (hover: none) {
  .dk-opts .chip:not(.is-on):not([aria-pressed="true"]):hover { background: rgba(255, 255, 255, .04); border-color: var(--line); color: inherit; transform: none; }
  .dk-opts .swatch:hover, .dk-opts .stock:hover { transform: none; }
}

/* ---------- BLEEDR ---------- */
@media (max-width: 860px) {
  /* What's in the dock leaves the panel: Bleed, Print and Colour go, and
     Specimen and Recipes for free visitors (Pro owners keep their text
     layers, layer ink and saved recipes there). Image and Export stay. */
  .dk-on.bleedr-page .lab-panel > .lab-section:nth-child(4),
  .dk-on.bleedr-page .lab-panel > .lab-section:nth-child(5),
  .dk-on.bleedr-page .lab-panel > .lab-section:nth-child(6),
  .dk-on.bleedr-page .lab:not(.is-pro) .lab-panel > .lab-section:nth-child(1),
  .dk-on.bleedr-page .lab:not(.is-pro) .lab-panel > .lab-section:nth-child(3),
  .dk-on.bleedr-page #specimenSliders { display: none; }

  /* The font shop link ("Get CS Endless →") goes to the top corner, clear of the words on the shorter canvas */
  .dk-on.bleedr-page .stage-shop { top: 14px; bottom: auto; left: 14px; }

  /* Text: the words and the typeface, stacked */
  .bleedr-page .dk-dock[data-tab="text"] .dk-pane { flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; overflow: visible; }
  .bleedr-page .dk-pane .field { margin: 0; }
  .bleedr-page .dk-pane .field-name { display: none; }
  .bleedr-page .dk-pane textarea { height: 52px; min-height: 0; padding: 8px 12px; font-size: 16px; line-height: 1.2; resize: none; } /* 16px: iOS doesn't zoom in */
  .bleedr-page .dk-pane .font-row select { font-size: 16px; }
}

/* ---------- Off Grid (body.og-page, off-grid.php) ---------- */
@media (max-width: 860px) {
  /* What's in the dock leaves the panel: everything but Export, and "Your recipes" for Pro owners */
  .dk-on.og-page .lab-panel > .lab-section:not(#labExport) { display: none; }
  .dk-on.og-page .lab.is-pro .lab-panel > .lab-section:nth-child(2) { display: block; }

  .dk-on.og-page .stage-shop { top: 14px; bottom: auto; left: 14px; }
  /* No view buttons with the dock, as on Overprint and BLEEDR: pinching still zooms */
  .dk-on.og-page .view-ctl { display: none; }

  /* Text: the words and the typeface, stacked */
  .og-page .dk-dock[data-tab="text"] .dk-pane { flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; overflow: visible; }
  .og-page .dk-pane .field { margin: 0; }
  .og-page .dk-pane .field-name { display: none; }
  .og-page .dk-pane textarea { height: 52px; min-height: 0; padding: 8px 12px; font-size: 16px; line-height: 1.2; resize: none; } /* 16px: iOS doesn't zoom in */
  .og-page .dk-pane .font-row select { font-size: 16px; }
}
