/* v75: web font. Roboto Condensed is the one typeface for the whole UI: 500 for headers (floater / dropdown / field titles,
 * folder and section names), 400 for everything else; 700 only where bold carries meaning (a mark or set "in use").
 * display=swap shows text at once in the fallback font, then switches. @import must stay the first rule in this file. */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;500;700&display=swap');

/* ============================================================
 * shared/style.css — the whole design-system block, lifted out
 * as-is from _print-tools_v2.html's <style> tag. Loaded once by
 * every tool partial via a single <link>.
 * ============================================================ */

  :root {
    --bg: #f5f3ef;
    --surface: #ffffff;
    --surface2: #f0ede8;
    /* v61: neutral text/border tokens darkened ~50% (each channel halved). Backgrounds unchanged.
       Original values: border #d8d4cc, border-light #e8e5e0, text #1a1916, text-muted #7a7670,
       text-faint #b0aca6, accent #1a1916. */
    --border: #6c6a66;
    --border-light: #747270;
    --text: #0d0c0b;
    --text-muted: #3d3b38;
    --text-faint: #585653;
    --accent: #0d0c0b;
    --green: #27ae60;
    --red: #c0392b;
    --blue: #2b6cb0;
    --font: 'Roboto Condensed', 'Arial Narrow', sans-serif;
    --sans: var(--font);
    /* v75: --mono is kept as a name because every module uses it; it is the same typeface as --sans now (Roboto Condensed). */
    --mono: var(--font);
    --mono-true: var(--font);
    --title-font: var(--font);            /* floater / panel title bars */
    --title-color: #000;                  /* floater / panel titles: 100% black */
    --hint-fs: 9.5px;                     /* hint text, every module: between the old 8px sidebar hint and the old 11px hint */
    --radius: 6px;
    --radius-lg: 10px;
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 40px 20px 60px;
    font-size: 14px;
    line-height: 1.5;
  }

  .app { max-width: 740px; margin: 0 auto; }

  header {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
  }

  header h1 {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.02em;
  }

  header span {
    font-size: 12px;
    color: var(--text-muted);
    font-family: var(--mono);
  }

  header .credit { margin-left: auto; color: var(--text-faint); }

  header .back-link {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 7px 14px;
    white-space: nowrap;
  }
  header .back-link:hover { color: var(--text); border-color: var(--text-muted); }

  /* ---- Tool menu ---- */
  .toolnav {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
    flex-wrap: wrap;
  }

  .toolnav button {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .03em;
    padding: 9px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all .15s;
  }

  .toolnav button:hover { color: var(--text); border-color: var(--text-faint); }

  .toolnav button.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
  }

  /* ---- Tool sections ---- */
  .tool { display: none; }
  .tool.active { display: block; animation: fade .2s ease; }
  @keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

  .tool-intro {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: .04em;
    margin-bottom: 16px;
  }

  /* ---- Cards ---- */
  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
  }

  .card-title {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 16px;
  }

  /* ---- Inputs ---- */
  .field label {
    display: block;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
    letter-spacing: .04em;
  }

  input[type="text"],
  input[type="number"] {
    width: 100%;
    height: 38px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 10px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: border-color .15s;
  }

  input:focus { border-color: var(--accent); background: #fff; }
  input.err { border-color: var(--red); }

  .hint {
    font-size: var(--hint-fs, 9.5px);
    color: var(--text-muted);
    margin-top: 5px;
    font-family: var(--sans);
    min-height: 16px;
  }
  .hint.bad { color: var(--red); }

  .input-grid {
    display: grid;
    grid-template-columns: 90px 1fr 130px;
    gap: 14px;
    align-items: start;
  }

  .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

  /* job info + date row (all modules) */
  .grid-jobdate { display: grid; grid-template-columns: 1fr 160px; gap: 14px; align-items: start; }
  @media (max-width: 560px) { .grid-jobdate { grid-template-columns: 1fr; } }

  /* ---- Swatch module ---- */
  .cmyk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  @media (max-width: 560px) { .cmyk-grid { grid-template-columns: repeat(2, 1fr); } }
  .cmyk-field label { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
  .cmyk-field .vary { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-faint); text-transform: none; letter-spacing: 0; cursor: pointer; }
  .cmyk-field .vary input { width: auto; height: auto; }
  .cmyk-field input[type="number"] { border-left: 3px solid var(--border); }
  .swatch-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
  .btn-pill {
    font-family: var(--mono); font-size: 12px; letter-spacing: .03em;
    padding: 10px 20px; background: var(--accent); color: #fff;
    border: 1px solid var(--accent); border-radius: 100px; cursor: pointer; transition: opacity .15s;
  }
  .btn-pill:hover { opacity: .85; }
  .btn-pill:disabled { opacity: .35; cursor: not-allowed; }
  .sw-mode-row { background: var(--surface2); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 12px 14px; }
  .sw-mode-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
  .sw-mode-label input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; width: auto; height: auto; }
  .sw-mode-text { font-family: var(--mono); font-size: 12px; color: var(--text-muted); line-height: 1.5; }
  .sw-mode-text strong { color: var(--text); font-weight: 400; }
  .sw-preview-grid { display: grid; gap: 6px; }
  .sw-cell { display: flex; flex-direction: column; }
  .sw-chip { width: 100%; aspect-ratio: 1.6 / 1; border: 1px solid var(--border); border-radius: 3px; }
  .sw-cap { font-family: var(--mono); font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 3px; }

  @media (max-width: 560px) {
    .input-grid, .grid-3 { grid-template-columns: 1fr; }
  }

  /* ---- Optional toggle ---- */
  .optional-toggle {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 12px; color: var(--text-muted);
    font-family: var(--mono); user-select: none; margin-top: 14px;
  }
  .optional-toggle:hover { color: var(--text); }
  .toggle-arrow { font-size: 10px; transition: transform .2s; display: inline-block; }
  .toggle-arrow.open { transform: rotate(90deg); }
  .optional-fields { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-light); }
  .optional-fields.open { display: block; }
  .opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .opt-grid.names-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .opt-sub { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-bottom: 8px; letter-spacing: .04em; text-transform: uppercase; }

  /* ---- Results / metrics ---- */
  .results { display: none; }
  .results.visible { display: block; }

  .summary-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }
  @media (max-width: 560px) { .summary-row { grid-template-columns: repeat(2, 1fr); } }

  .metric { background: var(--surface2); border-radius: var(--radius); padding: 14px 12px; text-align: center; }
  .metric .val { font-family: var(--mono); font-size: 22px; font-weight: 400; line-height: 1.1; }
  .metric .lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-family: var(--mono); }
  .metric .sub { font-size: 10px; color: var(--text-faint); margin-top: 2px; font-family: var(--mono); }

  /* dual planned-vs-new metric tiles */
  .summary-row.dual2 { grid-template-columns: 1fr 1fr; }
  @media (max-width: 560px) { .summary-row.dual2 { grid-template-columns: 1fr; } }
  .metric.dual { text-align: center; }
  .metric.dual .lbl { margin: 0 0 8px; }
  .metric.dual .pair { display: flex; align-items: center; justify-content: center; gap: 12px; }
  .metric.dual .col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .metric.dual .num { font-family: var(--mono); font-size: 22px; font-weight: 400; line-height: 1.1; }
  .metric.dual .num.planned { color: var(--blue); }
  .metric.dual .num.new { color: var(--text); }
  .metric.dual .tag { font-size: 10px; color: var(--text-faint); font-family: var(--mono); letter-spacing: .03em; }
  .metric.dual .arrow { color: var(--text-faint); font-family: var(--mono); font-size: 14px; }

  /* gang layout grid controls */
  .grid-layout-ctrl { display: flex; gap: 14px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }
  .grid-layout-ctrl .field { width: 100px; }
  .ctrl-note { font-family: var(--mono); font-size: 11px; color: var(--text-faint); flex: 1; min-width: 180px; line-height: 1.45; }

  /* ---- Tables ---- */
  .table-wrap { overflow-x: auto; margin-bottom: 4px; }
  table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
  table th {
    text-align: left; font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-muted); padding: 0 10px 8px; border-bottom: 1px solid var(--border);
  }
  table th:not(:first-child) { text-align: right; }
  table td { padding: 8px 10px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
  table td:not(:first-child) { text-align: right; }
  table tr:last-child td { border-bottom: none; }

  .job-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; flex-shrink: 0; vertical-align: middle; }

  .over-pos { color: var(--text); }
  .over-zero { color: var(--green); font-weight: 500; }
  .over-neg { color: var(--red); }

  .cost-row { background: var(--surface2); border-top: 2px solid var(--border); font-weight: 500; }
  .cost-row td { padding: 10px 10px; }

  .row-emph td { background: var(--surface2); font-weight: 500; }
  .section-row td {
    padding-top: 14px; font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--text-faint); border-bottom: 1px solid var(--border);
  }

  /* ---- Gang sheet preview ---- */
  .sheet-label { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-bottom: 8px; letter-spacing: .04em; text-transform: uppercase; }
  .sheet-grid { display: grid; gap: 2px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
  .sheet-cell { border-radius: 2px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-weight: 400; cursor: default; }
  .sheet-cell:hover { opacity: .75; }
  .footnote { font-family: var(--mono); font-size: 11px; color: var(--text-faint); margin-top: 12px; }

  /* ---- Roll fold ---- */
  .foldbar {
    display: flex; align-items: stretch; height: 56px; gap: 2px;
    border: 1px solid var(--border); background: var(--surface2);
    border-radius: var(--radius); padding: 4px; overflow: hidden; margin-bottom: 16px;
  }
  .foldseg {
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono); font-size: 11px; font-weight: 500;
    border-radius: 3px; min-width: 0; transition: flex .4s ease; overflow: hidden;
  }
  .panel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
  .panel-item { background: var(--surface2); border-radius: var(--radius); padding: 10px 12px; border-left: 3px solid var(--border); }
  .panel-num { font-family: var(--mono); font-size: 10px; color: var(--text-muted); letter-spacing: .04em; margin-bottom: 3px; }
  .panel-size { font-family: var(--mono); font-size: 18px; font-weight: 400; line-height: 1; }
  .panel-size .unit { font-size: 11px; color: var(--text-muted); margin-left: 2px; }

  /* ---- Sets composition bar ---- */
  .compbar { display: flex; height: 28px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 10px; }
  .compseg { display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; color: #fff; min-width: 0; transition: flex .4s ease; }
  .complegend { display: flex; flex-wrap: wrap; gap: 14px; font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
  .complegend span { display: inline-flex; align-items: center; gap: 6px; }
  .complegend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

  .divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

  @media print {
    body { background: #fff; padding: 20px; }
    .toolnav { display: none; }
    .swatch-actions { display: none; }
    .side-calc { display: none !important; }
    header .credit { color: #555; }
    header .back-link { display: none; }
    .card { border: 1px solid #ccc; }
    .sheet-grid, .foldbar, .compbar { break-inside: avoid; }
    .tool { display: none !important; }
    .tool.active { display: block !important; }
  }

  /* ---- Side calculator ---- */
  .side-calc {
    position: fixed;
    top: 40px; /* set precisely by JS after header renders */
    right: 24px;
    width: 196px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    z-index: 100;
    display: none;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
  }
  @media (min-width: 1100px) { .side-calc { display: flex; } }

  .side-calc-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 2px;
  }

  .calc-display {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 500;
    text-align: right;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 1px;
    overflow: hidden;
    word-break: break-all;
  }
  .calc-expr { font-size: 10px; color: var(--text-faint); min-height: 13px; line-height: 1.2; }
  .calc-val  { line-height: 1.15; color: var(--text); }

  .calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }

  .calc-btn {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    transition: background .1s, border-color .1s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-select: none;
    padding: 0;
  }
  .calc-btn:hover  { background: var(--surface2); border-color: var(--text-faint); }
  .calc-btn:active { background: var(--border); }

  .calc-btn.op  { background: var(--surface); color: var(--text-muted); }
  .calc-btn.op:hover { color: var(--text); border-color: var(--text-faint); }

  .calc-btn.eq  { background: var(--accent); color: #fff; border-color: var(--accent); }
  .calc-btn.eq:hover { opacity: .88; }

  .calc-btn.clr { color: var(--red); font-size: 11px; letter-spacing: .03em; }
  .calc-btn.wide { grid-column: span 2; }

  /* ============================================================
   * v61: shared components used by Imposition Builder / Dropzone that
   * were missing from this file. Keep them here, not per-module.
   * ============================================================ */

  .field { display: flex; flex-direction: column; gap: 6px; }
  .field label { margin-bottom: 0; }

  select {
    width: 100%;
    height: 38px;
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 28px 0 10px;
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text);
    outline: none;
    cursor: pointer;
    transition: border-color .15s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%233d3b38' stroke-width='1.5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 7px;
  }
  select:focus { border-color: var(--accent); background-color: #fff; }

  /* secondary / small pill buttons */
  .btn-pill.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
  .btn-pill.secondary:hover { border-color: var(--text-muted); opacity: 1; }
  .btn-pill.tiny { font-size: 10px; padding: 6px 12px; }

  /* file drop target */
  .dropzone {
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    padding: 22px 16px;
    text-align: center;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 12px;
    transition: border-color .15s, background .15s;
  }
  .dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--surface2); color: var(--text); }

  /* loaded-file row */
  .file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 0;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--text);
  }
  .file-row .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .file-row.file-error { flex-wrap: wrap; color: var(--red); }

  /* inline prompt box (trim/bleed entry, restore notices) */
  .inline-prompt {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-top: 10px;
    font-family: var(--sans);
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
  }
  .inline-prompt .grid-2 { margin-top: 8px; }

/* ============================================================
 * v62 — tokens used by the Print Tools modules (Standardize PDF v23 and later).
 * Modules must not declare colors of their own: they use these. Change a value
 * here and it reaches every tool. Values equal what the modules used before.
 * ============================================================ */
:root {
  /* state colors */
  --orange: #c07030;              /* warnings, "grew" file size */
  --tint-ok: #e7f3ec;             /* "processed" state pill background */
  --tint-info: #eef4fa;           /* active list row / spot swatch background */
  --tint-drop: #e3ecdf;           /* muted green dropzone */
  --tint-drop-hover: #d3e3ce;
  --edit-hover: rgba(43, 108, 176, .10);   /* hover wash on editable art in the preview */
  --edit-sel: rgba(192, 57, 43, .08);      /* selected-element wash */

  /* surfaces and text on them */
  --on-accent: #fff;              /* text/borders on an --accent (dark) fill */
  --paper: #fff;                  /* white sheet behind page previews and thumbnails */
  --scrim: rgba(0, 0, 0, .35);    /* dimmed backdrop behind a dialog */

  /* elevation */
  --shadow-1: 0 1px 6px rgba(0, 0, 0, .12);        /* page preview */
  --shadow-pop: 0 6px 24px rgba(0, 0, 0, .18);     /* popover / dialog */
  --shadow-pop-lg: 0 6px 22px rgba(0, 0, 0, .22);  /* floating palettes */
  --shadow-menu: 0 6px 18px rgba(0, 0, 0, .2);     /* menus */

  /* process / channel sliders */
  --ink-c: #00aeef;
  --ink-m: #ec008c;
  --ink-y: #e6c800;
  --ink-r: #d33;
  --ink-g: #3a3;
  --ink-b: #36c;

  /* "no color" chip pattern and unknown swatch */
  --nocolor-a: #eee;
  --nocolor-b: #ccc;
  --swatch-unknown: #888;
}

/* ============================================================
 * v71 — tokens added for Imposition Builder v71 / Dropzone v63 (server-dependence conversion).
 * Values equal what those modules declared locally before.
 * ============================================================ */
:root {
  /* Forms list +/- buttons */
  --add-bg: #dcefdc;  --add-bg-hover: #c9e6c9;  --add-fg: #1e7d1e;  --add-border: #9bc99b;
  --remove-bg: #f5d9d5;  --remove-bg-hover: #eec3bc;  --remove-border: #dba59c;
  /* warnings */
  --tint-warn: #fdf3e7;  --warn-border: #e0b877;  --tint-danger: #fbe9e7;  --amber: #b7791f;
  /* misc state colors */
  --purple: #8a5cd6;          /* free-form badge */
  --dupe: #d9822b;            /* duplicated page outline */
  --label-bg: rgba(255, 255, 255, .7);       /* label floating over a preview */
  --cell-tint: rgba(43, 108, 176, .06);      /* page position in a schematic */
  --mark-tint: rgba(43, 108, 176, .25);      /* slugline / mark placeholder in a schematic */
  --mark-edge: rgba(43, 108, 176, .5);
  --shadow-modal: 0 12px 40px rgba(0, 0, 0, .35);
  /* one color per loaded source file (schematic strip, page chips, Gang rows) */
  --file-1: #2b6cb0;  --file-2: #c0392b;  --file-3: #27ae60;  --file-4: #d9822b;
  --file-5: #8a5cd6;  --file-6: #0e7c86;  --file-7: #b83280;  --file-8: #4a5568;
}

/* ============================================================
 * APP SHELL KIT (v72) — the look shared by the Print Tools "fixed shell" tools
 * (Standardize PDF, Variable Data, ...): header, menu bar, three scrolling columns,
 * collapsible/floating panels, floating popups, Preferences dialog, toast, edit bar,
 * stat tiles. Lifted out of Standardize PDF v50 (which got most of it from Imposition Builder).
 *
 * OPT IN: add class="app-shell" to <body>. Every rule below is scoped to body.app-shell
 * (through :where(), so it adds no specificity), which means tools that do not opt in
 * are not touched and a tool's own <style> can still override any rule.
 * COLORS: only tokens (var(--...)) are used here, never literal colors — change the
 * tokens (or a client scheme) and every tool follows.
 * Nothing in this block is tool-specific. Tool-specific rules stay in the tool.
 * ============================================================ */
body.app-shell{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:16px;font-weight:400;line-height:1.5;display:flex;flex-direction:column;height:100vh;overflow:hidden;}
:where(body.app-shell) a{color:inherit;}
:where(body.app-shell) input[type="checkbox"]{margin:3px 3px 3px 4px;} /* shared reset zeroes checkbox margins */
:where(body.app-shell) header.app-header{margin-bottom:0;gap:normal;flex-wrap:nowrap;display:flex;align-items:center;justify-content:space-between;padding:16px 24px;border-bottom:1px solid var(--border);background:var(--surface);}
:where(body.app-shell) .back-pill{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:999px;background:var(--surface2);border:1px solid var(--border);color:var(--text-muted);text-decoration:none;font-family:var(--mono);font-size:11px;letter-spacing:.04em;}
:where(body.app-shell) .back-pill:hover{opacity:.85;}
:where(body.app-shell) .app-title{font-family:var(--mono);font-size:13px;letter-spacing:.04em;color:var(--text);}
:where(body.app-shell) .credit{font-family:var(--mono);font-size:10px;color:var(--text-faint);letter-spacing:.03em;}
:where(body.app-shell) header.app-header .credit{margin-left:0;}
:where(body.app-shell) .three-col{display:flex;gap:24px;align-items:stretch;padding:20px 24px 0;flex:1;min-height:0;box-sizing:border-box;}
:where(body.app-shell) .col-left,:where(body.app-shell) .col-right{width:240px;flex-shrink:0;height:100%;overflow-y:auto;overflow-x:hidden;padding:0 6px 40px 0;box-sizing:border-box;}
:where(body.app-shell) .col-main{flex:1;min-width:0;height:100%;overflow-y:auto;scrollbar-gutter:stable;padding:0 6px 40px 0;box-sizing:border-box;}   /* v73: width does not jump when the scrollbar appears (from Impo) */
:where(body.app-shell) .col-main > *{max-width:1400px;margin-left:auto;margin-right:auto;}
:where(body.app-shell) .col-section{margin-bottom:22px;}
:where(body.app-shell) .col-section h4{font:500 8px var(--title-font,var(--mono));letter-spacing:.04em;text-transform:uppercase;color:var(--title-color,var(--text-muted));margin:0 0 8px;}
:where(body.app-shell) .sec-header{cursor:pointer;user-select:none;}
:where(body.app-shell) .col-section h4.sec-title{display:flex;align-items:center;gap:6px;margin:0;}
:where(body.app-shell) .sec-collapsible-body{display:none;margin-top:8px;}
:where(body.app-shell) .sec-collapsible-body.open{display:block;}
:where(body.app-shell) .col-section-toggle-arrow{font:400 9px/1 var(--mono);display:inline-block;width:9px;text-align:center;color:var(--text-faint);transition:transform .15s;flex-shrink:0;}   /* v78: drawn, not typed: see the block at the end */
:where(body.app-shell) .col-section-toggle-arrow.open{transform:rotate(90deg);}
:where(body.app-shell) .col-section .grid-2{gap:8px;}
:where(body.app-shell) .col-section .field{gap:3px;margin-bottom:8px;}
:where(body.app-shell) .col-section .field label{font-size:7px;}
:where(body.app-shell) .col-section input[type="text"],:where(body.app-shell) .col-section input[type="number"],:where(body.app-shell) .col-section select{padding:5px 7px;font-size:10px;width:100%;box-sizing:border-box;height:22px!important;padding-top:0!important;padding-bottom:0!important;line-height:normal!important;}
:where(body.app-shell) .col-section select{padding-right:24px;}
:where(body.app-shell) .col-section .hint{font-size:var(--hint-fs,9.5px);font-family:var(--sans);margin-top:4px;line-height:1.3;min-height:0;}
:where(body.app-shell) .col-section .hint:empty{display:none;}
:where(body.app-shell) .col-section .hint.box{padding:6px 8px;background:var(--surface2);border:1px solid var(--border-light);border-radius:var(--radius);line-height:1.5;}
:where(body.app-shell) .btn-pill,:where(body.app-shell) .btn-pill.tiny,:where(body.app-shell) .btn-pill.secondary{font-family:var(--mono)!important;font-size:8px!important;letter-spacing:.04em!important;padding:6px 11px!important;line-height:normal!important;border-radius:999px!important;border-width:1px!important;border-style:solid;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:5px;}
:where(body.app-shell) .btn-pill.on,:where(body.app-shell) .btn-pill.secondary.on,:where(body.app-shell) .btn-pill.tiny.on{background:var(--accent);color:var(--on-accent,#fff);border-color:var(--accent);}
:where(body.app-shell) .check-row{background:var(--surface2);border:1px solid var(--border-light);border-radius:var(--radius);padding:8px 10px;margin-bottom:10px;}
:where(body.app-shell) .check-label{display:flex;align-items:flex-start;gap:6px;cursor:pointer;}
:where(body.app-shell) .check-label input[type="checkbox"]{margin-top:2px;flex-shrink:0;width:auto;height:auto;}
:where(body.app-shell) .check-text{font-family:var(--mono);font-size:8px;color:var(--text-muted);line-height:1.5;}
:where(body.app-shell) .check-text strong{color:var(--text);font-weight:400;}
:where(body.app-shell) .check-sub{margin-top:8px;padding-top:8px;border-top:1px solid var(--border-light);display:none;}
:where(body.app-shell) .check-sub.open{display:block;}
:where(body.app-shell) .process-bar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:14px;}
:where(body.app-shell) .preview-empty{border:1px dashed var(--border);border-radius:var(--radius-lg);padding:60px 24px;text-align:center;color:var(--text-faint);font:400 12px var(--sans);}
:where(body.app-shell) .preview-state-label{font:400 9px var(--mono);letter-spacing:.05em;text-transform:uppercase;padding:3px 9px;border-radius:100px;display:inline-block;}
:where(body.app-shell) .preview-state-label.as-uploaded{background:var(--surface2);color:var(--text-muted);}
:where(body.app-shell) .preview-state-label.processed{background:var(--tint-ok);color:var(--green);}
:where(body.app-shell) .preview-state-label.busy{background:var(--surface2);color:var(--red);border:1px solid var(--red);}
:where(body.app-shell) .stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:12px;}
:where(body.app-shell) .stat-tile{background:var(--surface2);border-radius:var(--radius);padding:10px;text-align:center;}
:where(body.app-shell) .stat-tile .stat-label{font:500 8px var(--mono);letter-spacing:.05em;text-transform:uppercase;color:var(--text-muted);}
:where(body.app-shell) .stat-tile .stat-value{font:400 14px var(--mono);margin-top:3px;}
:where(body.app-shell) .stat-tile .stat-value.shrunk{color:var(--green);}
:where(body.app-shell) .stat-tile .stat-value.grew{color:var(--orange);}
:where(body.app-shell) .tags-row{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px;}
:where(body.app-shell) .tag{display:inline-block;font-family:var(--mono);font-size:9px;padding:2px 8px;border-radius:100px;border:1px solid currentColor;}
:where(body.app-shell) .footnote{font-family:var(--mono);font-size:9px;color:var(--text-faint);padding:4px 0 24px;}
:where(body.app-shell) #defaultsToast{position:fixed;bottom:28px;left:50%;transform:translateX(-50%) translateY(12px);background:var(--accent);color:var(--on-accent,#fff);font-family:var(--mono);font-size:11px;letter-spacing:.04em;padding:8px 18px;border-radius:14px;opacity:0;pointer-events:none;transition:opacity .25s,transform .25s;z-index:9999;max-width:min(720px,90vw);width:max-content;text-align:center;line-height:1.5;}
:where(body.app-shell) #defaultsToast.show{opacity:1;transform:translateX(-50%) translateY(0);}
:where(body.app-shell) .edit-bar{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:-2px 0 10px;}
:where(body.app-shell) .edit-bar .hist-label{font:400 9px var(--mono);color:var(--text-muted);flex:1;min-width:120px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
:where(body.app-shell) .edit-bar .tb-chk{display:inline-flex;align-items:center;gap:5px;font:400 9px var(--mono);white-space:nowrap;cursor:pointer;margin:0 2px;color:var(--text);}
:where(body.app-shell) .edit-bar .tb-chk input{margin:0;width:auto;height:auto;}
:where(body.app-shell) .tb-group{display:inline-flex;flex-wrap:wrap;max-width:100%;box-sizing:border-box;align-items:center;gap:6px 8px;flex:none;white-space:nowrap;background:var(--surface2);border-radius:var(--radius);padding:4px 7px;margin-left:auto;}
:where(body.app-shell) .tb-sub{display:inline-flex;align-items:center;gap:5px;flex:none;white-space:nowrap;}
:where(body.app-shell) .tb-sep{width:1px;align-self:stretch;background:var(--border-light);margin:0 1px;}
:where(body.app-shell) .tb-title{font:400 9px var(--mono);color:var(--text-muted);margin-right:1px;}
:where(body.app-shell) .share-back{position:fixed;inset:0;z-index:1100;background:var(--scrim);display:none;align-items:center;justify-content:center;}
:where(body.app-shell) .share-back.open{display:flex;}
:where(body.app-shell) .share-box{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:16px;width:min(440px,92vw);display:flex;flex-direction:column;gap:8px;}
:where(body.app-shell) .ob-btn{font:400 11px/normal var(--mono);background:none;border:none;color:var(--text-muted);cursor:pointer;padding:1px 5px;border-radius:3px;flex-shrink:0;margin-left:auto;}
:where(body.app-shell) .ob-btn:hover{background:var(--surface2);color:var(--text);}
:where(body.app-shell) .cp-head .ob-btn{margin-left:0;}
:where(body.app-shell) .pref-box{background:var(--surface);border:1px solid var(--border);border-radius:12px;width:min(780px,94vw);height:min(620px,88vh);display:flex;flex-direction:column;overflow:hidden;}
:where(body.app-shell) .pref-saved{font-weight:400;color:var(--text-muted);}
:where(body.app-shell) .pref-title{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--border);font:500 11px var(--mono);color:var(--text);}
:where(body.app-shell) .pref-main{display:flex;flex:1;min-height:0;}
:where(body.app-shell) .pref-nav{width:170px;flex-shrink:0;border-right:1px solid var(--border);padding:8px;display:flex;flex-direction:column;gap:2px;overflow:auto;}
:where(body.app-shell) .pref-nav-btn{text-align:left;font:400 10px var(--mono);padding:6px 8px;border:none;background:none;border-radius:4px;cursor:pointer;color:var(--text);}
:where(body.app-shell) .pref-nav-btn:hover{background:var(--surface2);}
:where(body.app-shell) .pref-nav-btn.on{background:var(--surface2);font-weight:500;}
:where(body.app-shell) .pref-body{flex:1;overflow:auto;padding:14px 18px;}
:where(body.app-shell) .pref-body > .col-section{display:none;margin:0;max-width:460px;}
:where(body.app-shell) .pref-body > .col-section.pref-on{display:block;}
:where(body.app-shell) .pref-body .sec-header{pointer-events:none;margin-bottom:10px;}
:where(body.app-shell) .pref-body .col-section-toggle-arrow{display:none;}
:where(body.app-shell) .pref-body .sec-collapsible-body{display:block !important;}
:where(body.app-shell) .share-box textarea{width:100%;min-height:80px;font:400 10px var(--mono);box-sizing:border-box;}
body.app-shell .float-pop{position:fixed !important;right:auto;bottom:auto;z-index:600;max-height:calc(100vh - 16px) !important;resize:both;min-width:180px;min-height:60px;}
:where(body.app-shell) .float-pop .cp-head{cursor:move;user-select:none;touch-action:none;display:flex;justify-content:space-between;align-items:center;font:500 8px var(--title-font,var(--mono));letter-spacing:.06em;text-transform:uppercase;color:var(--title-color,var(--text-muted));padding:7px 2px 6px;}
:where(body.app-shell) .float-pop .cp-head .fp-grip{opacity:.5;letter-spacing:0;}
:where(body.app-shell) .col-section.fpanel{border:1px solid var(--border);background:var(--surface);border-radius:var(--radius);padding:0;margin-bottom:10px;}
:where(body.app-shell) .col-section.fpanel > h4.sec-title{gap:5px;padding:5px 6px 5px 8px;margin:0;border-bottom:1px solid var(--border-light);font:500 9px var(--title-font,var(--mono));letter-spacing:.04em;text-transform:uppercase;color:var(--title-color,var(--text-muted));}
:where(body.app-shell) .col-section.fpanel.fp-closed > h4.sec-title{border-bottom:none;}
:where(body.app-shell) .col-section.fpanel > .sec-collapsible-body{margin-top:0;padding:8px 10px 10px;}
:where(body.app-shell) .fp-slot{display:block;}
:where(body.app-shell) .fp-slot.fp-dragging{opacity:.45;}
:where(body.app-shell) .fp-btns{margin-left:auto;display:flex;gap:5px;align-items:center;flex-shrink:0;}
:where(body.app-shell) .fp-btns .ob-btn{margin-left:0;}
:where(body.app-shell) .col-section.fpanel.floating{position:fixed;z-index:600;margin:0;background:var(--surface);box-shadow:var(--shadow-pop-lg);display:flex;flex-direction:column;overflow:hidden;resize:both;min-width:200px;min-height:44px;max-height:calc(100vh - 16px);box-sizing:border-box;}
:where(body.app-shell) .col-section.fpanel.floating.fp-folded{resize:none;}
:where(body.app-shell) .col-section.fpanel.floating > .sec-header{cursor:move;touch-action:none;flex-shrink:0;}
:where(body.app-shell) .col-section.fpanel.floating > .sec-collapsible-body{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;}
:where(body.app-shell) .fp-home{display:flex;align-items:center;gap:5px;margin-bottom:10px;padding:5px 6px 5px 8px;border:1px dashed var(--border);border-radius:var(--radius);background:var(--surface2);color:var(--text-muted);font:500 9px var(--mono);letter-spacing:.04em;text-transform:uppercase;cursor:pointer;user-select:none;}
:where(body.app-shell) .fp-home .fp-home-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
:where(body.app-shell) .fp-home .col-section-toggle-arrow{transform:none;}
:where(body.app-shell) .fp-line{position:fixed;height:3px;border-radius:2px;background:var(--accent);z-index:900;pointer-events:none;display:none;}
:where(body.app-shell) .cp-head .fp-grip{display:none;}
:where(body.app-shell) .menubar{display:flex;gap:2px;padding:0 24px;background:var(--surface);border-bottom:1px solid var(--border-light);position:relative;z-index:500;flex-shrink:0;user-select:none;}
:where(body.app-shell) .menu{position:relative;}
:where(body.app-shell) .menu-btn{font:500 10px var(--mono);letter-spacing:.04em;padding:6px 12px;background:none;border:none;border-radius:4px 4px 0 0;cursor:pointer;color:var(--text);}
:where(body.app-shell) .menu:hover .menu-btn,:where(body.app-shell) .menu.open .menu-btn{background:var(--surface2);}
:where(body.app-shell) .menu-drop{display:none;position:absolute;left:0;top:100%;min-width:240px;background:var(--surface);border:1px solid var(--border);border-radius:0 6px 6px 6px;box-shadow:var(--shadow-menu);padding:4px;z-index:1600;}
:where(body.app-shell) .menu:hover .menu-drop,:where(body.app-shell) .menu.open .menu-drop{display:block;}
:where(body.app-shell) .menu.shut .menu-drop{display:none!important;}
:where(body.app-shell) .mi{display:flex;align-items:center;width:100%;gap:6px;text-align:left;font:400 10px var(--mono);padding:5px 8px;border:none;background:none;border-radius:4px;cursor:pointer;color:var(--text);white-space:nowrap;}   /* v73: nowrap (from Impo) */
:where(body.app-shell) .mi kbd,:where(body.app-shell) .mi .mi-key{margin-left:auto;font:400 9px var(--mono);color:var(--text-faint);padding-left:18px;}
:where(body.app-shell) .mi:hover:not(:disabled){background:var(--surface2);}
:where(body.app-shell) .mi:disabled{color:var(--text-faint);cursor:default;}
:where(body.app-shell) .mi-sep{height:1px;background:var(--border-light);margin:4px 2px;}
:where(body.app-shell) .mi .mi-chk,:where(body.app-shell) .mi-chk{width:10px;display:inline-block;text-align:center;font-size:9px;flex-shrink:0;}
:where(body.app-shell) .mi .mi-label{flex:1;}
:where(body.app-shell) .col-right .col-section:where(:not(.fp-body)){border:1px solid var(--border);background:var(--surface);border-radius:var(--radius-lg);padding:10px;margin-bottom:10px;}
:where(body.app-shell) .col-right .col-section.fpanel{border-radius:var(--radius);padding:0;}   /* v47: panes use the compact card (title bar and body carry their own padding) */

/* narrow screens: the columns stack, floaters are off */
@media (max-width:700px){
  body.app-shell{height:auto;overflow:visible;display:block;}
  :where(body.app-shell) .three-col{flex-direction:column;padding-bottom:20px;}
  :where(body.app-shell) .col-left,:where(body.app-shell) .col-right,:where(body.app-shell) .col-main{width:100%;height:auto;overflow:visible;padding-right:0;}
  :where(body.app-shell) .fp-float{display:none;}
  :where(body.app-shell) .stats-grid{grid-template-columns:1fr 1fr;}
}
@media print{
  body.app-shell{padding:0;height:auto;overflow:visible;display:block;}
  :where(body.app-shell) header.app-header,:where(body.app-shell) .col-left,:where(body.app-shell) .col-right,:where(body.app-shell) .btn-pill,:where(body.app-shell) .fpanel.floating,:where(body.app-shell) .float-pop,:where(body.app-shell) .fp-home,:where(body.app-shell) .fp-line,:where(body.app-shell) .menubar{display:none!important;}
}
/* a floating popup's title bar (Color, Separations, Trim box, ...): same compact bar as a panel. The -8px side margins assume the popup has 8px side padding. */
:where(body.app-shell) .float-pop .cp-head{padding:5px 6px 5px 8px;margin:0 -8px 6px;border-bottom:1px solid var(--border-light);font-size:9px;letter-spacing:.04em;}

/* ============================================================
 * v73 — Imposition Builder moved onto the kit. Added under the same opt-in (body.app-shell, zero specificity):
 *  - the custom checkbox look (Impo's; replaces the browser checkbox in every app-shell tool)
 *  - Impo's panel system: .fpanel / .fp-head / .fp-title / .fp-btn / .fp-body / .dock-ind, docked and floating panes
 *  - Impo's dialog shell: .modal-overlay / .modal-card and the .dlg-head / .dlg-body / .dlg-nav / .dlg-main / .dlg-foot layout
 *  - small changes above: .col-main scrollbar-gutter, .mi nowrap, and .col-right .col-section no longer wraps a pane body (.fp-body)
 * Tokens only. STDPDF uses different names for the same purpose (.ob-btn, h4.sec-title, .share-*, .pref-*); unify later.
 * ============================================================ */
:where(body.app-shell) input[type="checkbox"]{-webkit-appearance:none;appearance:none;width:12px!important;height:12px!important;margin:3px 4px 3px 4px;padding:0!important;flex:none;border:1px solid var(--border);border-radius:3px;background:var(--surface);position:relative;cursor:pointer;vertical-align:middle;box-sizing:border-box;}
:where(body.app-shell) input[type="checkbox"]:hover{border-color:var(--text-muted);}
:where(body.app-shell) input[type="checkbox"]:checked{background:var(--accent);border-color:var(--accent);}
:where(body.app-shell) input[type="checkbox"]:checked::after{content:"";position:absolute;left:3px;top:0;width:3px;height:7px;border:solid var(--on-accent);border-width:0 1.5px 1.5px 0;transform:rotate(45deg);}
:where(body.app-shell) input[type="checkbox"]:disabled{opacity:.45;cursor:not-allowed;}
:where(body.app-shell) .modal-overlay{position:fixed;inset:0;background:var(--scrim);display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px;}
:where(body.app-shell) .modal-card{background:var(--surface);border-radius:var(--radius-lg);padding:24px;max-width:400px;width:100%;max-height:90vh;overflow-y:auto;box-shadow:var(--shadow-modal);}
:where(body.app-shell) .modal-card h3{margin:0 0 16px;font:500 13px var(--mono);text-transform:uppercase;letter-spacing:.04em;}
:where(body.app-shell) .fpanel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);display:flex;flex-direction:column;min-height:0;}
:where(body.app-shell) .fpanel.docked{margin-bottom:10px;}
:where(body.app-shell) .fpanel.docked.fp-scroll{max-height:60vh;}
:where(body.app-shell) .fpanel.floating{position:fixed;box-shadow:var(--shadow-pop-lg);width:270px;max-height:calc(100vh - 16px);resize:both;overflow:hidden;min-width:200px;min-height:44px;}
:where(body.app-shell) .fpanel.floating.collapsed{resize:none;height:auto!important;min-height:0;}
:where(body.app-shell) .fpanel.fp-ph{border-style:dashed;background:var(--surface2);}
:where(body.app-shell) .fpanel.fp-ph .fp-head{border-bottom:none;}
:where(body.app-shell) .fpanel.fp-dragging{opacity:.4;}
:where(body.app-shell) .fpanel.collapsed > .fp-body{display:none;}
:where(body.app-shell) .fpanel.collapsed > .fp-head{border-bottom:none;}
:where(body.app-shell) .fp-head{display:flex;align-items:center;gap:5px;padding:5px 6px 5px 8px;border-bottom:1px solid var(--border-light);cursor:pointer;flex-shrink:0;user-select:none;}
:where(body.app-shell) .fpanel.floating > .fp-head{cursor:move;}
:where(body.app-shell) .fp-head .fp-fold{transition:transform .15s;}
:where(body.app-shell) .fpanel:not(.collapsed):not(.fp-ph) > .fp-head .fp-fold{transform:rotate(90deg);}
:where(body.app-shell) .fp-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:500 9px var(--title-font,var(--mono));letter-spacing:.04em;text-transform:uppercase;color:var(--title-color,var(--text-muted));}
:where(body.app-shell) .fp-title h4{margin:0!important;font:inherit!important;letter-spacing:inherit;text-transform:inherit;color:inherit;display:inline;}
:where(body.app-shell) .fp-sub{text-transform:none;letter-spacing:0;color:var(--text-faint);margin-left:4px;}
:where(body.app-shell) .fp-extra{display:flex;align-items:center;gap:4px;flex-shrink:0;}
:where(body.app-shell) .fp-btn{background:none;border:none;color:var(--text-muted);cursor:pointer;font-size:11px;padding:1px 5px;border-radius:3px;flex-shrink:0;}
:where(body.app-shell) .fp-btn:hover{background:var(--surface2);color:var(--text);}
:where(body.app-shell) .fp-body{flex:1 1 auto;min-height:0;overflow:auto;padding:6px 6px 8px;}
:where(body.app-shell) .fpanel .fp-body.col-section{margin:0;padding:8px 10px 10px;}
:where(body.app-shell) .fpanel.docked:not(.fp-scroll) .fp-body{overflow:visible;}
:where(body.app-shell) .fp-body.drag{outline:2px dashed var(--blue);outline-offset:-2px;}
:where(body.app-shell) .dock-ind{height:3px;background:var(--blue);border-radius:2px;margin:0 0 7px;pointer-events:none;}
:where(body.app-shell) .modal-card.wide{max-width:980px;padding:0;display:flex;flex-direction:column;height:86vh;}
:where(body.app-shell) .modal-card.mid{max-width:560px;}
:where(body.app-shell) .dlg-head{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:1px solid var(--border-light);}
:where(body.app-shell) .dlg-head h3{margin:0!important;flex:1;}
:where(body.app-shell) .dlg-body{flex:1;min-height:0;display:flex;}
:where(body.app-shell) .dlg-nav{width:190px;flex-shrink:0;border-right:1px solid var(--border-light);overflow:auto;padding:8px;}
:where(body.app-shell) .dlg-nav .nav-item{display:block;width:100%;text-align:left;background:none;border:none;font:400 11px var(--sans);padding:6px 8px;border-radius:4px;cursor:pointer;color:var(--text);}
:where(body.app-shell) .dlg-nav .nav-item.active{background:var(--tint-info);font-weight:500;}
:where(body.app-shell) .dlg-main{flex:1;min-width:0;overflow:auto;padding:14px 18px;}
:where(body.app-shell) .dlg-foot{display:flex;gap:8px;align-items:center;padding:10px 16px;border-top:1px solid var(--border-light);}
:where(body.app-shell) .dlg-foot .spacer{flex:1;}

/* ============================================================
 * v74 - UI font token, floater title color, hint size, tool-tip switch.
 *  - --mono is the UI font now (see :root); --title-font / --title-color / --hint-fs are the new knobs.
 *  - TOOL TIPS preference: a module adds class "no-tips" to <body> when the user turns tool tips off; any element
 *    with class "tip" (explanatory hint text, not warnings or results) is hidden. Impo: Edit > Preferences > General.
 * ============================================================ */
body.no-tips .tip{display:none!important;}

/* ============================================================
 * v76 - Print Tools header brand + footer (built by shared/ptchrome.js).
 *  Header: brand "Print Tools(TM)" (+ module name) on the left, Dashboard pill on the right.
 *  Footer: <year> Print Tools(TM) by Branson Jones | Contact Us - Help - Terms - Privacy - Feedback | module version.
 *  Tokens only. Not tied to body.app-shell (the placeholder pages use it too); in an app-shell tool the footer is a thin
 *  bar under the columns (flex-shrink:0), on a classic page it sits at the end of the page.
 * ============================================================ */
.pt-brandrow{display:flex;align-items:center;gap:14px;min-width:0;}
.pt-brand{display:inline-flex;align-items:center;gap:6px;font:500 17px/1 var(--font,var(--sans));letter-spacing:.01em;color:var(--text);text-decoration:none;white-space:nowrap;}
.pt-logo{width:24px;height:24px;flex-shrink:0;display:block;}
.pt-brand:hover{opacity:.8;}
.pt-tm{font-size:.5em;vertical-align:super;line-height:0;margin-left:1px;}
.pt-module{font:500 13px var(--font,var(--sans));letter-spacing:.04em;text-transform:uppercase;color:var(--text-muted);white-space:nowrap;}
.pt-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 18px;flex-shrink:0;box-sizing:border-box;padding:7px 24px;border-top:1px solid var(--border-light);background:var(--surface);font:400 10px var(--font,var(--sans));color:var(--text-muted);letter-spacing:.02em;}
.pt-footer a{color:var(--text-muted);text-decoration:none;}
.pt-footer a:hover{color:var(--text);text-decoration:underline;}
.pt-foot-links{display:flex;flex-wrap:wrap;gap:2px 14px;}
.pt-foot-ver{color:var(--text-faint);white-space:nowrap;}
/* placeholder pages (Contact Us, Help, Terms, Privacy) */
.pt-page{flex:1;min-height:0;overflow:auto;padding:48px 24px;box-sizing:border-box;}
.pt-page-inner{max-width:720px;margin:0 auto;}
.pt-page h1{font:500 26px var(--font,var(--sans));margin:0 0 14px;}
.pt-page p{font:400 14px/1.6 var(--font,var(--sans));color:var(--text-muted);margin:0 0 10px;}
@media print{ .pt-footer{display:none!important;} }

/* ============================================================
 * v77 - tokens for Imposition Builder v103 (Pre-Folder Trim Size rectangle).
 *  The rectangle drawn behind the pages of a folded Form: green when it fits the sheet, red when it does not.
 *  Own tokens, not --tint-ok / --tint-danger, so the "processed" pills and warning banners can change without touching it.
 *  Schematic pages need no new tokens: white = --paper, border = the source file's --file-N color, a pin = --blue.
 * ============================================================ */
:root {
  --pfts-ok-bg: #d6ebdb;      --pfts-ok-edge: #6fae7c;
  --pfts-bad-bg: #f6d3ce;     --pfts-bad-edge: var(--red);
}

/* ============================================================
 * v78 - collapsible arrows are DRAWN, not a font character (Imposition Builder v117, B Nov 12: the new drop area's arrow came out smaller
 * than every other one on his screen). Roboto Condensed has no arrow glyph (U+25BA), so each browser borrowed one from whatever font it
 * picked, and the pick could differ from one place on the page to another. Every .col-section-toggle-arrow (section and floater title bars,
 * the Job sub-sections, Distances, Trim allowances, Gang sections, Standardize PDF panes) now draws the same 6 x 8 px triangle in its color,
 * pointing right; .open turns it down, as before. The character stays in the markup (for screen readers / text copies) and is not shown.
 * RULE (look and feel, B Nov 12): arrows for collapsibles, dropdowns and the like match the existing ones; a new one copies an existing item.
 * ============================================================ */
:where(body.app-shell) .col-section-toggle-arrow{font-size:0!important;line-height:0!important;width:9px;height:9px;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;}
:where(body.app-shell) .col-section-toggle-arrow::before{content:"";display:block;width:0;height:0;border-style:solid;border-width:4px 0 4px 6px;border-color:transparent transparent transparent currentColor;}

/* ============================================================
 * v79 - SMALL-TOOL KIT (core_2.js, window.PTK; Gang Run v4, Roll Fold v4, Color Build v4, Sets & Sheets v4, Set Build v4, Data Tools v5).
 *  Same opt-in as the app shell (body.app-shell, zero specificity through :where()); nothing here changes Standardize PDF,
 *  Imposition Builder or Dropzone: every class below is new (.ptk-*, .pt-print-*, .side-calc.docked).
 *  - compact value rows (.ptk-row: label left, a short field right), bordered tool box (.ptk-box), pill rows (.ptk-seg),
 *    slider + field (.ptk-slide), the green drop area of Standardize PDF (.ptk-drop), loaded-file line (.ptk-file)
 *  - the side calculator docked in a column section (.side-calc.docked)
 *  - the printed page: header (logo, Print Tools, tool name, job, date), Settings block, footer line on every page
 *  Tokens only.
 * ============================================================ */
:where(body.app-shell) .ptk-row{display:flex;align-items:center;gap:6px;margin:0 0 5px;min-height:22px;}
:where(body.app-shell) .ptk-row > label,:where(body.app-shell) .ptk-row > .ptk-lbl{flex:1;min-width:0;font:400 9px var(--mono);color:var(--text-muted);letter-spacing:.02em;line-height:1.25;cursor:default;}
:where(body.app-shell) .col-section .ptk-row input.ptk-num,:where(body.app-shell) .ptk-row input.ptk-num{width:62px!important;flex:none;text-align:right;}
:where(body.app-shell) .col-section .ptk-row input.ptk-num.w2,:where(body.app-shell) .ptk-row input.ptk-num.w2{width:84px!important;}
:where(body.app-shell) .col-section .ptk-row select.ptk-sel,:where(body.app-shell) .ptk-row select.ptk-sel{width:118px!important;flex:none;}
:where(body.app-shell) .ptk-unit{font:400 8px var(--mono);color:var(--text-faint);width:12px;flex:none;}
:where(body.app-shell) .col-section .ptk-field{display:flex;flex-direction:column;gap:3px;margin:0 0 6px;}
:where(body.app-shell) .col-section .ptk-field > label{font:400 9px var(--mono);color:var(--text-muted);letter-spacing:.02em;}
:where(body.app-shell) .ptk-box{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);padding:8px 9px 3px;margin:0 0 10px;}
:where(body.app-shell) .ptk-box-title{font:500 8px var(--title-font,var(--mono));letter-spacing:.04em;text-transform:uppercase;color:var(--title-color,var(--text-muted));margin:0 0 7px;}
:where(body.app-shell) .ptk-sub{border-top:1px solid var(--border-light);margin:8px -9px 0;padding:7px 9px 2px;}
:where(body.app-shell) .ptk-seg{display:flex;gap:4px;flex-wrap:wrap;margin:0 0 8px;}
:where(body.app-shell) .ptk-seg .btn-pill{flex:1 1 0;min-width:0;white-space:nowrap;}
:where(body.app-shell) .ptk-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin:6px 0 8px;}
:where(body.app-shell) .ptk-actions .btn-pill{flex:1 1 auto;}
:where(body.app-shell) .ptk-slide{display:flex;align-items:center;gap:6px;margin:0 0 6px;}
:where(body.app-shell) .ptk-slide input[type="range"]{flex:1;min-width:0;}
:where(body.app-shell) input[type="range"]{-webkit-appearance:none;appearance:none;height:4px;background:var(--border-light);border-radius:100px;outline:none;padding:0;border:none;cursor:pointer;}
:where(body.app-shell) input[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:12px;height:12px;border-radius:50%;background:var(--accent);cursor:pointer;}
:where(body.app-shell) input[type="range"]::-moz-range-thumb{width:12px;height:12px;border-radius:50%;background:var(--accent);border:none;cursor:pointer;}
:where(body.app-shell) .ptk-drop{border:1.5px dashed var(--border);border-radius:var(--radius-lg);background:var(--tint-drop);padding:11px 8px;margin:0 0 4px;text-align:center;cursor:pointer;font:400 9px var(--mono);color:var(--text-muted);letter-spacing:.03em;line-height:1.3;transition:border-color .15s,background .15s;}
:where(body.app-shell) .ptk-drop strong{color:var(--text);font-weight:400;}
:where(body.app-shell) .ptk-drop:hover,:where(body.app-shell) .ptk-drop.drag-over{background:var(--tint-drop-hover);border-color:var(--accent);color:var(--text);}
:where(body.app-shell) .ptk-drop:focus-visible{outline:2px solid var(--blue);outline-offset:1px;}
:where(body.app-shell) .ptk-file{display:flex;align-items:center;gap:4px;font:400 9px var(--mono);color:var(--text);margin:2px 0 6px;min-height:14px;}
:where(body.app-shell) .ptk-file .ptk-fname{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
:where(body.app-shell) .ptk-file .ptk-fmeta{color:var(--text-faint);white-space:nowrap;}
:where(body.app-shell) .ptk-file:empty{display:none;}
:where(body.app-shell) .ptk-x{background:none;border:none;color:var(--text-muted);cursor:pointer;font:400 11px/1 var(--mono);padding:1px 4px;border-radius:3px;}
:where(body.app-shell) .ptk-x:hover{background:var(--surface2);color:var(--red);}
:where(body.app-shell) .ptk-err{font:400 var(--hint-fs,9.5px) var(--sans);color:var(--red);margin:2px 0 6px;line-height:1.35;}
:where(body.app-shell) .ptk-err:empty{display:none;}
:where(body.app-shell) .ptk-note{font:400 var(--hint-fs,9.5px) var(--sans);color:var(--text-muted);background:var(--surface2);border:1px solid var(--border-light);border-radius:var(--radius);padding:6px 8px;margin:4px 0 8px;line-height:1.4;}
:where(body.app-shell) .ptk-note.warn{background:var(--tint-warn);border-color:var(--warn-border);color:var(--text);}
:where(body.app-shell) .ptk-note:empty{display:none;}
:where(body.app-shell) .ptk-arrow{display:inline-block;vertical-align:middle;}
:where(body.app-shell) .ptk-dialog-text{font:400 12px/1.5 var(--sans);color:var(--text);margin:0;}
:where(body.app-shell) .ptk-pref-body .ptk-row > label{font-size:10px;}
:where(body.app-shell) .ptk-pref-body p.hint{margin:2px 0 10px;}
:where(body.app-shell) .ptk-main-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px 16px;margin:0 0 14px;}
:where(body.app-shell) .ptk-main-card > .card-title{font-size:9px;margin-bottom:10px;}
:where(body.app-shell) .ptk-empty{border:1px dashed var(--border);border-radius:var(--radius-lg);padding:46px 20px;text-align:center;color:var(--text-faint);font:400 12px var(--sans);margin:0 0 14px;}
/* the side calculator docked in a column section (core_2) */
:where(body.app-shell) .side-calc.docked{position:static;display:flex;width:auto;padding:0;border:none;box-shadow:none;background:none;gap:5px;z-index:auto;}
:where(body.app-shell) .side-calc.docked .side-calc-label{display:none;}
:where(body.app-shell) .side-calc.docked .calc-display{min-height:34px;font-size:15px;padding:5px 8px;}
:where(body.app-shell) .side-calc.docked .calc-btn{height:26px;font-size:11px;}
:where(body.app-shell) .side-calc.docked .calc-grid{gap:4px;}
/* the printed page (File > Print...): hidden on screen */
.pt-print-head,.pt-print-inputs,.pt-print-foot{display:none;}
@media print{
  @page{margin:0.45in 0.45in 0.6in;}
  body.app-shell{background:var(--paper,#fff);}
  :where(body.app-shell) .three-col{display:block!important;padding:0!important;height:auto!important;}
  :where(body.app-shell) .col-main{height:auto!important;overflow:visible!important;padding:0!important;}
  :where(body.app-shell) .side-calc,:where(body.app-shell) .ptk-noprint,:where(body.app-shell) #defaultsToast{display:none!important;}
  :where(body.app-shell) .ptk-main-card,:where(body.app-shell) .sheet-grid,:where(body.app-shell) .foldbar,:where(body.app-shell) .compbar,:where(body.app-shell) tr{break-inside:avoid;}
  :where(body.app-shell) *{-webkit-print-color-adjust:exact;print-color-adjust:exact;}
  .pt-print-head{display:flex!important;align-items:center;gap:10px;border-bottom:1px solid var(--border);padding:0 0 8px;margin:0 0 10px;}
  .pt-print-head .pt-logo{width:28px;height:28px;}
  .pt-print-brand{display:flex;flex-direction:column;flex:1;min-width:0;}
  .pt-print-pt{font:500 15px var(--font,var(--sans));color:var(--text);}
  .pt-print-tool{font:500 11px var(--font,var(--sans));letter-spacing:.04em;text-transform:uppercase;color:var(--text-muted);}
  .pt-print-job{text-align:right;font:400 11px var(--font,var(--sans));color:var(--text);}
  .pt-print-inputs{display:block!important;margin:0 0 10px;}
  .pt-print-label{font:500 9px var(--font,var(--sans));letter-spacing:.06em;text-transform:uppercase;color:var(--text-muted);margin:0 0 3px;}
  .pt-print-table{width:auto!important;border-collapse:collapse;font:400 10px var(--font,var(--sans));}
  .pt-print-table th,.pt-print-table td{padding:1px 14px 1px 0!important;border:none!important;text-align:left!important;text-transform:none!important;letter-spacing:0!important;font-size:10px!important;color:var(--text)!important;}
  .pt-print-table th{color:var(--text-muted)!important;font-weight:400;}
  .pt-print-foot{display:block!important;position:fixed;left:0;right:0;bottom:0;padding:4px 0 0;border-top:1px solid var(--border-light);font:400 9px var(--font,var(--sans));color:var(--text-muted);background:var(--paper,#fff);}
}
/* the small-tool pages carry body.ptk: there an element with the hidden attribute is always hidden, whatever display its class gives it */
body.ptk [hidden]{display:none!important;}
:where(body.app-shell) .ptk-cap{font:400 9px var(--mono);color:var(--text-muted);letter-spacing:.02em;margin:8px 0 3px;}
