/* The editor (/editor), from the design canvas (design/print-label-20261001/canvas/Editor.dc.html): an ink bar, the
   list on the left, the sheet at scale on the green mat, lettering and sheet settings on the right; under 900 px one
   pane at a time behind List / Sheet / Style tabs. Colors and fonts are the site's tokens (web/styles.css) with the
   design's values as fallbacks. CSP-safe: what the module places is set through custom properties (--ppi, --x…). */

.ed {
  --ed-mat: var(--mat, #1E4A3B);
  --ed-paper: var(--paper, #FFFFFF);
  --ed-desk: var(--desk, #EEF0EA);
  --ed-ink: var(--ink, #13233A);
  --ed-line: var(--line, #DDE3DA);
  --ed-cyan: var(--cyan, #8FD8E6);
  --ed-cyan-ink: var(--cyan-ink, #1B6E80);
  --ed-apricot: var(--apricot, #F2A65A);
  --ed-display: var(--font-display, "Bricolage Grotesque"), system-ui, sans-serif;
  --ed-body: var(--font-body, "Instrument Sans"), system-ui, -apple-system, "Segoe UI", sans-serif;
  --ed-mono: var(--font-mono, "Martian Mono"), ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ed-soft: #F4F6F2;
  --ed-rule: #EEF1EC;
  --ed-muted: #5B6B7B;
  --ed-faint: #66737F;
  --ed-ink-soft: #33465C;
  --ed-chip-line: #CBD3C8;
  --ed-dash: #C7CFC3;
  --ed-warm: #FFF1DF;
  --ed-warm-soft: #FFF7EC;
  --ed-green-soft: #E6F2EE;
  --ed-focus: var(--ed-cyan-ink);
  --ed-ease: cubic-bezier(.3, .7, .3, 1);
  --row-h: 46px;
  position: relative;
  display: flex;
  flex-direction: column;
  height: max(620px, calc(100vh - var(--ed-top, 72px)));
  height: max(620px, calc(100dvh - var(--ed-top, 72px)));
  background: var(--ed-desk);
  color: var(--ed-ink);
  font: 400 15px/1.45 var(--ed-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* Resets inside :where() weigh nothing, so every component class below wins over them. */
:where(.ed) *, :where(.ed) *::before, :where(.ed) *::after { box-sizing: border-box; }
.ed [hidden] { display: none !important; }
:where(.ed) :where(h2, h3, p) { margin: 0; }
:where(.ed) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.ed) :focus-visible { outline: 3px solid var(--ed-focus); outline-offset: 2px; }
.ed-vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ed-icon { flex: none; }
.ed-noscript { margin: 16px 20px 0; padding: 12px 16px; border-radius: 12px; background: var(--ed-warm); }

/* ---------- buttons, links, fields ---------- */

.ed-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--ed-chip-line); background: var(--ed-paper); color: var(--ed-ink); font: 600 15px/1.1 var(--ed-body); text-decoration: none; cursor: pointer; transition: transform .2s ease, border-color .2s ease, background-color .2s ease; }
.ed-btn:hover { border-color: var(--ed-ink); transform: translateY(-1px); }
.ed-btn-dark { background: var(--ed-ink); border-color: var(--ed-ink); color: #FFFFFF; }
.ed-btn-dark:hover { background: var(--ed-mat); border-color: var(--ed-mat); }
.ed-btn-small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.ed-btn:disabled { opacity: .45; cursor: default; transform: none; }
.ed-link { padding: 4px 0; border: 0; background: none; color: var(--ed-ink); font: 600 13px/1.3 var(--ed-body); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer; }
.ed-link:hover { color: var(--ed-mat); text-decoration-thickness: 2px; }
.ed-eyebrow { display: block; font: 500 11px/1.3 var(--ed-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ed-muted); }
.ed-hint { font-size: 13px; line-height: 1.45; color: var(--ed-muted); }
:where(.ed) :where(select, textarea, input[type="text"], input[type="search"]) { width: 100%; min-height: 40px; padding: 8px 12px; border: 1.5px solid var(--ed-line); border-radius: 10px; background: var(--ed-paper); color: var(--ed-ink); font: 400 14px/1.35 var(--ed-body); }
:where(.ed) select { padding-right: 32px; appearance: none; background: var(--ed-paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%2313233A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 12px center / 12px no-repeat; text-overflow: ellipsis; cursor: pointer; }
:where(.ed) :where(select, textarea, input[type="text"], input[type="search"]):hover { border-color: var(--ed-chip-line); }
:where(.ed) textarea { min-height: 112px; resize: vertical; font: 400 12.5px/1.6 var(--ed-mono); tab-size: 4; }
.ed-box { appearance: none; flex: none; width: 18px; height: 18px; margin: 0; border: 1.5px solid #9FB0A6; border-radius: 5px; background: var(--ed-paper) center / 12px no-repeat; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.ed-box:checked { border-color: var(--ed-mat); background-color: var(--ed-mat); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.5l2.2 2.2 4.8-5' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ed-box:indeterminate { border-color: var(--ed-mat); background-color: var(--ed-mat); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6h6' stroke='white' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); }
.ed-box[aria-disabled="true"], .ed-box:disabled { opacity: .4; cursor: default; }

/* ---------- the bar ---------- */

.ed-bar { --ed-focus: var(--ed-apricot); position: relative; z-index: 5; flex: none; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 20px; background: var(--ed-ink); color: #FFFFFF; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
.ed-file, .ed-tpl-button { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; background: rgba(255, 255, 255, .08); font: 500 12px/1 var(--ed-mono); white-space: nowrap; }
.ed-file { min-width: 0; max-width: 300px; }
.ed-file span { overflow: hidden; text-overflow: ellipsis; }
.ed:not(.has-list) .ed-file rect { fill: rgba(255, 255, 255, .28); }
.ed-tpl { position: relative; min-width: 0; }
.ed-tpl-button { max-width: 100%; border: 0; color: #FFFFFF; cursor: pointer; transition: background-color .2s ease; }
.ed-tpl-button:hover, .ed-tpl-button[aria-expanded="true"] { background: rgba(255, 255, 255, .16); }
.ed-tpl-name { font-weight: 600; }
.ed-tpl-meta { overflow: hidden; text-overflow: ellipsis; color: rgba(255, 255, 255, .78); }
.ed-tpl-meta::before { content: "· "; }
.ed-bar-space { flex: 1; }
.ed-cal { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 8px 6px; border-radius: 8px; color: #BFE3D5; font: 500 12px/1.2 var(--ed-mono); text-decoration: none; white-space: nowrap; }
.ed-cal span:last-child { overflow: hidden; text-overflow: ellipsis; }
.ed-cal:hover { color: #FFFFFF; text-decoration: underline; text-underline-offset: 3px; }
.ed-cal-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #7BCB9E; }
.ed-cal.is-off { color: rgba(255, 255, 255, .78); }
.ed-cal.is-off .ed-cal-dot { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .6); }
.ed .ed-bar .button.button-primary { display: inline-flex; align-items: center; gap: 10px; flex: none; min-height: 42px; margin: 0; padding: 0 18px; border: 0; border-radius: 12px; background: var(--ed-apricot); color: var(--ed-ink); font: 600 15px/1 var(--ed-body); white-space: nowrap; cursor: pointer; box-shadow: 0 10px 24px -10px rgba(242, 166, 90, .9); transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease; }
.ed .ed-bar .button.button-primary::before { content: ""; flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 2.5v7.5M4.5 6.8L8 10.3l3.5-3.5M3 13.5h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%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 16 16'%3E%3Cpath d='M8 2.5v7.5M4.5 6.8L8 10.3l3.5-3.5M3 13.5h10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.ed .ed-bar .button.button-primary:hover:not(:disabled) { background: #F5B371; transform: translateY(-2px); }
.ed .ed-bar .button.button-primary:disabled { opacity: 1; background: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .6); box-shadow: none; cursor: default; transform: none; }

/* The template finder: a panel under the bar's template button. */
.ed-tpl-panel { --ed-focus: var(--ed-cyan-ink); position: absolute; top: calc(100% + 12px); left: 0; z-index: 10; width: min(420px, calc(100vw - 32px)); padding: 20px; border-radius: 18px; background: var(--ed-paper); color: var(--ed-ink); box-shadow: 0 28px 56px -24px rgba(9, 26, 20, .5), 0 3px 10px rgba(9, 26, 20, .16); }
.ed-tpl-title { margin-bottom: 14px; font: 650 18px/1.2 var(--ed-display); letter-spacing: -.01em; }
.ed-tpl-panel .ed-eyebrow { margin-bottom: 8px; }
.ed-tpl-search { position: relative; }
.ed-tpl-search .ed-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ed-ink); pointer-events: none; }
.ed .ed-tpl-search input { height: 60px; padding: 0 16px 0 48px; border: 2px solid var(--ed-ink); border-radius: 14px; font: 600 26px/1 var(--ed-mono); letter-spacing: .04em; }
.ed-tpl-help { min-height: 2.9em; margin: 10px 0 8px; font-size: 14px; line-height: 1.45; color: var(--ed-muted); }
.ed-tpl-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ed-tpl-suggest:empty { display: none; }
.ed-suggest { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--ed-chip-line); background: var(--ed-paper); color: var(--ed-ink); font: 500 14px/1 var(--ed-body); cursor: pointer; transition: border-color .2s ease, transform .2s ease; }
.ed-suggest:hover { border-color: var(--ed-mat); transform: translateY(-1px); }
.ed-suggest-n { font: 600 13px/1 var(--ed-mono); }
.ed-tpl-foot { display: flex; justify-content: flex-end; margin-top: 16px; }

/* ---------- tabs (phones) and the three panes ---------- */

.ed-tabs { display: none; }
.ed-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(330px, 420px) minmax(0, 1fr) minmax(280px, 330px); grid-template-rows: minmax(0, 1fr); }
.ed-pane { min-width: 0; min-height: 0; grid-row: 1; }
.ed-list { grid-column: 1; }
.ed-sheet { grid-column: 2; }
.ed-style { grid-column: 3; }
.ed-list { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--ed-paper); border-right: 1px solid var(--ed-line); }
.ed-head { flex: none; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.ed-head h2 { font: 650 17px/1.2 var(--ed-display); letter-spacing: -.01em; }
.ed-count { font: 500 11px/1.3 var(--ed-mono); color: var(--ed-muted); text-align: right; }

.ed-notice, .ed-dupes, .ed-fit { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--ed-soft); font-size: 13px; line-height: 1.45; }
.ed-notice .ed-icon, .ed-dupes .ed-icon, .ed-fit .ed-icon { margin-top: 1px; color: var(--ed-cyan-ink); }
.ed-notice { flex: none; margin: 0 20px 12px; background: var(--ed-warm); }
.ed-notice-body { flex: 1; min-width: 0; }
.ed-notice-actions { display: flex; flex-wrap: wrap; gap: 2px 16px; margin-top: 4px !important; }
.ed-notice-close { display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin: -4px -6px -4px 0; border: 0; border-radius: 8px; background: none; color: var(--ed-ink); cursor: pointer; }
.ed-notice-close:hover { background: rgba(19, 35, 58, .08); }

/* Empty: the import card. */
.ed-import { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 0 20px 20px; }
.ed-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 20px 24px; border: 1.5px dashed var(--ed-dash); border-radius: 18px; background: var(--ed-soft); text-align: center; transition: border-color .25s ease, background-color .25s ease; }
.ed.is-dragging .ed-drop { border-color: var(--ed-mat); background: var(--ed-green-soft); }
.ed.is-dragging.has-list .ed-list::after { content: "Drop the file to open it instead"; position: absolute; inset: 12px; z-index: 3; display: grid; place-items: center; padding: 24px; border: 2px dashed var(--ed-mat); border-radius: 16px; background: rgba(230, 242, 238, .94); font: 650 18px/1.3 var(--ed-display); text-align: center; pointer-events: none; }
.ed-drop-art { margin-bottom: 4px; }
.ed-drop-title { font: 650 19px/1.25 var(--ed-display); letter-spacing: -.01em; }
.ed-drop-hint { font-size: 14px; color: var(--ed-muted); }
.ed-drop-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
#file:focus-visible + label { outline: 3px solid var(--ed-focus); outline-offset: 2px; }
.ed-paste { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ed-field-label { font-weight: 600; font-size: 14px; }
.ed-privacy { display: flex; align-items: flex-start; gap: 10px; margin-top: auto !important; font-size: 13px; line-height: 1.5; color: #4A5B6B; }
.ed-privacy .ed-icon { margin-top: 2px; color: var(--ed-mat); }
.ed-list-foot { flex: none; margin: 0 !important; padding: 12px 20px 14px; border-top: 1px solid var(--ed-rule); }

/* Loaded: the list. */
.ed-loaded { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ed-source { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 0 20px 12px; font-size: 13px; color: var(--ed-ink-soft); }
.ed-source-name { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.ed-unused { flex: 1 1 100%; min-width: 0; color: var(--ed-muted); overflow-wrap: anywhere; }
.ed-unused .ed-link { white-space: nowrap; }
.ed-sheet-pick { display: flex; align-items: center; gap: 8px; }
.ed-sheet-pick label { font-weight: 600; }
.ed .ed-sheet-pick select { width: auto; max-width: 180px; min-height: 34px; padding-top: 4px; padding-bottom: 4px; }

.ed-lines-toggle { flex: none; display: flex; flex-direction: column; gap: 8px; margin: 0 20px 12px; padding: 0; border: 0; border-radius: 12px; background: none; color: var(--ed-ink); text-align: left; cursor: pointer; }
.ed-tiles { display: flex; gap: 8px; width: 100%; }
.ed-tile { flex: 1 1 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 8px 10px; border-radius: 8px; background: var(--ed-green-soft); font: 500 10px/1.35 var(--ed-mono); text-transform: uppercase; letter-spacing: .02em; transition: transform .2s ease; }
.ed-tile:first-child { background: var(--ed-warm); }
.ed-tile-k { color: var(--ed-muted); }
.ed-tile-v { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; color: var(--ed-ink); }
.ed-tile-more { flex: 0 0 44px; flex-direction: row; align-items: center; justify-content: center; font-weight: 600; }
.ed-lines-toggle-text { display: inline-flex; align-items: center; gap: 6px; font: 600 13px/1.3 var(--ed-body); text-decoration: underline; text-underline-offset: 3px; }
.ed-lines-toggle-text .ed-icon { transition: transform .25s ease; }
.ed-lines-toggle[aria-expanded="true"] .ed-lines-toggle-text .ed-icon { transform: rotate(180deg); }
.ed-lines-toggle:hover .ed-tile { transform: translateY(-1px); }

.ed-columns { flex: 0 1 auto; min-height: 150px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; margin: 0 0 12px; padding: 14px 20px 16px; border-top: 1px solid var(--ed-rule); border-bottom: 1px solid var(--ed-rule); background: #FAFBF8; }
.ed-subhead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 10px; }
.ed-subhead h3 { font: 650 15px/1.2 var(--ed-display); }
.ed-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.ed-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ed-mat); }
.ed-map-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-map-item { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-height: 36px; padding: 0 2px 0 12px; border: 1.5px dashed var(--ed-chip-line); border-radius: 999px; background: var(--ed-paper); transition: border-color .2s ease, background-color .2s ease; }
.ed-map-item.is-set { border-style: solid; border-color: #B9D3C8; background: var(--ed-green-soft); }
.ed-map-item:hover { border-color: var(--ed-mat); }
.ed-map-item label { flex: none; font: 600 10px/1 var(--ed-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ed-ink-soft); cursor: pointer; }
.ed .ed-map-item select { width: auto; min-width: 0; max-width: 168px; min-height: 30px; padding: 0 26px 0 8px; border: 0; border-radius: 999px; background-color: transparent; background-position: right 9px center; font-size: 13px; }
.ed-map-item:not(.is-set) select { color: var(--ed-muted); }
.ed-lines .ed-hint { margin: -4px 0 10px; }
.ed-line-list { display: grid; gap: 8px; margin: 0 0 10px; padding: 0; list-style: none; }
.ed-line { display: grid; grid-template-columns: 22px minmax(0, 1fr) repeat(3, 32px); align-items: center; gap: 4px; }
.ed-line-n { font: 600 11px/1 var(--ed-mono); color: var(--ed-faint); text-align: center; }
.ed .ed-line-input { min-height: 38px; padding: 6px 10px; font: 500 13px/1.3 var(--ed-mono); }
.ed .ed-line-input[aria-invalid="true"] { border-color: var(--ed-apricot); }
.ed-line-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--ed-ink-soft); cursor: pointer; }
.ed-line-btn::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.ed-line-btn:hover:not(:disabled) { background: var(--ed-soft); color: var(--ed-ink); }
.ed-line-btn:disabled { opacity: .3; cursor: default; }
.ed-line-up { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 8.5l4-4 4 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ed-line-down { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 5.5l4 4 4-4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ed-line-remove { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M4 4l6 6M10 4l-6 6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.ed-line-note { grid-column: 2 / -1; font-size: 12px; line-height: 1.4; color: #8A4F12; }
.ed-line-note:empty { display: none; }
.ed-lines .ed-eyebrow { margin: 16px 0 8px; }
.ed-insert { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-insert-chip { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--ed-chip-line); background: var(--ed-paper); color: var(--ed-ink); font: 500 12px/1 var(--ed-mono); cursor: pointer; transition: border-color .2s ease, transform .2s ease; }
.ed-insert-chip:hover { border-color: var(--ed-mat); transform: translateY(-1px); }
.ed-insert-chip::before { content: "+ "; color: var(--ed-faint); }

.ed-dupes { flex: none; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 4px 10px; margin: 0 20px 12px; }
.ed-dupes-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0 16px; }
.ed-find { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 0 20px 12px 14px; }
.ed-find .ed-box { margin: 0 4px 0 9px; }
.ed-search { position: relative; }
.ed-search .ed-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ed-faint); pointer-events: none; }
.ed .ed-search input { min-height: 36px; padding: 6px 10px 6px 34px; font-size: 13px; }
.ed .ed-find select { width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 13px; }

.ed-rows { position: relative; flex: 1 1 0; min-height: 168px; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--ed-rule); }
.ed-rows-body { position: relative; height: calc(var(--count, 0) * var(--row-h)); }
.ed-row { position: absolute; top: 0; left: 0; right: 0; height: var(--row-h); transform: translateY(calc(var(--i, 0) * var(--row-h))); border-bottom: 1px solid var(--ed-rule); background: var(--ed-paper); transition: background-color .25s ease; }
.ed-row-label { display: grid; grid-template-columns: 38px 28px minmax(0, 1fr) auto; align-items: center; height: 100%; padding: 0 14px 0 4px; cursor: pointer; }
.ed-row-n { font: 500 10px/1 var(--ed-mono); color: var(--ed-faint); text-align: center; }
.ed-row-text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; line-height: 1.25; color: var(--ed-ink-soft); }
.ed-row-text b { font-weight: 650; color: var(--ed-ink); }
.ed-row-tag { margin-left: 8px; font: 500 10px/1 var(--ed-mono); color: #8A4F12; white-space: nowrap; }
.ed-row:hover { background: #FAFBF8; }
.ed-row.is-twin { background: var(--ed-warm-soft); }
.ed-row.is-out .ed-row-text, .ed-row.is-out .ed-row-text b { color: var(--ed-faint); }
.ed-row.is-out .ed-row-text { text-decoration: line-through; text-decoration-color: rgba(102, 115, 127, .55); }
.ed-row.is-empty .ed-row-text { font-style: italic; color: var(--ed-faint); }
.ed-row:focus-within { z-index: 1; }
.ed-rows-empty { padding: 24px 20px; font-size: 14px; color: var(--ed-muted); text-align: center; }

/* ---------- the sheet ---------- */

.ed-sheet { --ed-focus: var(--ed-apricot); position: relative; display: flex; flex-direction: column; overflow: hidden; color: #FFFFFF; background-color: var(--ed-mat); background-image: linear-gradient(rgba(255, 255, 255, .10) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .10) 1px, transparent 1px), linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px); background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px; background-position: -1px -1px; }
.ed-pager { flex: none; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 16px 8px; }
.ed-pager-text { min-width: 140px; font: 500 12px/1 var(--ed-mono); letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.ed-nudge { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border-radius: 12px; border: 1.5px solid var(--ed-chip-line); background: var(--ed-paper); color: var(--ed-ink); cursor: pointer; transition: border-color .2s ease, background-color .2s ease; }
.ed-nudge:hover:not(:disabled) { border-color: var(--ed-ink); }
.ed-nudge:disabled { opacity: .35; cursor: default; }
.ed-nudge-dark { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .1); color: #FFFFFF; }
.ed-nudge-dark:hover:not(:disabled) { border-color: #FFFFFF; }
.ed-stage { position: relative; flex: 1; min-height: 0; }
.ed-mat-foot { flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 8px 24px 16px; font: 500 11px/1.4 var(--ed-mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }

/* The paper and its labels, in inches × --ppi (pixels per inch, from the module). */
.ed-paper { --ppi: 64px; position: absolute; left: calc(50% - 4.25 * var(--ppi)); top: calc(50% - 5.5 * var(--ppi)); width: calc(8.5 * var(--ppi)); height: calc(11 * var(--ppi)); border-radius: 3px; background: var(--ed-paper); color: var(--ed-ink); box-shadow: 0 1px 0 rgba(19, 35, 58, .06), 0 18px 40px -18px rgba(9, 26, 20, .55), 0 3px 8px rgba(9, 26, 20, .18); }
.ed-paper[data-font="helvetica"] { font-family: Arial, Helvetica, "Liberation Sans", "Nimbus Sans", sans-serif; }
.ed-paper[data-font="times"] { font-family: "Times New Roman", Times, "Liberation Serif", "Nimbus Roman", serif; }
.ed-paper[data-font="courier"] { font-family: "Courier New", Courier, "Liberation Mono", "Nimbus Mono PS", monospace; }
.ed-label { position: absolute; left: calc((var(--left) + var(--col) * var(--pitch-x)) * var(--ppi)); top: calc((var(--top) + var(--row) * var(--pitch-y)) * var(--ppi)); width: calc(var(--w) * var(--ppi)); height: calc(var(--h) * var(--ppi)); overflow: hidden; border-radius: calc(var(--radius) * var(--ppi)); box-shadow: inset 0 0 0 1px #DCE2D9; font-size: calc(var(--pt, 10) * var(--ppi) / 72); line-height: 1.2; transition: background-color .3s ease, box-shadow .3s ease; }
.ed-paper[data-shape="round"] .ed-label { border-radius: 50%; }
.ed-run { position: absolute; left: calc(var(--x) * var(--ppi)); top: calc(var(--y) * var(--ppi)); color: var(--ed-ink); white-space: pre; font-kerning: none; font-variant-ligatures: none; }
.ed-run.is-bold { font-weight: 700; }
.ed-paper.is-filling .ed-run { animation: ed-ink .5s var(--ed-ease) both; animation-delay: calc((var(--row) + var(--col)) * 28ms); }
.ed-label.is-used { background: #F6F7F4; box-shadow: none; outline: 1.5px dashed var(--ed-dash); outline-offset: -1.5px; }
.ed-label.is-used::after { content: "USED"; position: absolute; inset: 0; display: grid; place-items: center; font: 500 max(6px, calc(.11 * var(--ppi)))/1 var(--ed-mono); letter-spacing: .1em; color: #67736E; }
.ed-paper.is-ghost .ed-label.is-blank { background: linear-gradient(#E9EDE6, #E9EDE6) 12% 30% / 52% 9% no-repeat, linear-gradient(#EEF1EC, #EEF1EC) 12% 52% / 40% 8% no-repeat, linear-gradient(#EEF1EC, #EEF1EC) 12% 72% / 46% 8% no-repeat; }
.ed-paper.is-ghost[data-shape="round"] .ed-label.is-blank { background-position: 50% 32%, 50% 52%, 50% 70%; }
.ed-paper.is-pickable .ed-label { cursor: pointer; }
.ed-paper.is-pickable .ed-label:hover { box-shadow: inset 0 0 0 2px var(--ed-apricot); }
.ed-label.is-start { background: var(--ed-warm-soft); box-shadow: inset 0 0 0 1.5px var(--ed-apricot); }
.ed-label.is-located { box-shadow: inset 0 0 0 2px var(--ed-cyan-ink); animation: ed-locate 1.4s ease-out; }
.ed-label.is-cut::before { content: ""; position: absolute; top: 4px; right: 4px; z-index: 1; width: 6px; height: 6px; border-radius: 50%; background: var(--ed-apricot); }
.ed-label:focus-visible { z-index: 2; outline: 3px solid var(--ed-ink); outline-offset: 1px; }
.ed-paper.is-pickable .ed-label:hover::after, .ed-paper.is-pickable .ed-label:focus-visible::after { content: "Start here"; position: absolute; inset: auto 4px 4px auto; z-index: 1; display: block; padding: 2px 5px; border-radius: 4px; background: var(--ed-ink); color: #FFFFFF; font: 500 max(6px, calc(.1 * var(--ppi)))/1.2 var(--ed-mono); letter-spacing: .02em; white-space: nowrap; }
.ed-paper.is-pickable .ed-label.is-start:hover::after, .ed-paper.is-pickable .ed-label.is-start:focus-visible::after { content: "Starts here"; background: var(--ed-mat); }
@keyframes ed-ink { from { opacity: 0; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes ed-locate { 0% { box-shadow: inset 0 0 0 2px var(--ed-cyan-ink), 0 0 0 0 rgba(27, 110, 128, .45); } 70% { box-shadow: inset 0 0 0 2px var(--ed-cyan-ink), 0 0 0 10px rgba(27, 110, 128, 0); } 100% { box-shadow: inset 0 0 0 2px var(--ed-cyan-ink), 0 0 0 0 rgba(27, 110, 128, 0); } }

/* ---------- the style pane ---------- */

.ed-style { overflow-y: auto; display: flex; flex-direction: column; gap: 20px; padding: 18px 20px; background: var(--ed-paper); border-left: 1px solid var(--ed-line); }
.ed-group { display: flex; flex-direction: column; gap: 8px; }
.ed-group-title { margin-bottom: 2px; font: 650 17px/1.2 var(--ed-display); letter-spacing: -.01em; }
.ed-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.ed-chip { position: relative; }
.ed-chip input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.ed-chip span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--ed-chip-line); background: var(--ed-paper); font: 500 15px/1 var(--ed-body); cursor: pointer; transition: border-color .2s ease, background-color .2s ease, color .2s ease, transform .2s ease; }
.ed-chip span:hover { border-color: var(--ed-mat); transform: translateY(-1px); }
.ed-chip input:checked + span { border-color: var(--ed-ink); background: var(--ed-ink); color: #FFFFFF; }
.ed-chip input:focus-visible + span { outline: 3px solid var(--ed-focus); outline-offset: 2px; }
.ed-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 50px; padding: 5px 8px 5px 14px; border-radius: 12px; background: var(--ed-soft); font-size: 15px; }
.ed-setting label { flex: 1; min-width: 0; }
.ed-stepper { display: flex; align-items: center; gap: 4px; }
.ed-stepper .ed-nudge { width: 36px; height: 36px; border-radius: 10px; }
.ed-stepper input { width: 56px; height: 38px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--ed-ink); font: 750 22px/1 var(--ed-display); text-align: center; -moz-appearance: textfield; appearance: textfield; }
.ed-stepper input::-webkit-inner-spin-button, .ed-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.ed-stepper input:hover { background: rgba(19, 35, 58, .05); }
.ed-unit { margin: 0 4px 0 -6px; font: 500 11px/1 var(--ed-mono); color: var(--ed-muted); }
#size { width: 52px; }
.ed-switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--ed-line); background: var(--ed-paper); font-size: 15px; cursor: pointer; transition: border-color .2s ease; }
.ed-switch:hover { border-color: var(--ed-chip-line); }
.ed-switch input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.ed-switch-track { position: relative; flex: none; width: 40px; height: 24px; border-radius: 12px; background: var(--ed-dash); transition: background-color .2s ease; }
.ed-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(19, 35, 58, .2); transition: transform .2s ease; }
.ed-switch input:checked + .ed-switch-track { background: var(--ed-mat); }
.ed-switch input:checked + .ed-switch-track::after { transform: translateX(16px); }
.ed-switch input:focus-visible + .ed-switch-track { outline: 3px solid var(--ed-focus); outline-offset: 2px; }
.ed-printer { font-size: 14px; line-height: 1.5; color: var(--ed-ink-soft); }
.ed-printer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ed-size-auto { margin-top: -2px !important; padding-left: 14px; }
.ed-fill { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.ed-fill .ed-hint { flex: 1 1 140px; }

/* The toast sits at the foot of the sheet's column, over the mat: never over the lettering and sheet settings. */
.ed-toast { grid-column: 2; grid-row: 1; align-self: end; justify-self: center; position: relative; z-index: 6; max-width: min(420px, calc(100% - 32px)); margin: 0 16px 56px; padding: 12px 16px; border-radius: 12px; background: var(--ed-ink); color: #FFFFFF; font-size: 14px; line-height: 1.45; box-shadow: 0 18px 36px -18px rgba(9, 26, 20, .6); opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.ed-toast:empty { display: none; }
.ed-toast.is-on { opacity: 1; transform: none; }

/* ---------- narrower screens ---------- */

@media (max-width: 1240px) {
  .ed-grid { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) minmax(260px, 300px); }
  .ed-file { max-width: 220px; }
}
@media (max-width: 1060px) {
  .ed-file { display: none; }
}
@media (max-width: 899px) {
  .ed { --row-h: 52px; height: auto; padding-bottom: 96px; }
  .ed-bar { flex-wrap: wrap; gap: 8px; min-height: 0; padding: 10px 16px; }
  .ed-tpl { flex: 1 1 auto; }
  .ed-tpl-panel { position: fixed; top: auto; left: 16px; right: 16px; width: auto; margin-top: 8px; max-height: calc(100dvh - 160px); overflow-y: auto; }
  .ed-cal { padding: 8px 2px; }
  .ed .ed-bar .button.button-primary { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20; justify-content: center; min-height: 52px; font-size: 16px; box-shadow: 0 16px 32px -14px rgba(9, 26, 20, .55); }
  .ed .ed-bar .button.button-primary:disabled { background: #5F6E7D; color: rgba(255, 255, 255, .85); }
  .ed-tabs { position: sticky; top: var(--ed-sticky, 0px); z-index: 4; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 8px 16px; background: var(--ed-desk); border-bottom: 1px solid var(--ed-line); }
  .ed-tabs [role="tab"] { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ed-ink-soft); font: 600 15px/1 var(--ed-body); cursor: pointer; }
  .ed-tabs [role="tab"][aria-selected="true"] { background: var(--ed-ink); color: #FFFFFF; }
  .ed-grid { display: block; }
  .ed[data-view="list"] .ed-sheet, .ed[data-view="list"] .ed-style,
  .ed[data-view="sheet"] .ed-list, .ed[data-view="sheet"] .ed-style,
  .ed[data-view="style"] .ed-list, .ed[data-view="style"] .ed-sheet { display: none; }
  .ed-list { border-right: 0; }
  .ed-head { padding: 16px 16px 10px; }
  .ed-notice, .ed-dupes, .ed-lines-toggle { margin-left: 16px; margin-right: 16px; }
  .ed-import, .ed-source { padding-left: 16px; padding-right: 16px; }
  .ed-columns { padding-left: 16px; padding-right: 16px; }
  .ed:not(.has-list) .ed-bar .button.button-primary { display: none; }
  .ed-find { padding: 0 16px 10px 10px; grid-template-columns: auto minmax(0, 1fr); }
  .ed .ed-find select { grid-column: 1 / -1; width: 100%; }
  .ed-rows { flex: none; height: min(64vh, 560px); }
  .ed-sheet { min-height: 0; }
  .ed-stage { flex: none; padding: 4px 16px 8px; }
  .ed-paper { position: relative; left: auto; top: auto; margin: 0 auto; }
  .ed-mat-foot { padding: 8px 16px 16px; }
  .ed-style { padding: 16px; border-left: 0; }
  .ed-stepper .ed-nudge { width: 44px; height: 44px; }
  .ed-toast { position: fixed; top: auto; right: 16px; bottom: 84px; left: 16px; max-width: none; margin: 0; }
}
@media (max-width: 420px) {
  .ed-tpl-meta { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ed *, .ed *::before, .ed *::after { transition: none !important; animation: none !important; }
}
