@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

/* Smart Quote — class contract.
   Every class is prefixed sq-. Oxygen templates and PHP partials write this markup;
   quote-app.js builds the dynamic parts through window.SmartQuote.
   Loaded after tokens.css, which supplies every custom property used below. */

/* ---------- base ---------- */

.sq, body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 22px;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

.sq-page { max-width: var(--measure); margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-7); }
.sq-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.sq-stack--tight { gap: var(--space-2); }
.sq-stack--loose { gap: var(--space-5); }
.sq-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.sq-spread { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.sq-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sq-muted { color: var(--ink-muted); }
.sq-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:where(.sq *, .sq) :focus-visible,
:where(body) :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }

.sq-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
}
.sq-card__title { font-size: 19px; line-height: 26px; font-weight: 600; margin: 0 0 var(--space-4); }
.sq-card__title + .sq-card__lede { margin-top: calc(var(--space-4) * -1 + var(--space-2)); }
.sq-card__lede { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin: 0 0 var(--space-4); }

/* ---------- Button ---------- */

.sq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control); padding: 0 var(--space-4);
  font-family: inherit; font-size: 15px; line-height: 22px; font-weight: 600;
  border-radius: var(--radius-md); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
.sq-btn:hover { background: var(--surface-muted); }
.sq-btn:active { background: var(--canvas); }

.sq-btn--primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.sq-btn--primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.sq-btn--primary:active { background: var(--brand-strong); }

.sq-btn--danger { background: var(--danger); border-color: var(--danger); color: var(--on-danger); }
.sq-btn--danger:hover { filter: none; background: var(--danger-strong); border-color: var(--danger-strong); }

/* 3.0.11: a destructive action that should not shout (Delete beside Archive). */
.sq-btn--danger-quiet { background: var(--surface); border-color: var(--line); color: var(--danger); }
.sq-btn--danger-quiet:hover { background: var(--danger-soft); border-color: var(--danger); }
.sq-btn--ghost { background: transparent; border-color: transparent; color: var(--brand-ink); }
.sq-btn--ghost:hover { background: var(--brand-soft); }

.sq-btn--lg { min-height: var(--control-lg); font-size: 16px; padding: 0 var(--space-5); }
.sq-btn--sm { min-height: var(--control-sm); font-size: 13px; padding: 0 var(--space-3); }
.sq-btn--block { display: flex; width: 100%; }

.sq-btn[disabled]:not([aria-busy="true"]), .sq-btn[aria-disabled="true"]:not([aria-busy="true"]) {
  background: var(--surface-muted); border-color: var(--line); color: var(--ink-disabled);
  cursor: not-allowed;
}
/* Busy keeps its own colours: a primary button going grey mid-send reads as "it failed". */
.sq-btn[aria-busy="true"] { cursor: progress; }
.sq-btn .sq-btn__icon { width: var(--icon); height: var(--icon); flex: none; }

.sq-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control); height: var(--control); flex: none;
  border-radius: var(--radius-md); border: 1px solid transparent;
  background: transparent; color: var(--ink-muted); cursor: pointer;
  transition: background-color 120ms ease-out, color 120ms ease-out;
}
.sq-iconbtn:hover { background: var(--surface-muted); color: var(--ink); }
.sq-iconbtn--danger:hover { background: var(--danger-soft); color: var(--danger); }
.sq-iconbtn--sm { width: var(--control-sm); height: var(--control-sm); }
.sq-iconbtn svg { width: var(--icon); height: var(--icon); }

/* ---------- Field, inputs ---------- */

.sq-field { display: flex; flex-direction: column; gap: var(--space-2); }
.sq-field__label { font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 0.01em; color: var(--ink); }
.sq-field__req { color: var(--danger); margin-left: 2px; }
.sq-field__opt { color: var(--ink-muted); font-weight: 400; margin-left: var(--space-1); }
.sq-field__hint { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.sq-field__error { display: flex; align-items: flex-start; gap: var(--space-1); font-size: 13px; line-height: 18px; color: var(--danger); }
.sq-field__error svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }

.sq-input, .sq-select, .sq-textarea {
  width: 100%;
  min-height: var(--control); padding: 0 var(--space-3);
  font-family: inherit; font-size: 15px; line-height: 22px; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  transition: border-color 120ms ease-out;
}
.sq-textarea { padding: var(--space-3); min-height: 104px; resize: vertical; line-height: 22px; }
.sq-input::placeholder, .sq-textarea::placeholder { color: var(--ink-muted); }
.sq-input:hover, .sq-select:hover, .sq-textarea:hover { border-color: var(--ink-muted); }
.sq-input[readonly], .sq-input[disabled], .sq-select[disabled], .sq-textarea[disabled] {
  background: var(--surface-muted); color: var(--ink-disabled); border-color: var(--line); cursor: not-allowed;
}
.sq-input[readonly] { color: var(--ink); cursor: default; }
.sq-input[aria-invalid="true"], .sq-select[aria-invalid="true"], .sq-textarea[aria-invalid="true"] { border-color: var(--danger); }

.sq-select {
  appearance: none; padding-right: var(--space-6);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f605a' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right var(--space-3) center; background-size: 20px 20px;
}

/* money input: $ sits inside the control, the figure is mono */
.sq-money { position: relative; display: block; }
.sq-money__sign {
  position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 16px; color: var(--ink-muted); pointer-events: none;
}
.sq-money .sq-input {
  padding-left: var(--space-6);
  font-family: var(--font-mono); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums;
  text-align: right; padding-right: var(--space-3);
}
.sq-money--lg .sq-input { min-height: var(--control-lg); font-size: 22px; font-weight: 600; }
.sq-money--lg .sq-money__sign { font-size: 22px; }

/* quantity stepper */
.sq-qty { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.sq-qty__btn {
  width: var(--control-sm); min-height: var(--control-sm);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); border: 0; color: var(--ink); cursor: pointer;
  transition: background-color 120ms ease-out;
}
.sq-qty__btn:hover { background: var(--surface-muted); }
.sq-qty__btn[disabled] { color: var(--ink-disabled); cursor: not-allowed; }
.sq-qty__btn svg { width: 16px; height: 16px; }
.sq-qty__input {
  width: 44px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  text-align: center; font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--ink);
  background: var(--surface); -moz-appearance: textfield;
}
.sq-qty__input::-webkit-outer-spin-button, .sq-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Checkbox and reveal ---------- */

.sq-check { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; }
.sq-check__input { position: absolute; opacity: 0; width: 0; height: 0; }
.sq-check__box {
  flex: none; width: 22px; height: 22px; margin-top: 1px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color 120ms ease-out, border-color 120ms ease-out;
}
.sq-check__box svg { width: 16px; height: 16px; opacity: 0; color: var(--on-brand); }
.sq-check__input:checked + .sq-check__box { background: var(--brand); border-color: var(--brand); }
.sq-check__input:checked + .sq-check__box svg { opacity: 1; }
.sq-check__input:focus-visible + .sq-check__box { outline: 2px solid var(--focus); outline-offset: 2px; }
.sq-check__text { font-size: 15px; line-height: 22px; }
.sq-check__note { display: block; font-size: 13px; line-height: 18px; color: var(--ink-muted); margin-top: var(--space-1); }

.sq-reveal {
  margin-top: var(--space-4); padding: var(--space-4);
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-muted);
  display: flex; flex-direction: column; gap: var(--space-4);
}

/* ---------- PIN ---------- */

.sq-pin { display: flex; gap: var(--space-2); }
.sq-pin__box {
  width: 48px; height: var(--control-lg);
  text-align: center; font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  -moz-appearance: textfield;
}
.sq-pin__box::-webkit-outer-spin-button, .sq-pin__box::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sq-pin__box[data-filled="true"] { border-color: var(--brand); }
.sq-pin--invalid .sq-pin__box { border-color: var(--danger); }

/* ---------- Product picker ---------- */

.sq-picker { position: relative; }
.sq-picker__head { display: flex; align-items: center; gap: var(--space-2); }
.sq-picker__control { position: relative; flex: 1 1 auto; min-width: 0; }
.sq-picker__control .sq-input { padding-left: var(--space-6); }
.sq-picker__search {
  position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%);
  width: var(--icon); height: var(--icon); color: var(--ink-muted); pointer-events: none;
}
.sq-picker__done { display: none; }
/* 3.0.12: the drop-down - up to 60% of the screen's height rather than a fixed 320px. */
.sq-picker__drop {
  position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + var(--space-1));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); overflow: hidden; display: flex; flex-direction: column;
  max-height: min(60vh, 560px);
}
.sq-picker__drop[hidden] { display: none; }
.sq-picker__count { margin: 0; padding: var(--space-2) var(--space-3) 0; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.sq-picker__count:empty { display: none; }
.sq-picker__pop { overflow-y: auto; overscroll-behavior: contain; padding: var(--space-1); flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.sq-picker__group {
  position: sticky; top: calc(-1 * var(--space-1)); z-index: 1; background: var(--surface);
  font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted); padding: var(--space-3) var(--space-3) var(--space-1);
}
.sq-picker__opt {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  width: 100%; text-align: left; min-height: 48px;
  padding: var(--space-2) var(--space-3); border: 0; background: transparent; border-radius: var(--radius-md);
  font-family: inherit; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.sq-picker__opt:hover, .sq-picker__opt[aria-selected="true"] { background: var(--brand-soft); }
.sq-picker__opt[data-disabled="true"] { cursor: not-allowed; color: var(--ink-muted); }
.sq-picker__opt[data-disabled="true"]:hover { background: transparent; }
.sq-picker__body { min-width: 0; }
.sq-picker__name { display: block; font-size: 15px; line-height: 22px; font-weight: 600; }
.sq-picker__meta, .sq-picker__why { display: block; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.sq-picker__why { font-style: italic; }
.sq-picker__on { display: inline-block; margin-top: 2px; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--positive-ink, var(--brand-ink)); }
.sq-picker__price { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.sq-picker__more { padding: var(--space-3); font-size: 13px; color: var(--ink-muted); text-align: center; }
.sq-picker__empty { margin: 0; padding: var(--space-4) var(--space-3); font-size: 13px; color: var(--ink-muted); }
/* 3.0.12: below 600px the open picker is a full-screen sheet (see ProductPicker). */
html.sq-noscroll, html.sq-noscroll body { overflow: hidden; }
.sq-picker--sheet .sq-picker__panel {
  position: fixed; z-index: 60; left: 0; right: 0; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; background: var(--surface);
  padding: var(--space-3) var(--space-3) 0; padding-top: max(var(--space-3), env(safe-area-inset-top));
}
.sq-picker--sheet .sq-picker__done { display: inline-flex; flex: 0 0 auto; }
.sq-picker--sheet .sq-picker__drop {
  position: static; flex: 1 1 auto; max-height: none; border: 0; border-radius: 0; box-shadow: none;
  margin: var(--space-2) calc(-1 * var(--space-3)) 0; padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- Alert ---------- */

.sq-alert {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4); border-radius: var(--radius-md); border: 1px solid;
  font-size: 15px; line-height: 22px;
}
.sq-alert svg { width: var(--icon-lg); height: var(--icon-lg); flex: none; }
.sq-alert__title { font-weight: 600; display: block; margin-bottom: 2px; }
.sq-alert__body { color: var(--ink); }
.sq-alert--info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
.sq-alert--warning { background: var(--warning-soft); border-color: var(--warning-line); color: var(--warning); }
.sq-alert--danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.sq-alert--success { background: var(--positive-soft); border-color: var(--positive-line); color: var(--positive-ink); } /* 3.0.11 */
.sq-alert--brand { background: var(--brand-soft); border-color: var(--brand-soft-line); color: var(--brand-ink); }

/* ---------- Toast ---------- */

.sq-toaster { position: fixed; left: 50%; transform: translateX(-50%); bottom: var(--space-5); z-index: 60; display: flex; flex-direction: column; gap: var(--space-2); width: min(420px, calc(100% - var(--space-6))); }
.sq-toast {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-inverse); color: var(--ink-inverse);
  border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
  font-size: 15px; line-height: 22px;
}
.sq-toast svg { width: var(--icon); height: var(--icon); flex: none; }
.sq-toast--danger { background: var(--danger); color: var(--on-danger); }
.sq-toast__close { margin-left: auto; background: transparent; border: 0; color: inherit; cursor: pointer; opacity: 0.8; display: inline-flex; }

/* ---------- Badge ---------- */

.sq-badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  padding: 2px var(--space-2); border-radius: var(--radius-pill);
  font-size: 13px; line-height: 18px; font-weight: 600;
  background: var(--surface-muted); color: var(--ink); border: 1px solid var(--line);
}
.sq-badge svg { width: 14px; height: 14px; flex: none; }
.sq-badge--draft { background: var(--warning-soft); color: var(--warning); border-color: var(--warning-line); }
.sq-badge--sent { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.sq-badge--won { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-soft-line); }
.sq-badge--failed { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
/* 3.0.11: archived reads as set aside - quiet, dashed, never a status colour. */
.sq-badge--archived { background: var(--surface); color: var(--ink-muted); border-style: dashed; border-color: var(--line-strong, var(--line)); }
.sq-badge--square { border-radius: var(--radius-sm); }

/* ---------- Spinner ---------- */

.sq-spinner {
  display: inline-block; width: var(--icon); height: var(--icon); flex: none;
  border: 2px solid var(--line-strong); border-top-color: var(--brand); border-radius: 50%;
  animation: sq-spin 700ms linear infinite;
}
.sq-spinner--on-brand { border-color: var(--on-brand-dim); border-top-color: var(--on-brand); }
.sq-spinner--lg { width: var(--icon-lg); height: var(--icon-lg); border-width: 3px; }
@keyframes sq-spin { to { transform: rotate(360deg); } }

/* ---------- Empty state ---------- */

.sq-empty { text-align: center; padding: var(--space-7) var(--space-4); display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.sq-empty__icon { width: 40px; height: 40px; color: var(--ink-muted); }
.sq-empty__title { font-size: 19px; line-height: 26px; font-weight: 600; margin: 0; }
.sq-empty__text { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin: 0; max-width: 42ch; }

/* ---------- App bar ---------- */

.sq-appbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-inverse); color: var(--ink-inverse);
}
.sq-appbar__brand { display: flex; align-items: center; gap: var(--space-3); font-size: 16px; line-height: 22px; font-weight: 600; }
.sq-appbar__logo { max-height: 40px; width: auto; display: block; }
/* 3.0.12.3: without a logo for dark backgrounds, the normal logo sits on a white plate (40px in all). */
.sq-appbar__plate { display: inline-flex; align-items: center; background: #fff; border-radius: var(--radius-sm); padding: 4px 10px; }
.sq-appbar__plate .sq-appbar__logo { max-height: 32px; }
.sq-appbar__rep { display: flex; align-items: center; gap: var(--space-3); font-size: 13px; line-height: 18px; }
.sq-appbar__name { font-weight: 600; }
.sq-appbar__email { color: var(--ink-inverse-muted); }
.sq-appbar__link { color: var(--ink-inverse); background: transparent; border: 1px solid var(--line-inverse); border-radius: var(--radius-md); min-height: var(--control-sm); padding: 0 var(--space-3); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sq-appbar__link:hover { background: var(--surface-inverse-hover); }

/* ---------- Stepper ---------- */

.sq-steps { display: flex; gap: var(--space-2); list-style: none; margin: 0; padding: var(--space-4) 0; overflow-x: auto; }
.sq-steps__item { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.sq-steps__btn {
  display: flex; align-items: center; gap: var(--space-2);
  background: transparent; border: 0; padding: var(--space-1) var(--space-2); border-radius: var(--radius-md);
  font: inherit; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); cursor: pointer;
}
.sq-steps__btn[disabled] { cursor: not-allowed; color: var(--ink-disabled); }
.sq-steps__btn:not([disabled]):hover { background: var(--surface-muted); color: var(--ink); }
.sq-steps__dot {
  width: 24px; height: 24px; flex: none; border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink-muted);
}
.sq-steps__item[data-state="done"] .sq-steps__dot { background: var(--brand-soft); border-color: var(--brand-ink); color: var(--brand-ink); }
.sq-steps__item[data-state="done"] .sq-steps__btn { color: var(--brand-ink); }
.sq-steps__item[data-state="current"] .sq-steps__dot { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.sq-steps__item[data-state="current"] .sq-steps__btn { color: var(--ink); }
.sq-steps__sep { width: 16px; height: 1px; background: var(--line-strong); flex: none; }
.sq-steps__dot svg { width: 14px; height: 14px; }

/* ---------- Category tile ---------- */

.sq-tiles { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
@media (min-width: 600px) { .sq-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .sq-tiles { grid-template-columns: repeat(3, 1fr); } }

.sq-tile {
  display: flex; flex-direction: column; gap: var(--space-3); text-align: left;
  padding: var(--space-5); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  cursor: pointer; font: inherit; color: var(--ink);
  transition: border-color 120ms ease-out, background-color 120ms ease-out;
}
.sq-tile:hover { border-color: var(--brand); background: var(--surface); }
.sq-tile[aria-pressed="true"], .sq-tile--selected { border-color: var(--brand); background: var(--brand-soft); }
.sq-tile__img { width: var(--tile-icon); height: var(--tile-icon); object-fit: contain; border-radius: var(--radius-md); }
.sq-tile__fallback {
  width: var(--tile-icon); height: var(--tile-icon); border-radius: var(--radius-md);
  background: var(--brand-soft); color: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 600; letter-spacing: 0.02em;
}
.sq-tile__name { font-size: 16px; line-height: 22px; font-weight: 600; }
.sq-tile__desc { font-size: 13px; line-height: 18px; color: var(--ink-muted); }

/* ---------- Line item row ---------- */

.sq-lines { display: flex; flex-direction: column; gap: var(--space-3); }
.sq-line {
  display: grid; gap: var(--space-3) var(--space-4);
  grid-template-columns: 1fr auto auto auto auto;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md);
}
.sq-line__main { min-width: 0; }
.sq-line__name { font-size: 16px; line-height: 22px; font-weight: 600; }
.sq-line__meta { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.sq-line__unit { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--ink-muted); white-space: nowrap; }
.sq-line__unit[data-overridden="true"] { color: var(--warning); font-weight: 600; }
.sq-line__total { font-family: var(--font-mono); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; min-width: 96px; }
.sq-line__override { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; padding-top: var(--space-1); }
.sq-line__override .sq-money { width: 140px; }
.sq-counter { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.sq-counter[data-full="true"] { color: var(--danger); }

/* 3.0.12: reordering. A line with a handle gets a narrow first column for it. */
.sq-line--sortable { grid-template-columns: auto 1fr auto auto auto auto; }
.sq-line--sortable > :not(.sq-line__handle):not(.sq-line__main):not(.sq-line__qty):not(.sq-line__unit):not(.sq-line__total):not(.sq-line__remove) { grid-column: 2 / -1; }
.sq-line__handle { grid-row: 1; grid-column: 1; align-self: center; margin-left: calc(-1 * var(--space-2)); }
.sq-line__handle .sq-menu__btn { width: 44px; height: 44px; cursor: grab; touch-action: none; color: var(--ink-muted); }
.sq-line__handle .sq-menu__btn:hover { color: var(--ink); background: var(--surface-muted); }
.sq-sortable__item { transition: transform 160ms ease; }
.sq-sortable__lifted { transition: none; position: relative; z-index: 5; box-shadow: var(--shadow-pop); cursor: grabbing; }
html.sq-dragging, html.sq-dragging * { -webkit-user-select: none; user-select: none; cursor: grabbing; }
/* While a line is lifted, every line shrinks to one row (name, qty, total). */
.sq-lines--compact .sq-line > :not(.sq-line__handle):not(.sq-line__main):not(.sq-line__qty):not(.sq-line__total) { display: none; }
.sq-lines--compact .sq-line__meta, .sq-lines--compact .sq-line__notices { display: none; }
.sq-lines--compact .sq-line { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.sq-lines--compact .sq-qty { pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .sq-sortable__item { transition: none; } }

@media (max-width: 599px) {
  .sq-line { grid-template-columns: 1fr auto; }
  .sq-line--sortable { grid-template-columns: auto 1fr auto; }
  .sq-line--sortable .sq-line__handle { grid-row: 1 / span 2; }
  .sq-line--sortable .sq-line__main { grid-column: 2; }
  .sq-line--sortable .sq-line__remove { grid-column: 3; grid-row: 1; justify-self: end; }
  .sq-line--sortable .sq-line__qty { grid-column: 2; grid-row: 2; }
  .sq-line--sortable .sq-line__total { grid-column: 3; grid-row: 2; }
  .sq-line--sortable .sq-line__unit { grid-column: 2 / -1; grid-row: 3; }
  .sq-line--sortable > :not(.sq-line__handle):not(.sq-line__main):not(.sq-line__qty):not(.sq-line__unit):not(.sq-line__total):not(.sq-line__remove) { grid-column: 1 / -1; }
  .sq-line__handle { margin-left: calc(-1 * var(--space-3)); }
  .sq-line__main { grid-column: 1; }
  .sq-line__remove { grid-column: 2; grid-row: 1; justify-self: end; }
  .sq-line__qty, .sq-line__unit, .sq-line__total { grid-row: 2; }
  .sq-line__total { grid-column: 2; }
}

/* ---------- Pricing panel ---------- */

.sq-pricing { display: flex; flex-direction: column; }
.sq-pricing__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-4) 0; border-bottom: 1px solid var(--line);
}
.sq-pricing__row[hidden] { display: none; } /* 3.0.12: the package-line note left an empty gap when there was nothing to say */
.sq-pricing__row:last-child { border-bottom: 0; }
.sq-pricing__label { font-size: 15px; line-height: 22px; font-weight: 600; }
.sq-pricing__hint { display: block; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--ink-muted); }
.sq-pricing__value { font-family: var(--font-mono); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sq-pricing__row--input { background: var(--brand-soft); margin: 0 calc(var(--space-4) * -1); padding: var(--space-4); border-radius: var(--radius-md); border-bottom: 0; }
.sq-pricing__row--input .sq-money { width: 180px; }
.sq-pricing__row--saving .sq-pricing__value { color: var(--saving); font-weight: 600; }
.sq-pricing__row--final { border-top: 2px solid var(--ink); border-bottom: 0; padding-top: var(--space-4); }
.sq-pricing__row--final .sq-pricing__value { font-size: 30px; line-height: 36px; font-weight: 600; }
.sq-pricing__gst { font-size: 13px; line-height: 18px; color: var(--info); margin-top: var(--space-2); }
/* 3.0.9: package pricing */
.sq-pricing--package .sq-pricing__row--input + .sq-pricing__row--input { margin-top: var(--space-2); }
.sq-pricing__count { width: 120px; font-family: var(--font-mono); text-align: right; }
.sq-pricing__pricewrap { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); }
.sq-pricing__pricewrap .sq-money { width: 180px; }
.sq-pricing__row--note .sq-pricing__value { color: var(--ink-muted); }
.sq-linkbtn { appearance: none; background: none; border: 0; padding: 2px 0; margin: 0; font: inherit; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 24px; }
.sq-linkbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.sq-linkbtn[hidden] { display: none; }
.sq-line__total[data-package="true"] { font-family: var(--font-sans); font-size: 13px; font-weight: 600; color: var(--ink-muted); }
/* The Itemised · Package switch at the top of Line items. */
.sq-modeswitch { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-4); }
.sq-modeswitch__label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted); }
.sq-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-md); overflow: hidden; }
.sq-seg__btn { appearance: none; border: 0; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; line-height: 20px; font-weight: 600; padding: 10px 16px; min-height: 44px; cursor: pointer; }
.sq-seg__btn + .sq-seg__btn { border-left: 1px solid var(--line-strong); }
.sq-seg__btn[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.sq-seg__btn:focus-visible { outline: 2px solid var(--focus); outline-offset: -4px; }
.sq-seg__btn:disabled { cursor: default; color: var(--ink-disabled); }
.sq-modeswitch__note { flex: 1 1 100%; margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.sq-counter[hidden] { display: none; }

/* ---------- Quote table (rep) ---------- */

.sq-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-card); }
.sq-table th {
  text-align: left; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink-muted);
  background: var(--surface-muted); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.sq-table td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); font-size: 15px; line-height: 22px; vertical-align: middle; }
.sq-table tbody tr:last-child td { border-bottom: 0; }
.sq-table tbody tr:hover { background: var(--surface-muted); }
.sq-table__num { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; }
.sq-table__money { font-family: var(--font-mono); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.sq-table__date { color: var(--ink-muted); font-size: 13px; white-space: nowrap; }
.sq-table a { color: var(--brand-ink); font-weight: 600; }

/* ---------- Share link ---------- */

.sq-share { display: flex; flex-direction: column; gap: var(--space-2); }
.sq-share__box {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--info-soft); border: 1px solid var(--info-line); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
}
.sq-share__url {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--ink);
}

/* ---------- Quote sheet (preview + public page) ---------- */

.sq-sheet {
  width: 100%; max-width: var(--sheet); margin: 0 auto;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  padding: var(--space-6);
}
.sq-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); padding-bottom: var(--space-5); border-bottom: 1px solid var(--line); }
/* 3.0.12.2: 64px tall (was 56), held by the width when a logo is very wide. */
.sq-sheet__logo { max-height: 64px; max-width: min(100%, 360px); width: auto; height: auto; display: block; object-fit: contain; }
.sq-sheet__company { font-size: 19px; line-height: 26px; font-weight: 600; }
.sq-sheet__ref { font-family: var(--font-mono); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.04em; color: var(--ink-muted); text-align: right; }
.sq-sheet__eyebrow { font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-muted); margin: var(--space-5) 0 var(--space-2); }
.sq-sheet__name { font-size: 32px; line-height: 38px; font-weight: 600; letter-spacing: -0.01em; margin: 0; overflow-wrap: anywhere; }
/* 3.0.5: no customer name means the email stands in - at a size that reads as an identifier, not a headline. */
.sq-sheet__name--email { font-size: 19px; line-height: 26px; letter-spacing: 0; }
.sq-sheet__refcat { display: block; margin-top: var(--space-2); font-family: var(--font-sans); font-size: 13px; line-height: 18px; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.sq-sheet__meta { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin-top: var(--space-1); }
.sq-sheet__section { margin-top: var(--space-6); }
.sq-sheet__title { font-size: 19px; line-height: 26px; font-weight: 600; margin: 0 0 var(--space-3); }
.sq-sheet__note { font-size: 15px; line-height: 22px; white-space: pre-line; }
.sq-sheet__terms { font-size: 13px; line-height: 18px; color: var(--ink-muted); margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--line); }

.sq-qtable { width: 100%; border-collapse: collapse; }
.sq-qtable th { text-align: left; font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-muted); padding: 0 0 var(--space-2); border-bottom: 1px solid var(--line); }
/* 3.0.5: explicit column classes. :last-child broke the moment a column moved. */
.sq-qtable th.sq-qtable__col--qty, .sq-qtable td.sq-qtable__qty { text-align: left; width: 64px; }
.sq-qtable th.sq-qtable__col--money, .sq-qtable td.sq-qtable__money { text-align: right; width: 128px; }
.sq-qtable td { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.sq-qtable__name { display: block; font-size: 16px; line-height: 22px; font-weight: 600; }
.sq-qtable__meta { display: block; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.sq-qtable__qty { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--ink-muted); white-space: nowrap; }
.sq-qtable__money { font-family: var(--font-mono); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 3.0.9: package pricing - lines covered by the package price read "Included". */
.sq-qtable__included { font-family: var(--font-sans); font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ink-muted); }
/* 3.0.5: optional grouping by product type, switched on per category. */
.sq-qtable__grouprow th.sq-qtable__group { padding: var(--space-5) 0 var(--space-2); text-align: left; font-size: 11px; line-height: 14px; font-weight: 600; letter-spacing: 0.08em; color: var(--ink-muted); border-bottom: 1px solid var(--line); }
.sq-qtable tbody .sq-qtable__grouprow:first-child th.sq-qtable__group { padding-top: 0; }

/* ---------- Totals (customer) ---------- */

.sq-totals { margin-left: auto; max-width: 360px; margin-top: var(--space-5); }
.sq-totals__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); padding: var(--space-2) 0; }
.sq-totals__label { font-size: 15px; line-height: 22px; color: var(--ink-muted); }
.sq-totals__value { font-family: var(--font-mono); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.sq-totals__row--saving .sq-totals__label, .sq-totals__row--saving .sq-totals__value { color: var(--saving); font-weight: 600; }
.sq-totals__row--final { border-top: 2px solid var(--ink); margin-top: var(--space-2); padding-top: var(--space-3); align-items: baseline; }
.sq-totals__row--final .sq-totals__label { font-size: 15px; font-weight: 600; color: var(--ink); }
.sq-totals__row--final .sq-totals__value { font-size: 30px; line-height: 36px; font-weight: 600; }
.sq-totals__gst { display: flex; align-items: center; gap: var(--space-1); font-size: 13px; line-height: 18px; color: var(--info); margin-top: var(--space-2); justify-content: flex-end; }
.sq-totals__gst svg { width: 16px; height: 16px; }

/* ---------- Rep card ---------- */

.sq-rep { display: flex; align-items: flex-start; gap: var(--space-4); padding: var(--space-4); background: var(--surface-muted); border-radius: var(--radius-md); }
.sq-rep__avatar {
  width: 48px; height: 48px; flex: none; border-radius: var(--radius-pill);
  background: var(--brand-soft); color: var(--brand-ink);
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600;
}
.sq-rep__name { font-size: 16px; line-height: 22px; font-weight: 600; }
.sq-rep__role { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.sq-rep__contact { margin-top: var(--space-2); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: 15px; }
.sq-rep__contact a { color: var(--brand-ink); font-weight: 600; }

/* ---------- Sticky action bar ---------- */

.sq-actionbar {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-bar);
}
@media (max-width: 599px) { .sq-actionbar .sq-btn { flex: 1 1 0; } }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0ms !important; animation-duration: 0ms !important; }
  .sq-spinner { animation: none; border-top-color: var(--line-strong); }
}

/* ---------- Print: the customer quote only ---------- */

@media print {
  @page { margin: 16mm; }
  body { background: #ffffff; }
  .sq-appbar, .sq-actionbar, .sq-toaster, .sq-share, .sq-btn, .sq-iconbtn, .sq-steps { display: none !important; }
  .sq-sheet { max-width: none; width: auto; margin: 0; padding: 0; box-shadow: none; border-radius: 0; background: #ffffff; }
  .sq-rep, .sq-totals { break-inside: avoid; }
  .sq-qtable tr { break-inside: avoid; }
  .sq-rep { background: #ffffff; border: 1px solid var(--print-line); }
  .sq-qtable th, .sq-qtable td, .sq-sheet__head, .sq-sheet__terms { border-color: var(--print-line); }
  .sq-printurl { display: block !important; }
}
.sq-printurl { display: none; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-muted); margin-top: var(--space-4); }

/* Visually hidden but read by assistive tech (table captions). */
.sq-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
table.sq-sr-only { left: -10000px; } /* 3.0.12: a table ignores width: 1px, so a hidden chart table widened a 320px page; off to the left it cannot */

/* ======================================================================
   3.0.16: status colours, sheets, the Planner's cards and board, Jump to.
   ====================================================================== */

/* Customer status colours: the fixed eight in Settings (sq_status_colours() in helpers.php holds the
   same values). Ink on soft reads at 4.5:1 or better; the chip always says the word too. */
.sq-st { font-weight: 600; }
.sq-st--orange { background: #fdebd8; color: #8a3d00; border-color: #f3c99b; }
.sq-st--sky { background: #e1f1fa; color: #0b4f75; border-color: #a9d6ef; }
.sq-st--blue { background: #e3ebfa; color: #183f82; border-color: #b0c6ef; }
.sq-st--purple { background: #f1e6f8; color: #5e2a80; border-color: #d6b6ea; }
.sq-st--teal { background: #ddf4f0; color: #0b5c51; border-color: #9fdcd2; }
.sq-st--green { background: #e2f2e3; color: #1d5a25; border-color: #a9d6ad; }
.sq-st--grey { background: #eeeff1; color: #3f4550; border-color: #c9ccd2; }
.sq-st--silver { background: #f5f6f7; color: #4f5560; border-color: #dadde2; }

/* Sheet: a short form over the page. A centred panel from 600px, a bottom sheet on a phone. */
.sq-sheet2 { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.sq-sheet2--top { align-items: flex-start; padding-top: 10vh; }
.sq-sheet2__scrim { position: absolute; inset: 0; background: var(--scrim, rgba(15, 42, 68, 0.48)); }
.sq-sheet2__panel { position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.sq-sheet2__panel--wide { max-width: 640px; }
.sq-sheet2__panel:focus { outline: none; }
.sq-sheet2__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-4) var(--space-2) var(--space-5); }
.sq-sheet2__title { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.sq-sheet2__lede { margin: var(--space-1) 0 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.sq-sheet2__body { padding: var(--space-2) var(--space-5) var(--space-4); overflow-y: auto; }
.sq-sheet2__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-3) var(--space-5) var(--space-4); border-top: 1px solid var(--line); }
@media (max-width: 599px) {
  .sq-sheet2, .sq-sheet2--top { align-items: flex-end; padding: 0; }
  .sq-sheet2__panel, .sq-sheet2__panel--wide { max-width: none; max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .sq-sheet2__actions { padding-bottom: max(var(--space-4), env(safe-area-inset-bottom)); }
  .sq-sheet2__actions .sq-btn { flex: 1 1 auto; justify-content: center; }
}

/* ChipPick: a few choices as pills. 44px tall on a phone. */
.sq-chippick { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.sq-chippick__chip { min-height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--line-strong, var(--line)); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sq-chippick__chip:hover { background: var(--surface-muted); }
.sq-chippick__chip[aria-checked="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.sq-chippick__chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 599px) { .sq-chippick__chip { min-height: 44px; } }
.sq-dayfield { gap: var(--space-2); }
.sq-dayfield__other { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.sq-dayfield__date { max-width: 190px; }

/* PlanCard: one customer on the Planner. */
.sq-pcard { position: relative; display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-2) var(--space-1) var(--space-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-card); font-size: 13px; line-height: 18px; }
/* A mouse drags the whole card, so it doesn't select its text on the way (Copy is on the customer's screen). */
@media (hover: hover) and (pointer: fine) { .sq-pcard { cursor: grab; -webkit-user-select: none; user-select: none; } .sq-pcard:not(.sq-pcard--phone) .sq-pcard__grip { display: none; } } /* a mouse drags the whole card; the grip is for touch */
.sq-pcard--done { background: var(--surface-muted); box-shadow: none; }
.sq-pcard--done .sq-pcard__name { color: var(--ink-muted); }
.sq-pcard__why { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--warning); }
.sq-pcard__top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px var(--space-2); min-height: 22px; }
.sq-pcard__top .sq-badge { max-width: 100%; font-size: 12px; line-height: 16px; padding: 1px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-pcard__top .sq-badge span { overflow: hidden; text-overflow: ellipsis; }
.sq-pcard__time, .sq-pcard__done { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.sq-pcard__done { color: var(--positive-ink, var(--ink-muted)); font-weight: 600; }
.sq-pcard__time svg, .sq-pcard__done svg { width: 14px; height: 14px; }
.sq-pcard__name { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; -webkit-user-drag: none; }
.sq-pcard__name:hover { color: var(--brand-ink); text-decoration: underline; }
.sq-pcard__meta { color: var(--ink-muted); overflow-wrap: anywhere; }
.sq-pcard__meta a { color: var(--brand-ink); font-weight: 600; text-decoration: none; -webkit-user-drag: none; }
.sq-pcard__note { margin-top: 2px; padding: 2px 6px; border-radius: var(--radius-sm); background: var(--note-soft, var(--surface-muted)); color: var(--note-ink, var(--ink)); overflow-wrap: anywhere; }
.sq-pcard__by { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.sq-pcard__foot { display: flex; align-items: center; gap: 2px; margin-top: 2px; min-height: 32px; }
.sq-pcard__quick { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; flex-wrap: wrap; }
.sq-pcard:not(.sq-pcard--phone) .sq-pcard__foot .sq-iconbtn { width: 30px; height: 30px; }
.sq-pcard__grip { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink-muted); cursor: grab; touch-action: none; }
.sq-pcard__grip:hover { background: var(--surface-muted); }
.sq-pcard__grip:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.sq-pcard--phone { padding: var(--space-3); font-size: 14px; line-height: 20px; }
.sq-pcard--phone .sq-pcard__name { font-size: 16px; line-height: 22px; }
.sq-pcard--phone .sq-pcard__foot { margin-top: var(--space-2); min-height: 44px; gap: var(--space-2); }
.sq-pcard--phone .sq-pcard__quick { gap: var(--space-2); }
.sq-pcard--phone .sq-pcard__quick .sq-btn { min-height: 40px; }
.sq-pcard--phone .sq-pcard__grip { width: 40px; height: 40px; }
.sq-pcard__lead { display: inline-flex; align-items: center; gap: var(--space-1); min-width: 0; }
.sq-pcard--phone .sq-pcard__top { flex-wrap: nowrap; margin: calc(var(--space-1) * -1) calc(var(--space-1) * -1) 0; }
.sq-pcard__quick--fill { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--space-2); width: 100%; }
.sq-pcard__quick--fill .sq-btn { justify-content: center; padding-left: var(--space-2); padding-right: var(--space-2); min-width: 0; }

/* Board: a card on the move. */
.sq-board__ghost { position: fixed; left: 0; top: 0; z-index: 120; pointer-events: none; box-shadow: var(--shadow-pop); opacity: 0.96; }
.sq-board__src { opacity: 0.35; }
.sq-board__ph { border: 2px dashed var(--brand-soft-line, var(--brand)); border-radius: var(--radius-md); background: var(--brand-tint, var(--brand-soft)); }
.sq-board__over { outline: 2px dashed var(--brand-soft-line, var(--brand)); outline-offset: -2px; }

/* DayStrip: the phone's row of days. */
.sq-daystrip { display: flex; gap: var(--space-2); overflow-x: auto; padding: 2px 2px var(--space-2); margin-bottom: var(--space-3); scrollbar-width: none; }
.sq-daystrip::-webkit-scrollbar { display: none; }
.sq-daystrip__day { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sq-daystrip__day--today { border-color: var(--brand); }
.sq-daystrip__day--past { color: var(--ink-muted); }
.sq-daystrip__day[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.sq-daystrip__count { min-width: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-muted); color: var(--ink); font-size: 12px; line-height: 20px; text-align: center; }
.sq-daystrip__day[aria-selected="true"] .sq-daystrip__count { background: rgba(255, 255, 255, 0.24); color: inherit; }

/* Jump to */
.sq-jump { display: flex; flex-direction: column; gap: var(--space-2); }
.sq-jump__input { font-size: 16px; min-height: 48px; }
.sq-jump__status { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.sq-jump__status:empty { display: none; }
.sq-jump__list { display: flex; flex-direction: column; max-height: 55vh; overflow-y: auto; }
.sq-jump__group { padding: var(--space-3) var(--space-2) var(--space-1); font-size: 11px; line-height: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.sq-jump__row { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 48px; padding: var(--space-2); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.sq-jump__row svg { flex: none; width: 16px; height: 16px; color: var(--ink-muted); }
.sq-jump__row[aria-selected="true"] { background: var(--brand-soft); }
.sq-jump__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sq-jump__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-jump__sub { font-size: 13px; line-height: 18px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The keys sheet */
.sq-keys { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.sq-keys__row { display: flex; align-items: center; gap: var(--space-3); }
.sq-keys dt { min-width: 72px; margin: 0; }
.sq-keys dd { margin: 0; font-size: 14px; line-height: 20px; }
.sq-keys kbd, .sq-appbar__kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--radius-sm); background: var(--surface-muted); color: var(--ink); font: 600 12px/18px var(--font-mono); text-align: center; }

/* A row lit for a moment, when Back returns to it. */
@keyframes sq-flash { from { background-color: var(--brand-soft); } to { background-color: transparent; } }
.sq-flash, .sq-flash > td { animation: sq-flash 1.6s ease-out; }
/* A card keeps its own background, so it gets a ring instead. */
@keyframes sq-flash-ring { from { box-shadow: 0 0 0 3px var(--brand); } to { box-shadow: 0 0 0 3px transparent; } }
.sq-pcard.sq-flash { animation: sq-flash-ring 1.6s ease-out; }
@media (prefers-reduced-motion: reduce) { .sq-flash, .sq-flash > td, .sq-pcard.sq-flash { animation: none; } }

/* ======================================================================
   3.0.23.3: the customer while quoting (the quick view, plan §3) and the
   reminder line on a visit (plan §6).
   ====================================================================== */

/* The button beside Save draft: "Pat Kowalski · 3 notes". A long name gives way, the count stays. */
.sq-quickbtn { min-width: 0; max-width: 100%; }
.sq-quickbtn__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-quickbtn__count { flex: none; white-space: nowrap; }
.sq-quickbtn[aria-expanded="true"] { background: var(--brand-soft); border-color: var(--brand-soft-line, var(--brand)); color: var(--brand-ink); }
.sq-draftbar__actions .sq-quickbtn { max-width: 340px; }
@media (max-width: 599px) {
  .sq-draftbar__actions .sq-btn.sq-quickbtn { flex: 2 1 0; max-width: none; } /* the name has the room; Save draft keeps its own */
}
/* A finger's width wherever there's no mouse to point with. */
@media (max-width: 899px), (pointer: coarse) {
  .sq-draftbar__actions .sq-btn { min-height: var(--control); }
}

/* Beside the side panel the page makes room for it, so nothing hides under it: SQ.SidePanel marks
   html.sq-has-sidepanel and --sq-sidepanel-w only while it's at the side (from 900 px). */
@media (min-width: 900px) {
  html.sq-has-sidepanel #smart-quote-app { padding-right: var(--sq-sidepanel-w, 420px); box-sizing: border-box; }
}

/* What the view holds. With SQ.SidePanel its head is the mock-up's: the initials, the name, then the status and Open full record. */
.sq-quick__head { display: flex; align-items: flex-start; gap: 12px; }
.sq-quick__who { flex: 1; min-width: 0; }
.sq-quick__name { margin: 0; font-size: 19px; line-height: 26px; font-weight: 600; overflow-wrap: anywhere; }
.sq-quick__head .sq-quick__top { margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.sq-quick { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.sq-quick__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.sq-quick__top:focus { outline: none; }
.sq-quick__full { display: inline-flex; align-items: center; gap: 4px; }
.sq-quick__full svg { flex: none; width: 14px; height: 14px; }
.sq-customer__facts.sq-quick__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
.sq-quick__wide { grid-column: 1 / -1; }
.sq-quick__box { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-muted); }
.sq-quick__row { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.sq-quick__row strong { font-weight: 600; }
.sq-quick__row > span { color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.sq-quick .sq-tabs { margin-bottom: 0; }
.sq-quick__pane[hidden] { display: none; }
.sq-quick .sq-notes__composer .sq-textarea { min-height: 64px; }
@media (max-width: 899px), (pointer: coarse) {
  .sq-quick .sq-btn--sm, .sq-quick .sq-linkbtn, .sq-quick__full, .sq-quick .sq-seg .sq-seg__btn { min-height: var(--control); }
  .sq-quick__head .sq-quick__full { margin: -10px 0; } /* in the head, the same tap without a taller head */
  /* The mobile and email: a finger's height to tap, drawn as the text they are. */
  .sq-quick__facts a { display: inline-block; padding: 11px 0; margin: -11px 0; }
}
/* Where a photo was taken: a finger to tap on a touch screen, a pointer to aim at otherwise, drawn as before. */
.sq-quick .sq-place { min-height: 24px; margin: -3px 0; }
@media (max-width: 899px), (pointer: coarse) { .sq-quick .sq-place { min-height: var(--control); margin: -13px 0; } }
@media (max-width: 359px) { .sq-customer__facts.sq-quick__facts { grid-template-columns: minmax(0, 1fr); } }

/* As a sheet (before SQ.SidePanel, and under 900 px with it): tall enough to read the notes. */
.sq-sheet2__panel.sq-quick-sheet { max-width: 560px; height: 86vh; height: 86dvh; }
.sq-quick-sheet .sq-sheet2__head { padding-bottom: 0; }
.sq-quick-sheet .sq-sheet2__body { flex: 1 1 auto; min-height: 0; padding-top: 0; }
@media (max-width: 599px) {
  .sq-sheet2__panel.sq-quick-sheet { height: 92vh; height: 92dvh; }
}

/* "Reminder emailed Sun 9:00 am", on the customer's visit. */
.sq-remindline { display: inline-flex; align-items: center; gap: 4px; color: var(--positive-ink); }
.sq-remindline svg { flex: none; width: 14px; height: 14px; }
.sq-quick__row > .sq-quick__remind { color: var(--positive-ink); }
