/* TechnoCartManagement — app components on top of the Fabkin theme.
   All colours come from Fabkin's variables (--pe-*), so light/dark mode and theme colours just work. */

:root {
  --tc-border: var(--pe-border-color);
  --tc-muted: var(--pe-secondary-color);
  --tc-surface: var(--pe-secondary-bg);
  --tc-soft: var(--pe-tertiary-bg);
  --tc-primary: var(--pe-primary);
}

/* ---------- Font: Poppins everywhere ----------
   The theme loads Poppins (and Inter) from Google Fonts; it used Poppins only for headings and Inter for the rest.
   Codes (QR / product codes) keep their monospaced font (.mono). */
:root, [data-bs-theme] {
  --pe-font-sans-serif: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --pe-body-font-family: var(--pe-font-sans-serif);
}
body, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6 { font-family: var(--pe-font-sans-serif); }

/* ---------- Brand ---------- */
.tc-brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--pe-emphasis-color); }
.tc-mark {
  width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; flex: none;
  background: var(--pe-primary); color: #fff; font-weight: 700; font-size: .9rem; letter-spacing: .02em;
}
.tc-brand-text { font-weight: 700; font-size: 1rem; line-height: 1.15; min-width: 0; overflow-wrap: anywhere; }
.pe-app-sidebar-logo .tc-brand { min-width: 0; max-width: 100%; }
.tc-brand-text span { color: var(--pe-primary); }
[data-sidebar=icon] .tc-brand-text { display: none; }
.tc-avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary); font-weight: 600; font-size: .8rem;
}
.tc-avatar-btn { padding: 0; }
.tc-header-search .form-control { width: 240px; }
.pe-nav-link .badge { margin-inline-start: auto; }

/* ---------- Page scaffolding ---------- */
.page-header { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin: .75rem 0 1.25rem; }
.page-header h1 { font-size: 1.25rem; font-weight: 600; margin: 0; }
.page-header .sub { color: var(--tc-muted); font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: Consolas, "SF Mono", Menlo, monospace; font-size: .85em; }
.min-w-0 { min-width: 0; }
.cursor-pointer { cursor: pointer; }
.validation-summary-valid { display: none; }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.filter-bar .form-control, .filter-bar .form-select { min-width: 140px; }
.tc-filter-row { display: flex; gap: .5rem; }
.tc-filter-row .ts-dropdown { min-width: 14rem; }
.tc-filter-row > div:last-child:not(:first-child) .ts-dropdown { left: auto; right: 0; }   /* the right-hand list opens leftwards, staying on screen */
@media (max-width: 767.98px) {
  /* phones: the search box and its buttons share one row; more filters unfold below on their own rows */
  .filter-bar { align-items: center; }
  .filter-bar:not(.expanded) .tc-more { display: none !important; }
  .filter-bar > div:first-of-type { flex: 1 1 0; min-width: 0 !important; }
  .filter-bar > div:first-of-type > .form-label { display: none; }
  .filter-bar > div:first-of-type .input-group-text { display: none; }   /* the search button beside it already says "search" */
  .filter-bar > div:first-of-type .input-group > .form-control { border-radius: var(--pe-border-radius) !important; }
  .filter-bar .form-control, .filter-bar .form-select { min-width: 0; }
  .filter-bar > div:last-child { flex: none; }
  .filter-bar.expanded .tc-more { flex: 1 1 100%; order: 2; }
  .filter-bar.expanded > div:last-child { order: 1; }
  /* drop-downs that are always shown (Staff: role, showroom) get a full row under the search, side by side, so they
     are wide enough to read and their list doesn't squeeze into a narrow column */
  .filter-bar > .btn:last-child { order: 1; }
  .filter-bar > .tc-filter-row { order: 2; flex: 1 1 100%; }
  .filter-bar > .tc-filter-row > div { flex: 1 1 0; min-width: 0; }
}
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--tc-muted); }
.empty-state > i { font-size: 2.5rem; display: block; margin-bottom: .5rem; opacity: .6; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--tc-muted); font-weight: 600; white-space: nowrap; }
.table-hover tbody tr[data-href] { cursor: pointer; }
.table > tbody > tr.section-row > td { background: var(--tc-soft); color: var(--pe-body-color); }
.status-badge { font-size: .72rem; padding: .35em .6em; border-radius: 999px; font-weight: 600; }
.chart-box { position: relative; height: 260px; }
.toast-container { z-index: 1090; }

/* KPI tiles */
.kpi { padding: 1rem 1.1rem; height: 100%; }
.kpi .label { font-size: .75rem; color: var(--tc-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.kpi .value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin-top: .25rem; font-variant-numeric: tabular-nums; }
.kpi .meta { font-size: .8rem; color: var(--tc-muted); }
.kpi .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; float: right; }
.icon-blue { background: var(--pe-info-bg-subtle); color: var(--pe-info-text-emphasis); }
.icon-green { background: var(--pe-success-bg-subtle); color: var(--pe-success-text-emphasis); }
.icon-amber { background: var(--pe-warning-bg-subtle); color: var(--pe-warning-text-emphasis); }
.icon-red { background: var(--pe-danger-bg-subtle); color: var(--pe-danger-text-emphasis); }
.icon-primary { background: var(--pe-primary-bg-subtle); color: var(--pe-primary); }

/* ---------- Quotation editor ---------- */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.25rem; align-items: start; }
@media (max-width: 1199.98px) { .editor-grid { grid-template-columns: minmax(0, 1fr); } }
.editor-side { position: sticky; top: calc(var(--pe-app-header-height) + 16px); }
.section-card { border-inline-start: 3px solid var(--pe-primary); }
.section-card .section-title { border: 0; background: transparent; font-weight: 600; font-size: 1rem; padding: .2rem .35rem; border-radius: .35rem; width: 100%; color: inherit; }
.section-card .section-title:focus { outline: 2px solid var(--pe-primary-border-subtle); background: var(--tc-soft); }
.items-table { margin: 0; }
.items-table td { vertical-align: top; padding: .45rem .35rem; }
.items-table th { padding: .45rem .35rem; }
.items-table .form-control, .items-table .form-select { font-size: .85rem; padding: .3rem .45rem; }
.items-table .col-idx { width: 28px; color: var(--tc-muted); padding-top: .75rem; }
.items-table .col-qty { width: 96px; }
.items-table .col-rate { width: 110px; }
.items-table .col-disc { width: 132px; }
.items-table .col-gst { width: 78px; }
.items-table .col-amt { width: 120px; }
.items-table .col-act { width: 36px; }
.items-table .item-thumb { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; border: 1px solid var(--tc-border); flex: none; }
.items-table .item-meta { font-size: .75rem; color: var(--tc-muted); margin-top: 3px; }
.items-table .amount { font-weight: 600; padding-top: .45rem; }
.items-table .amount small { display: block; font-weight: 400; color: var(--tc-muted); font-size: .72rem; }
.items-table tr.over-limit td { background: var(--pe-warning-bg-subtle); }
.ts-wrapper.form-control, .ts-wrapper.form-select { padding: 0 !important; }
.ts-dropdown .option .opt-title { font-weight: 600; }
.ts-dropdown .option .opt-sub { font-size: .75rem; color: var(--tc-muted); }
.ts-dropdown .option img { width: 32px; height: 32px; object-fit: cover; border-radius: 5px; margin-right: .5rem; }
.ts-control, .ts-dropdown { background: var(--tc-surface) !important; color: var(--pe-body-color); border-color: var(--tc-border); }
.totals-table td { padding: .3rem 0; }
.totals-table .grand td { border-top: 2px solid var(--tc-border); font-size: 1.2rem; font-weight: 700; padding-top: .6rem; }
.words { font-size: .8rem; color: var(--tc-muted); font-style: italic; }

/* ---------- Details ---------- */
.info-list dt { font-weight: 500; color: var(--tc-muted); font-size: .8rem; }
.info-list dd { margin-bottom: .6rem; }
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 4px; bottom: 4px; width: 2px; background: var(--tc-border); }
.timeline li { position: relative; padding: 0 0 1rem 2.1rem; }
.timeline li .dot { position: absolute; left: 4px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--tc-surface); border: 3px solid var(--pe-info); }
.timeline li .dot.green { border-color: var(--pe-success); }
.timeline li .dot.red { border-color: var(--pe-danger); }
.timeline li .dot.amber { border-color: var(--pe-primary); }
.timeline .t-title { font-weight: 600; font-size: .85rem; }
.timeline .t-meta { font-size: .75rem; color: var(--tc-muted); }

/* ---------- Sign-in (Fabkin auth layout: centred card over soft shapes) ---------- */
.tc-auth { position: relative; min-height: 100vh; overflow: hidden; background: var(--tc-auth-bg); isolation: isolate;
  --tc-auth-bg: #f4f5f7; --tc-auth-shape: linear-gradient(115deg, #eceef1 0%, #f6f7f8 100%); --tc-auth-shape-2: linear-gradient(100deg, #e2e5e9 0%, #eef0f2 100%);
  --tc-auth-stripe: rgba(255, 255, 255, .55); --tc-auth-glow: rgba(var(--pe-primary-rgb), .16); --tc-auth-card: rgba(255, 255, 255, .86); }
[data-bs-theme=dark] .tc-auth { --tc-auth-bg: #222; --tc-auth-shape: linear-gradient(115deg, #1b1b1b 0%, #1e1e1e 100%); --tc-auth-shape-2: linear-gradient(100deg, #181818 0%, #1d1d1d 100%);
  --tc-auth-stripe: rgba(255, 255, 255, .025); --tc-auth-glow: rgba(var(--pe-primary-rgb), .14); --tc-auth-card: rgba(38, 38, 38, .88); }
.tc-auth-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.tc-auth-bg span { position: absolute; display: block; border-radius: 999px; }
.tc-auth-bg .s1 { width: 52vw; height: 26vw; min-width: 520px; min-height: 260px; right: -6vw; top: 24%; background: var(--tc-auth-shape); }
.tc-auth-bg .s2 { width: 50vw; height: 20vw; min-width: 460px; min-height: 190px; left: -14vw; bottom: -6vw; transform: rotate(-12deg); background: var(--tc-auth-shape-2); }
.tc-auth-bg .s3 { width: 40vw; height: 140vh; left: -6vw; top: -30vh; border-radius: 0; transform: rotate(-22deg);
  background: repeating-linear-gradient(90deg, var(--tc-auth-stripe) 0 4vw, transparent 4vw 7vw); }
.tc-auth-bg .glow { width: 620px; height: 620px; left: 50%; top: 50%; transform: translate(-50%, -50%); filter: blur(70px);
  background: radial-gradient(circle, var(--tc-auth-glow), transparent 65%); }
.tc-auth-card { border: 1px solid var(--tc-border); border-radius: 1.25rem; background: var(--tc-auth-card); backdrop-filter: blur(14px);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 28px 56px -16px rgba(16, 24, 40, .22); animation: tcAuthIn .45s ease-out both; }
.tc-auth-card .card-body { padding: 2.75rem 2.25rem 2.25rem; }
@media (max-width: 575.98px) { .tc-auth-card .card-body { padding: 2rem 1.25rem 1.5rem; } }
@keyframes tcAuthIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tc-auth-card { animation: none; } }
.tc-auth-mark { width: 60px; height: 60px; border-radius: 18px; display: inline-grid; place-items: center; font-weight: 700; font-size: 1.35rem; letter-spacing: .02em; color: #fff;
  background: linear-gradient(140deg, var(--tc-primary-soft, #f7925c) 0%, var(--pe-primary) 55%, var(--tc-primary-active, #d9561b) 100%); box-shadow: 0 12px 24px -8px rgba(var(--pe-primary-rgb), .55), inset 0 1px 0 rgba(255, 255, 255, .25); }
.tc-auth-logo { height: 56px; max-width: 220px; object-fit: contain; }
.tc-auth-app { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--pe-primary); }
.tc-auth-title { font-size: 1.6rem; font-weight: 700; margin: .25rem 0 .4rem; }
.tc-auth-field { position: relative; }
.tc-auth-field > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--tc-muted); font-size: 1.1rem; pointer-events: none; z-index: 2; }
.tc-auth-field .form-control { padding-left: 2.75rem; font-size: 1rem; border-radius: .75rem; }
.tc-auth-field .form-control:focus { box-shadow: 0 0 0 4px var(--pe-primary-bg-subtle); border-color: var(--pe-primary); }
.tc-auth-field:focus-within > i { color: var(--pe-primary); }
.tc-auth-field #pwd { padding-right: 3rem; }
.tc-auth-eye { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--tc-muted); width: 36px; height: 36px; border-radius: .5rem; display: grid; place-items: center; font-size: 1.1rem; z-index: 2; }
.tc-auth-eye:hover { color: var(--pe-body-color); background: var(--tc-soft); }
.tc-auth-eye:focus-visible { outline: 2px solid var(--pe-primary); }
.tc-auth-submit { border-radius: .75rem; font-weight: 600; padding-top: .75rem; padding-bottom: .75rem; box-shadow: 0 10px 20px -10px rgba(var(--pe-primary-rgb), .7); transition: transform .15s, box-shadow .15s; }
.tc-auth-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 24px -10px rgba(var(--pe-primary-rgb), .8); }
.tc-auth-errors ul { margin: 0; padding: 0; list-style: none; }
.tc-auth-foot { position: relative; text-align: center; font-size: .75rem; color: var(--tc-muted); margin: 1.25rem 0 0; }
.tc-auth-theme { position: fixed; top: 1rem; right: 1rem; z-index: 5; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; padding: 0;
  background: var(--tc-auth-card); border: 1px solid var(--tc-border); color: var(--pe-body-color); font-size: 1.15rem; backdrop-filter: blur(8px); }
.tc-auth-theme:hover { color: var(--pe-primary); border-color: var(--pe-primary-border-subtle); }

/* ---------- Public quotation page ---------- */
.public-wrap { max-width: 980px; margin: 0 auto; padding: 1.25rem 1rem 6rem; }
.tc-public-bar { background: var(--tc-surface); border-bottom: 1px solid var(--tc-border); position: sticky; top: 0; z-index: 10; }
.tc-public-inner { max-width: 980px; margin: 0 auto; padding: .65rem 1rem; }
.tc-public-logo { height: 44px; max-width: 140px; object-fit: contain; }
.tc-public-hero { border-top: 4px solid var(--pe-primary); }
.tc-public-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: .5rem; border: 1px solid var(--tc-border); flex: none; }
body:has(.tc-public-bar) { background: var(--pe-body-bg); }

/* ---------- Carts (sales person's phone) ---------- */
.cart-list .cart-card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
@media (hover: hover) {   /* with a mouse: the card under the cursor lifts and gets a theme-coloured edge */
  .cart-list .cart-card:hover { transform: translateY(-3px); border-color: rgba(var(--pe-primary-rgb), .45);
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .22), 0 0 0 1px rgba(var(--pe-primary-rgb), .45); }
  .cart-list .cart-card.is-idle:hover { box-shadow: inset 3px 0 0 var(--pe-primary), 0 12px 28px -10px rgba(0, 0, 0, .22), 0 0 0 1px rgba(var(--pe-primary-rgb), .45); }
  .cart-list .cart-card:hover .tc-cart-name { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
  .tc-q-card:hover { border-color: rgba(var(--pe-primary-rgb), .45); box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .22), 0 0 0 1px rgba(var(--pe-primary-rgb), .45); }
}
/* Touch screens have no hover: the card being pressed gets the same outline and shadow and sinks a little under the finger
   (site.js adds .is-pressed; it clears when the finger lifts or the page starts scrolling) */
.cart-list .cart-card, .tc-q-card { -webkit-tap-highlight-color: transparent; }
.tc-q-card { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.cart-list .cart-card.is-pressed, .tc-q-card.is-pressed { transform: scale(.985); border-color: rgba(var(--pe-primary-rgb), .5);
  box-shadow: 0 8px 22px -10px rgba(0, 0, 0, .28), 0 0 0 1px rgba(var(--pe-primary-rgb), .5); }
.cart-list .cart-card.is-idle.is-pressed { box-shadow: inset 3px 0 0 var(--pe-primary), 0 8px 22px -10px rgba(0, 0, 0, .28), 0 0 0 1px rgba(var(--pe-primary-rgb), .5); }

/* an open ⋮ menu: the card holds still so the menu stays put */
.cart-card:has(.dropdown-menu.show), .tc-q-card:has(.dropdown-menu.show) { transform: none !important; }
.cart-card .cart-value { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-pill { font-size: .7rem; font-weight: 600; padding: .25em .6em; border-radius: 999px; }
.cart-toolbar { position: sticky; top: var(--pe-app-header-height); z-index: 20; background: var(--pe-body-bg); padding: .5rem 0; margin: 0 0 .5rem; }
.cart-item { border-radius: .6rem; }
.cart-item .thumb { width: 56px; height: 56px; border-radius: .5rem; object-fit: cover; flex: none; background: var(--tc-soft); display: grid; place-items: center; color: var(--tc-muted); font-size: 1.4rem; }
.cart-item .line-amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-item .qty-chip { font-size: .78rem; background: var(--tc-soft); border-radius: .4rem; padding: .15rem .5rem; }
.mode-switch .btn { font-size: .8rem; }
.cart-summary { position: sticky; bottom: 0; z-index: 25; background: var(--tc-surface); border-top: 1px solid var(--tc-border);
  margin: 1rem calc(var(--pe-gutter-x, 1.5rem) * -.5) 0; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); box-shadow: 0 -6px 18px rgba(0,0,0,.06); }
.cart-summary .grand { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (min-width: 992px) { .cart-summary { position: static; box-shadow: none; border: 1px solid var(--tc-border); border-radius: .75rem; margin: 0; } }

/* Scanner */
.scanner-box { position: relative; border-radius: .75rem; overflow: hidden; background: #000; aspect-ratio: 1 / 1; max-height: 70vh; margin: 0 auto; }
.scanner-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner-box .frame { position: absolute; inset: 15%; border: 3px solid rgba(255,255,255,.9); border-radius: 1rem; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); pointer-events: none; }
.scanner-box .scan-line { position: absolute; left: 15%; right: 15%; height: 2px; background: var(--pe-primary); top: 15%; animation: scanline 2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 16%; } 50% { top: 84%; } }
@media (prefers-reduced-motion: reduce) { .scanner-box .scan-line { animation: none; top: 50%; } }

@media print {
  .pe-app-sidebar, .app-header, .footer, .no-print, .cart-summary { display: none !important; }
  .app-wrapper { margin: 0 !important; }
}

/* Themed confirm dialog */
.tc-dialog-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.6rem; }

/* ---------- Settings ---------- */
.tc-group-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--pe-primary-bg-subtle); color: var(--pe-primary); }
.tc-setting-row { display: flex; gap: 1.5rem; align-items: center; justify-content: space-between; padding: 1rem 0; border-bottom: 1px dashed var(--tc-border); }
.tc-setting-row:last-child { border-bottom: 0; }
.tc-setting-row.is-dirty .tc-setting-text .fw-medium { color: var(--pe-primary); }
.tc-setting-row.has-error { background: var(--pe-danger-bg-subtle); margin: 0 -1rem; padding-inline: 1rem; }
.tc-setting-text { min-width: 0; max-width: 640px; }
.tc-setting-control { flex: none; }
.tc-num-input { width: 150px; }
.tc-text-input { width: 300px; }
@media (max-width: 575.98px) {
  .tc-setting-row { flex-direction: column; align-items: stretch; gap: .75rem; }
  .tc-setting-control { align-self: flex-start; }
  .tc-text-input { width: 100%; }
  .tc-segmented { display: flex; width: 100%; } .tc-segmented .btn { flex: 1; }
}
.tc-savebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1003; background: var(--tc-surface); border-top: 1px solid var(--tc-border);
  box-shadow: 0 -8px 24px rgba(0,0,0,.08); padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom)); }
@media (min-width: 992px) { .tc-savebar { left: var(--pe-app-sidebar-width); } }
body.has-savebar .app-wrapper { padding-bottom: 5rem; }
.tc-savebar-inner { display: flex; align-items: center; gap: .75rem; }
.tc-savebar-info { display: flex; align-items: center; gap: .65rem; min-width: 0; margin-right: auto; }
.tc-savebar-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  background: var(--pe-warning-bg-subtle); color: var(--pe-warning-text-emphasis); font-size: 1.1rem; }
.tc-savebar-actions { display: flex; gap: .5rem; flex: none; }
.tc-savebar-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding-inline: 1.15rem;
  border-radius: 10px; font-weight: 600; white-space: nowrap; }
@media (max-width: 575.98px) {   /* phones: the message on one line, two full-width buttons under it */
  .tc-savebar-inner { flex-wrap: wrap; row-gap: .65rem; }
  .tc-savebar-info, .tc-savebar-actions { flex: 1 1 100%; }
  .tc-savebar-actions .btn { flex: 1 1 0; }
  .tc-savebar-actions #saveBtn { flex-grow: 1.6; }
  body.has-savebar .app-wrapper { padding-bottom: 9rem; }
}
.tc-logo-drop { border: 1px dashed var(--tc-border); border-radius: .75rem; height: 150px; display: grid; place-items: center; text-align: center; background: var(--tc-soft); overflow: hidden; padding: 1rem; }
.tc-logo-drop img { max-width: 100%; max-height: 118px; object-fit: contain; }
@media (min-width: 1200px) { .tc-sticky-actions { position: sticky; top: calc(var(--pe-app-header-height) + 16px); } }

/* Choice cards (radio as card) */
.tc-choice-card { display: block; cursor: pointer; border: 1px solid var(--tc-border); border-radius: .75rem; padding: 1rem; transition: border-color .15s, box-shadow .15s; }
.tc-choice-card:hover { border-color: var(--pe-primary-border-subtle); }
.btn-check:checked + .tc-choice-card { border-color: var(--pe-primary); box-shadow: 0 0 0 3px var(--pe-primary-bg-subtle); }
.btn-check:focus-visible + .tc-choice-card { outline: 2px solid var(--pe-primary); outline-offset: 2px; }
.tc-choice-icon { font-size: 1.4rem; color: var(--pe-primary); display: block; margin-bottom: .35rem; }
.tc-online-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--pe-success); border: 2px solid var(--tc-surface); }
.fs-10 { font-size: .625rem; }
.tc-audit-day { background: var(--tc-soft); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--tc-muted); padding-top: .4rem; padding-bottom: .4rem; }
.flex-none { flex: none; }

/* ---------- QR labels ---------- */
.tc-step { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; background: var(--pe-primary); color: #fff; font-size: .75rem; font-weight: 700; }
.tc-label-list { max-height: 62vh; overflow-y: auto; }
@media (max-width: 991.98px) { .tc-label-list { max-height: none; } }
.tc-label-row { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; border-bottom: 1px solid var(--tc-border); }
.tc-label-row:last-child { border-bottom: 0; }
.tc-label-row label { cursor: pointer; }
.tc-label-row.is-selected { background: var(--pe-primary-bg-subtle); }
.tc-label-row.is-disabled { opacity: .6; }
.tc-label-row.is-disabled label { cursor: not-allowed; }
.tc-thumb { width: 40px; height: 40px; border-radius: .5rem; object-fit: cover; flex: none; background: var(--tc-soft); display: grid; place-items: center; color: var(--tc-muted); font-size: 1.1rem; border: 1px solid var(--tc-border); }
.tc-copies { width: 116px; }
.tc-copies .form-control { -moz-appearance: textfield; padding-inline: .25rem; }
.tc-copies .form-control::-webkit-outer-spin-button, .tc-copies .form-control::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
@media (max-width: 575.98px) { .tc-label-row { flex-wrap: wrap; } .tc-copies { margin-left: 2rem; } }
.tc-sheet-thumb-wrap { width: 68px; height: 68px; display: grid; place-items: center; flex: none; }
.tc-sheet-thumb .paper { fill: var(--tc-surface); stroke: var(--tc-border); }
.tc-sheet-thumb .cell { fill: var(--tc-soft); stroke: var(--pe-border-color); stroke-width: .4; }
.tc-sheet-thumb .cell.on { fill: var(--pe-primary-bg-subtle); stroke: var(--pe-primary); }
.tc-sheet { display: grid; gap: 4px; padding: 8px; max-width: 260px; margin: 0 auto; background: var(--tc-soft); border: 1px solid var(--tc-border); border-radius: .5rem; max-height: 340px; overflow-y: auto; }
.tc-sheet-cell { aspect-ratio: var(--ar, 2 / 1); min-height: 22px; border: 1px dashed var(--pe-border-color); border-radius: 3px; background: var(--tc-surface); font-size: .65rem; color: var(--tc-muted); display: grid; place-items: center; padding: 0; line-height: 1; }
.tc-sheet-cell:hover { border-color: var(--pe-primary); color: var(--pe-primary); }
.tc-sheet-cell.used { background: repeating-linear-gradient(45deg, var(--tc-soft), var(--tc-soft) 3px, transparent 3px, transparent 6px); color: transparent; border-style: solid; }
.tc-sheet-cell.start { background: var(--pe-primary); border: 1px solid var(--pe-primary); color: #fff; font-size: .8rem; }
.tc-sheet-cell:focus-visible { outline: 2px solid var(--pe-primary); outline-offset: 1px; }
.tc-sheet-thumb .cell.dim { fill: var(--tc-soft); stroke: var(--pe-border-color); }
.tc-layout-list { max-height: 70vh; overflow-y: auto; }
.tc-layout-list .active-layout { background: var(--pe-primary-bg-subtle); box-shadow: inset 3px 0 0 var(--pe-primary); }
@media (max-width: 1199.98px) { .tc-layout-list { max-height: 260px; } }
@media (min-width: 992px) { .tc-preview-sticky { position: sticky; top: calc(var(--pe-app-header-height) + 16px); } }
.tc-label-stage { display: grid; place-items: center; min-height: 180px; padding: 8px; border-radius: .5rem; overflow: hidden;
  background: repeating-conic-gradient(var(--tc-soft) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.tc-label-paper { background: #fff; color: #111; display: flex; align-items: stretch; box-shadow: 0 2px 10px rgba(0,0,0,.15); outline: 1px dashed #c8ced6; overflow: hidden; }
.tc-label-paper.bordered { outline: 1px solid #b0b7c0; }
.tc-label-paper.vertical { flex-direction: column; align-items: center; }
.tc-label-qr { flex: none; align-self: center; color: #111; }
.tc-label-qr svg { width: 100%; height: 100%; display: block; }
.tc-label-textbox { flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; position: relative; }
.tc-label-paper.vertical .tc-label-textbox { width: 100%; margin-top: 2%; display: flex; justify-content: center; }
.tc-label-text { font-family: "Segoe UI", Arial, sans-serif; line-height: 1.2; }
.tc-label-paper.vertical .tc-label-text { text-align: center; }
.tc-label-text .tl { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tc-label-text .tl-company { font-weight: 600; color: #555; }
.tc-label-text .tl-name { font-weight: 700; }
.tc-label-text .tl-code { font-family: Consolas, "Courier New", monospace; }
.tc-label-text .tl-spec { color: #444; }
.tc-label-text .tl-brand { font-style: italic; }
.tc-label-text .tl-price { font-weight: 700; }
.tc-label-text .tl-mrp { color: #555; }
.tc-printbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1003; background: var(--tc-surface); border-top: 1px solid var(--tc-border);
  box-shadow: 0 -8px 24px rgba(0,0,0,.08); padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); }
@media (max-width: 991.98px) { body.has-printbar .app-wrapper { padding-bottom: 4.5rem; } }
.tc-grid-1 { grid-template-columns: minmax(0, 1fr); }

/* ---------- Lists ---------- */
.tc-type-tabs { gap: .35rem; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tc-type-tabs::-webkit-scrollbar { display: none; }
.tc-type-tabs .nav-link { white-space: nowrap; border: 1px solid var(--tc-border); background: var(--tc-surface); color: var(--pe-body-color); padding: .4rem .85rem; }
.tc-type-tabs .nav-link.active { border-color: var(--pe-primary); background: var(--pe-primary); color: #fff; }
.tc-bulkbar { display: flex; align-items: center; gap: .75rem; padding: .5rem 1rem; background: var(--pe-primary-bg-subtle); border-bottom: 1px solid var(--pe-primary-border-subtle); position: sticky; top: var(--pe-app-header-height, 70px); z-index: 5; }
/* Switched-off / hidden rows: the content is dimmed, the action buttons and their menus are not. (Dimming the whole row would
   trap its menu under the next rows and fade it.) */
.tc-row-off > td, .list-group-item.tc-row-off > * { opacity: .6; }
.tc-row-off > td:has(.dropdown), .list-group-item.tc-row-off > :has(.dropdown), .list-group-item.tc-row-off > .dropdown { opacity: 1; }
.tc-drop { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 1.5rem 1rem; border: 2px dashed var(--tc-border); border-radius: .75rem; background: var(--tc-soft); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.tc-drop > i { font-size: 2rem; color: var(--pe-success); }
.tc-drop:hover, .tc-drop.dragging { border-color: var(--pe-primary); background: var(--pe-primary-bg-subtle); }
.tc-drop.has-file { border-style: solid; border-color: var(--pe-success); }
#importFile:focus-visible + .tc-drop { outline: 2px solid var(--pe-primary); outline-offset: 2px; }

/* ---------- Product details ---------- */
.tc-product-hero { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--tc-soft); }
.tc-product-placeholder { display: grid; place-items: center; color: var(--pe-primary); background: var(--pe-primary-bg-subtle); font-size: 4rem; }
@media (max-width: 991.98px) { .tc-product-placeholder { aspect-ratio: 21 / 9; font-size: 3rem; } }
.tc-price { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tc-qr { background: #fff; padding: 6px; border-radius: .5rem; border: 1px solid var(--tc-border); }
.tc-specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .25rem 1.5rem; }
.tc-specs > div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--tc-border); }
.tc-specs dt { font-weight: 400; color: var(--tc-muted); }
.tc-specs dd { margin: 0; font-weight: 500; text-align: right; }
.tc-calc-result { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; padding: 1rem; border-radius: .75rem; background: var(--pe-primary-bg-subtle); }
@media (max-width: 575.98px) { .tc-calc-result { grid-template-columns: 1fr 1fr; } .tc-calc-result > div:first-child { grid-column: 1 / -1; } }
.tc-cart-menu { min-width: 300px; max-height: 60vh; overflow-y: auto; }
@media (max-width: 767.98px) { body.has-printbar-sm .app-wrapper { padding-bottom: 5rem; } }
.tc-photo-drop { display: grid; place-items: center; height: 220px; border: 2px dashed var(--tc-border); border-radius: .75rem; background: var(--tc-soft); cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; margin: 0; }
.tc-photo-drop img { max-width: 100%; max-height: 216px; object-fit: contain; }
.tc-photo-drop:hover, .tc-photo-drop.dragging { border-color: var(--pe-primary); background: var(--pe-primary-bg-subtle); }
#imgInput:focus-visible + .tc-photo-drop { outline: 2px solid var(--pe-primary); outline-offset: 2px; }
.tc-segmented { flex-wrap: wrap; }
/* Fabkin's menu script marks links active by URL substring; only the server-chosen link (tc-current) may look active. */
.pe-app-sidebar .pe-app-sidebar-menu .pe-nav-link.active:not(.tc-current) { font-weight: inherit; color: var(--pe-app-sidebar-menu-item-color); }
/* Save / cancel card: sticky beside the form on wide screens, a fixed bar at the bottom on phones and tablets. */
@media (max-width: 1199.98px) {
  .card.tc-sticky-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1003; margin: 0; border-radius: 0; border-width: 1px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,.08); }
  .card.tc-sticky-actions > .card-body { display: flex !important; flex-direction: row-reverse; gap: .5rem; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); }
  .card.tc-sticky-actions > .card-body > .btn { flex: 1 1 0; }
  .card.tc-sticky-actions > .card-body > :not(.btn) { display: none; }
  .card.tc-sticky-actions .btn-lg { font-size: 1rem; padding: .55rem 1rem; }
  body:has(.card.tc-sticky-actions) .app-wrapper { padding-bottom: 5rem; }
}
@media (min-width: 992px) and (max-width: 1199.98px) { .card.tc-sticky-actions { left: var(--pe-app-sidebar-width); } }
.tc-avatar-lg { width: 56px; height: 56px; font-size: 1.2rem; }
/* Contact rows: the icon sits in the same 32px square as the card's heading icon, in one column under it, centred on the row */
.tc-contact .list-group-item { display: flex; align-items: center; gap: .75rem; padding: .8rem var(--pe-card-cap-padding-x, 1.25rem); }
.tc-contact .list-group-item > i { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  background: var(--pe-tertiary-bg); color: var(--tc-muted); font-size: 1.05rem; }
.tc-contact-label { font-size: .75rem; line-height: 1.2; color: var(--tc-muted); }
/* Inside a card, list rows use the same side spacing as the card's heading, body and footer (the theme gives rows 12px
   against 20px elsewhere), so heading icon, row icons, text and buttons line up in one column. A row's icon keeps its
   size and sits in the middle of the row. */
.card > .list-group-flush > .list-group-item,
.card > .tab-content > .tab-pane > .list-group-flush > .list-group-item { padding-inline: var(--pe-card-cap-padding-x, 1.25rem); }
.card .list-group-item > .tc-group-icon { flex: none; }
.card .list-group-item.d-flex:has(> .tc-group-icon) { align-items: center !important; }
.tc-icon-list > .list-group-item { padding-inline: var(--pe-card-cap-padding-x, 1.25rem); }
.tc-icon-list > .list-group-item:has(> .tc-group-icon) { display: flex; align-items: center; gap: .75rem; }
/* Tables inside a card: the first and last columns keep the card's side spacing too */
.card > .table-responsive > .table > :not(caption) > tr > :first-child,
.card > .table > :not(caption) > tr > :first-child { padding-left: var(--pe-card-cap-padding-x, 1.25rem); }
.card > .table-responsive > .table > :not(caption) > tr > :last-child,
.card > .table > :not(caption) > tr > :last-child { padding-right: var(--pe-card-cap-padding-x, 1.25rem); }
.tc-contact-value { display: block; margin-top: .15rem; font-size: .9375rem; color: var(--pe-body-color); overflow-wrap: anywhere; }
a.tc-contact-value { color: var(--pe-link-color); }
.tc-contact-value.is-empty { color: var(--tc-muted); }
.tc-contact-alt { margin-top: .15rem; font-size: .8125rem; color: var(--tc-muted); }

/* Customer history: Quotations / Visits switch and tappable rows */
.tc-history > .card-header { padding-bottom: .75rem; border-bottom: 0; }
.tc-history .tc-seg-item { flex: 1 1 0; }
@media (min-width: 576px) { .tc-history .tc-seg { max-width: 380px; } }
.tc-history .tc-seg-item > i { font-size: 1rem; }
.tc-history-list { list-style: none; margin: 0; padding: 0; }
.tc-history-row { display: flex; align-items: center; gap: .75rem; padding: .8rem var(--pe-card-spacer-x, 1.25rem); border-top: 1px solid var(--tc-border);
  color: var(--pe-body-color); text-decoration: none; -webkit-tap-highlight-color: transparent; transition: background-color .15s; }
.tc-history-row:hover, .tc-history-row:focus-visible { background: var(--pe-tertiary-bg); color: var(--pe-body-color); }
.tc-history-row:active { background: var(--pe-primary-bg-subtle); }
.tc-history-list > li:last-child .tc-history-row { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.tc-history-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; font-size: 1.15rem;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary); }
.tc-history-icon.tone-success { background: var(--pe-success-bg-subtle); color: var(--pe-success-text-emphasis); }
.tc-history-icon.tone-secondary { background: var(--pe-tertiary-bg); color: var(--tc-muted); }
.tc-history-title { display: flex; align-items: center; gap: .45rem; min-width: 0; font-size: .9375rem; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.tc-history-title > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tc-history-meta { display: block; margin-top: .15rem; font-size: .8125rem; color: var(--tc-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-history-amount { flex: none; text-align: right; font-size: .9375rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-history-amount .cart-pill { display: table; margin: .25rem 0 0 auto; }
.tc-history-chev { flex: none; margin-left: -.3rem; font-size: 1.25rem; color: var(--tc-muted); }
@media (max-width: 575.98px) {   /* phones: a little tighter so a full quotation number fits beside the amount */
  .tc-history-row { gap: .6rem; padding-inline: 1rem; }
  .tc-history > .card-header { padding-inline: 1rem; }   /* the switch's left edge lines up with the row icons */
  .tc-history-icon { width: 36px; height: 36px; font-size: 1.05rem; }
  .tc-history-title .tc-num { letter-spacing: 0; }
  .tc-history-chev { margin-left: -.35rem; font-size: 1.1rem; }
}

/* ---------- Quotation details ---------- */
.page-header h1.mono { font-size: 1.25rem; }
.tc-kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .85rem; }
.tc-kv dt { color: var(--tc-muted); font-weight: 400; }
.tc-kv dd { margin: 0; }
.tc-journey { list-style: none; margin: 0; padding: 0; display: flex; }
.tc-journey li { flex: 1 1 0; position: relative; text-align: center; min-width: 0; }
.tc-journey li::before { content: ""; position: absolute; top: 17px; left: -50%; width: 100%; height: 2px; background: var(--tc-border); z-index: 0; }
.tc-journey li:first-child::before { display: none; }
.tc-journey li.is-done::before, .tc-journey li.is-won::before, .tc-journey li.is-lost::before, .tc-journey li.is-current::before, .tc-journey li.is-waiting::before { background: var(--pe-primary); }
.tc-journey-dot { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1rem;
  background: var(--tc-surface); border: 2px solid var(--tc-border); color: var(--tc-muted); }
.tc-journey .is-done .tc-journey-dot { background: var(--pe-primary); border-color: var(--pe-primary); color: #fff; }
.tc-journey .is-current .tc-journey-dot { border-color: var(--pe-primary); color: var(--pe-primary); box-shadow: 0 0 0 4px var(--pe-primary-bg-subtle); }
.tc-journey .is-waiting .tc-journey-dot { border-color: var(--pe-warning); color: var(--pe-warning); background: var(--pe-warning-bg-subtle); box-shadow: 0 0 0 4px var(--pe-warning-bg-subtle); }
.tc-journey .is-won .tc-journey-dot { background: var(--pe-success); border-color: var(--pe-success); color: #fff; }
.tc-journey .is-lost .tc-journey-dot { background: var(--pe-danger); border-color: var(--pe-danger); color: #fff; }
.tc-journey-label { display: block; font-size: .75rem; font-weight: 600; margin-top: .3rem; }
.tc-journey-when { display: block; font-size: .7rem; color: var(--tc-muted); min-height: 1em; }
.tc-journey .is-todo .tc-journey-label { color: var(--tc-muted); font-weight: 500; }
@media (max-width: 575.98px) { .tc-journey-dot { width: 30px; height: 30px; font-size: .85rem; } .tc-journey li::before { top: 14px; } .tc-journey-label { font-size: .68rem; } }
.tc-current-row { background: var(--pe-primary-bg-subtle); box-shadow: inset 3px 0 0 var(--pe-primary); }
.tc-action-sheet { height: auto !important; max-height: 85vh; border-radius: 1rem 1rem 0 0; }
.tc-action-sheet .dropdown-item { padding: .7rem .5rem; border-radius: .5rem; white-space: normal; }
.tc-action-sheet form { margin: 0; }
@media (min-width: 992px) { .tc-printbar { left: var(--pe-app-sidebar-width); } }
@media (max-width: 1199.98px) { body:has(.tc-printbar.d-xl-none) .app-wrapper { padding-bottom: 5.5rem; } }

/* Editor items: a table on wide screens, one card per line on phones. */
@media (min-width: 768px) { .items-table .col-item { min-width: 240px; } }
@media (max-width: 767.98px) {
  .table-responsive:has(> .items-table) { overflow: visible; }
  .items-table thead { display: none; }
  .items-table, .items-table tbody { display: block; width: 100%; }
  .items-table tr[data-s], .items-table tr[data-c] { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem .75rem; padding: .85rem var(--pe-card-cap-padding-x, 1.25rem); border-bottom: 1px solid var(--tc-border); position: relative; }
  .items-table tr[data-s] > td, .items-table tr[data-c] > td { display: block; width: auto !important; padding: 0 !important; border: 0; background: transparent; }
  .items-table td[data-label]::before { content: attr(data-label); display: block; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--tc-muted); margin-bottom: .2rem; text-align: left; }
  .items-table .col-idx { display: none !important; }
  .items-table td.col-item { grid-column: 1 / -1; padding-right: 2.75rem !important; }
  .items-table td.col-act { position: absolute; top: .8rem; right: calc(var(--pe-card-cap-padding-x, 1.25rem) - .35rem); }
  .items-table td.col-amt { grid-column: 1 / -1; display: grid !important; grid-template-columns: 1fr auto; align-items: baseline; border-top: 1px dashed var(--tc-border) !important; padding-top: .55rem !important; }
  .items-table td.col-amt::before { margin: 0; }
  .items-table td.col-amt .line-total, .items-table td.col-amt .charge-total { font-size: 1rem; }
  .items-table td.col-amt small { grid-column: 2; text-align: right; }
  .items-table tr.over-limit { background: var(--pe-warning-bg-subtle); }
  .items-table .form-control, .items-table .form-select { font-size: 1rem; padding: .45rem .6rem; }
  .items-table .input-group-sm > .form-control, .items-table .input-group-sm > .form-select, .items-table .form-select-sm { font-size: 1rem; }
}
.tc-fu-row { display: flex; gap: 1rem; align-items: center; }
.tc-fu-when { width: 84px; flex: none; }
.tc-fu-actions { display: flex; gap: .4rem; flex: none; }
@media (max-width: 575.98px) {
  .tc-fu-row { flex-wrap: wrap; gap: .5rem; }
  .tc-fu-when { width: auto; order: -1; }
  .tc-fu-actions { width: 100%; }
  .tc-fu-actions .btn-primary { flex: 1; }
}
.tc-terms-preview { white-space: pre-line; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 8; overflow: hidden; }
.tc-terms-preview.expanded { display: block; }

/* ---------- Developer page: browser icon ---------- */
.tc-favicon-box { width: 44px; height: 44px; border: 1px solid var(--tc-border); border-radius: .5rem; background: #fff; display: grid; place-items: center; }
.tc-favicon-box img { width: 24px; height: 24px; object-fit: contain; }
.tc-tab-preview { background: var(--tc-soft); border: 1px solid var(--tc-border); border-radius: .6rem; padding: .5rem .5rem 0; }
.tc-tab { display: flex; align-items: center; gap: .5rem; max-width: 260px; padding: .45rem .7rem; font-size: .8rem; background: var(--tc-surface);
  border: 1px solid var(--tc-border); border-bottom: 0; border-radius: .5rem .5rem 0 0; }
.tc-tab img { width: 16px; height: 16px; object-fit: contain; flex: none; }
.tc-tab i { color: var(--tc-muted); }

/* Uploaded logo in the sidebar / header: wide wordmarks fit the sidebar width. */
.tc-brand-logo { height: 34px; width: auto; max-width: 100%; object-fit: contain; }
.app-header .tc-brand-logo { height: 30px; max-width: 140px; }

/* Home: greeting + quick starts (the business dashboard is switched off for now). */
.tc-home { max-width: 920px; margin: 1rem auto 0; }
.tc-home-hero { position: relative; overflow: hidden; isolation: isolate; padding: 2.25rem 2rem; margin-bottom: 1.25rem;
  background: linear-gradient(120deg, var(--pe-primary-bg-subtle) 0%, var(--pe-body-bg) 75%); }
.tc-home-hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.tc-home-hero-bg span { position: absolute; display: block; border-radius: 999px; }
.tc-home-hero-bg .s1 { width: 360px; height: 360px; right: -110px; top: -170px; background: color-mix(in srgb, var(--pe-primary) 13%, transparent); }
.tc-home-hero-bg .s2 { width: 230px; height: 230px; right: 140px; bottom: -170px; background: color-mix(in srgb, var(--pe-primary) 8%, transparent); }
.tc-home-date { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--pe-primary-text-emphasis); }
.tc-home-greet { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.15rem); font-weight: 700; line-height: 1.2; margin: .5rem 0 0; overflow-wrap: anywhere; }
.tc-home-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.tc-home-action { flex-direction: row; align-items: center; gap: 1rem; padding: 1.25rem; min-height: 104px; margin: 0; color: var(--pe-body-color); text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.tc-home-action:hover, .tc-home-action:focus-visible { color: var(--pe-body-color); border-color: var(--pe-primary); box-shadow: 0 .5rem 1.25rem rgba(0, 0, 0, .07); transform: translateY(-2px); }
.tc-home-action:focus-visible { outline: 2px solid var(--pe-primary); outline-offset: 2px; }
.tc-home-action-icon { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.55rem;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary); }
.tc-home-action.is-primary .tc-home-action-icon { background: var(--pe-primary); color: #fff; }
.tc-home-action-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1 1 auto; }
.tc-home-action-title { font-weight: 700; font-size: 1.05rem; }
.tc-home-action-desc { font-size: .85rem; color: var(--tc-muted); }
.tc-home-action-go { font-size: 1.3rem; color: var(--tc-muted); transition: transform .15s ease, color .15s ease; }
.tc-home-action:hover .tc-home-action-go, .tc-home-action:focus-visible .tc-home-action-go { color: var(--pe-primary); transform: translateX(3px); }
@media (max-width: 575.98px) {
  .tc-home { margin-top: .5rem; }
  .tc-home-hero { padding: 1.5rem 1.25rem; }
  .tc-home-action { padding: 1rem; min-height: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  .tc-home-action, .tc-home-action-go { transition: none; }
  .tc-home-action:hover, .tc-home-action:focus-visible { transform: none; }
}

/* ---------- Roles & permissions ---------- */
.tc-role-card .card-footer { border-top: 1px solid var(--tc-border); }
.tc-role-card.is-owner { box-shadow: inset 0 3px 0 var(--pe-primary); }
.tc-role-icon { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary); }
.tc-role-card.is-owner .tc-role-icon { background: var(--pe-primary); color: #fff; }
.tc-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 500;
  background: var(--pe-tertiary-bg); border: 1px solid var(--tc-border); color: var(--pe-body-color); }
.tc-chip i { color: var(--tc-muted); }
.tc-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-avatar-sm { width: 26px; height: 26px; font-size: .66rem; flex: 0 0 26px; }
.tc-avatar-stack { display: flex; }
.tc-avatar-stack .tc-avatar { border: 2px solid var(--tc-surface); margin-inline-start: -7px; }
.tc-avatar-stack .tc-avatar:first-child { margin-inline-start: 0; }

/* Who can do what: sticky header row and first column so the matrix stays readable when scrolled */
.tc-matrix-wrap { max-height: 70vh; }
.tc-perm-matrix { min-width: 560px; }
.tc-perm-matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--tc-surface); font-size: .8rem; white-space: nowrap; box-shadow: inset 0 -1px 0 var(--tc-border); }
.tc-perm-matrix .tc-matrix-first { position: sticky; left: 0; z-index: 1; background: var(--tc-surface); min-width: 220px; max-width: 360px; }
.tc-perm-matrix thead .tc-matrix-first { z-index: 3; }
.tc-perm-matrix tbody td { min-width: 110px; }
.tc-perm-matrix .tc-matrix-group th { background: var(--pe-tertiary-bg); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tc-muted); font-weight: 600; }
.tc-matrix-desc { display: none !important; }
@media (min-width: 992px) { .tc-matrix-desc { display: block !important; } }

/* Role editor */
.tc-perm-row { display: flex; gap: .85rem; align-items: flex-start; cursor: pointer; padding: .85rem 1rem; }
.tc-perm-row:hover { background: var(--pe-tertiary-bg); }
.tc-perm-row .form-check-input { margin-top: .15rem; cursor: pointer; }
.tc-perm-group .card-header .form-check-input { cursor: pointer; }
@media (min-width: 1200px) { .tc-sticky-col { position: sticky; top: calc(var(--pe-app-header-height) + 16px); } }

/* "What this role can do" on the staff form */
.tc-role-summary { border: 1px dashed var(--tc-border); border-radius: .75rem; padding: .85rem 1rem; background: var(--pe-tertiary-bg); }
.tc-role-summary:empty { display: none; }
.tc-role-line { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .8rem; padding: .2rem 0; }
.tc-role-line > i { color: var(--pe-primary); margin-inline-end: .15rem; }
.tc-perm-chip { display: inline-block; padding: .1rem .55rem; border-radius: 999px; background: var(--tc-surface); border: 1px solid var(--tc-border); font-size: .75rem; }

/* Devices & sign-ins panel */
.offcanvas.tc-activity-panel { width: min(440px, 100vw); }

/* Team activity */
.tc-team-row { padding-top: .85rem; padding-bottom: .85rem; }
.tc-team-stats { display: flex; flex-wrap: wrap; gap: .35rem .9rem; font-size: .8rem; margin: .35rem 0 .2rem; }
.tc-team-stats i { color: var(--tc-muted); margin-inline-end: .25rem; }
.tc-stuck-tabs .nav-link { font-size: .82rem; padding: .4rem .5rem; }

.tc-avatar-lg { width: 56px; height: 56px; font-size: 1.15rem; flex: 0 0 56px; }

/* App logo pair: the regular logo in light mode, the white one in dark mode (only rendered when uploaded). */
.tc-logo-for-dark { display: none !important; }
[data-bs-theme=dark] .tc-logo-for-dark { display: inline-block !important; }
[data-bs-theme=dark] .tc-logo-for-light { display: none !important; }

/* Developer page: logo slots on their real backgrounds, and the sidebar preview in both modes */
.tc-logo-slot { border: 1px solid var(--tc-border); border-radius: .75rem; padding: .75rem; height: 100%; }
.tc-logo-stage { position: relative; height: 96px; border-radius: .6rem; display: grid; place-items: center; padding: .75rem; margin-bottom: .6rem; overflow: hidden; }
.tc-logo-stage.is-light { background: #fff; border: 1px solid #e6e8eb; color: #6b7280; }
.tc-logo-stage.is-dark { background: #1d1f22; border: 1px solid #2c2f34; color: #9aa0a6; }
.tc-logo-stage img { max-width: 100%; max-height: 60px; object-fit: contain; }
.tc-logo-empty { font-size: .78rem; display: inline-flex; align-items: center; gap: .35rem; text-align: center; }
.tc-logo-badge { position: absolute; right: .5rem; bottom: .45rem; font-size: .68rem; padding: .1rem .45rem; border-radius: 999px; background: rgba(255,255,255,.12); color: #c9cdd2; }
.tc-logo-meta { margin-bottom: .5rem; }
.tc-brand-preview { display: flex; align-items: center; gap: .5rem; min-height: 64px; padding: .75rem 1rem; border-radius: .6rem; overflow: hidden; }
.tc-brand-preview .tc-brand-logo { max-width: 160px; }
.tc-brand-preview.is-light { background: #fff; color: #1f2328; border: 1px solid #e6e8eb; }
.tc-brand-preview.is-dark { background: #1d1f22; color: #f1f3f4; border: 1px solid #2c2f34; }

/* ---------- Theme colour ----------
   The palette itself is generated per installation (ThemePalette → <style id="tc-theme">). These components are pinned to
   Fabkin's default orange in its compiled CSS, so they are pointed at the theme variables here. */
.btn-primary {
  --pe-btn-hover-bg: var(--tc-primary-hover, var(--pe-primary-text-emphasis)); --pe-btn-hover-border-color: var(--tc-primary-hover, var(--pe-primary-text-emphasis));
  --pe-btn-active-bg: var(--tc-primary-active, var(--pe-primary-text-emphasis)); --pe-btn-active-border-color: var(--tc-primary-active, var(--pe-primary-text-emphasis));
  --pe-btn-focus-shadow-rgb: var(--pe-primary-rgb);
}
.btn-primary:first-child:active, .btn-primary:active { box-shadow: 0 .125rem .375rem 0 rgba(var(--pe-primary-rgb), .5); }
.btn-outline-primary {
  --pe-btn-color: var(--pe-primary); --pe-btn-border-color: var(--pe-primary); --pe-btn-hover-bg: var(--pe-primary); --pe-btn-hover-border-color: var(--pe-primary);
  --pe-btn-active-bg: var(--tc-primary-active, var(--pe-primary)); --pe-btn-active-border-color: var(--tc-primary-active, var(--pe-primary));
  --pe-btn-disabled-color: var(--pe-primary); --pe-btn-disabled-border-color: var(--pe-primary); --pe-btn-focus-shadow-rgb: var(--pe-primary-rgb);
}
.pagination { --pe-pagination-active-bg: var(--pe-primary); --pe-pagination-active-border-color: var(--pe-primary); }
.form-range::-webkit-slider-thumb { background-color: var(--pe-primary); }
.form-range::-moz-range-thumb { background-color: var(--pe-primary); }
.form-range::-webkit-slider-thumb:active { background-color: var(--tc-primary-soft, var(--pe-primary)); }
.form-range::-moz-range-thumb:active { background-color: var(--tc-primary-soft, var(--pe-primary)); }
.form-select:focus { border-color: var(--pe-primary); }

/* Developer page: theme colour swatches and light / dark preview tiles */
.tc-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem; }
.tc-swatch { display: flex; flex-direction: column; align-items: center; gap: .35rem; margin: 0; padding: .55rem .25rem .45rem; border: 1px solid var(--tc-border); border-radius: .75rem;
  background: transparent; color: var(--pe-body-color); cursor: pointer; font-size: .75rem; transition: border-color .15s, box-shadow .15s; }
.tc-swatch:hover { border-color: var(--sw); }
.tc-swatch[aria-checked=true] { border-color: var(--sw); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sw) 22%, transparent); }
.tc-swatch:focus-visible, .tc-swatch:focus-within { outline: 2px solid var(--sw); outline-offset: 2px; }
.tc-swatch-dot { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--sw); display: grid; place-items: center; color: #fff; font-size: 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.tc-swatch-dot > i { opacity: 0; transition: opacity .15s; }
.tc-swatch[aria-checked=true] .tc-swatch-dot > i { opacity: 1; }
.tc-swatch-custom .tc-swatch-dot { background: conic-gradient(#f15644, #f2b94c, #2f9e44, #239cb8, #4f46e5, #d6336c, #f15644); }
.tc-swatch-custom[aria-checked=true] .tc-swatch-dot { background: var(--sw); }
.tc-swatch-custom .tc-swatch-dot > i { opacity: 1; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.tc-swatch-custom input[type=color] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.tc-swatch-name { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-theme-tile { height: 100%; padding: .85rem; border: 1px solid var(--pe-border-color); border-radius: .75rem; background: var(--pe-secondary-bg); color: var(--pe-body-color); }
.tc-theme-tile .btn { pointer-events: none; }
.tc-theme-nav { display: flex; align-items: center; gap: .5rem; padding: .45rem .75rem; border-radius: .5rem; font-size: .85rem; font-weight: 500;
  color: var(--pe-app-sidebar-menu-item-color-active); background: var(--pe-primary-bg-subtle); }

/* Error & maintenance pages (share the sign-in page background) */
.tc-error-card .card-body { padding: 2.5rem 2rem 2rem; }
.tc-error-brand { display: flex; align-items: center; justify-content: center; }
.tc-error-logo { height: 34px; max-width: 180px; object-fit: contain; }
.tc-error-icon { width: 84px; height: 84px; border-radius: 26px; display: inline-grid; place-items: center; font-size: 2.4rem; margin-bottom: 1rem;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary); }
.tc-error-icon.is-warning { background: var(--pe-warning-bg-subtle); color: var(--pe-warning-text-emphasis); }
.tc-error-icon.is-danger { background: var(--pe-danger-bg-subtle); color: var(--pe-danger-text-emphasis); }
.tc-error-icon.is-busy i { animation: tcTilt 2.4s ease-in-out infinite; }
@keyframes tcTilt { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .tc-error-icon.is-busy i { animation: none; } }
.tc-error-code { font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--tc-muted); }
.tc-error-title { font-size: 1.6rem; font-weight: 700; margin: .35rem 0 .5rem; }
.tc-error-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .85rem; border-radius: 999px; font-size: .85rem; font-weight: 500;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary-text-emphasis); }
.tc-error-ref { font-size: .78rem; color: var(--tc-muted); }
.tc-error-ref code { font-size: .78rem; }
.tc-error-support { font-size: .8rem; color: var(--tc-muted); display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem 1rem; }
.tc-maint-card.is-on { border: 1px solid var(--pe-danger-border-subtle); box-shadow: inset 4px 0 0 var(--pe-danger); }

/* Product masters: product types */
.tc-type-row { display: flex; align-items: center; gap: .75rem; }
.tc-move { display: flex; flex-direction: column; gap: 2px; }
.tc-move .btn { padding: 0 .3rem; line-height: 1.2; }
.tc-move .btn:disabled { opacity: .25; }
.tc-type-icon { width: 44px; height: 44px; border-radius: .75rem; display: grid; place-items: center; font-size: 1.35rem;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary); }
.tc-sold-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .05rem .5rem; border-radius: 50rem; border: 1px solid var(--tc-border); color: var(--pe-secondary-color); }
.tc-icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: .35rem; max-height: 236px; overflow-y: auto; padding: 2px; }
.tc-icon-opt { display: grid; place-items: center; aspect-ratio: 1; margin: 0; border: 1px solid var(--tc-border); border-radius: .6rem; font-size: 1.25rem;
  color: var(--pe-body-color); cursor: pointer; transition: border-color .15s, background-color .15s, color .15s; }
.tc-icon-opt:hover { border-color: var(--pe-primary-border-subtle); color: var(--pe-primary); }
.btn-check:checked + .tc-icon-opt { border-color: var(--pe-primary); background: var(--pe-primary-bg-subtle); color: var(--pe-primary); }
.btn-check:focus-visible + .tc-icon-opt { outline: 2px solid var(--pe-primary); outline-offset: 2px; }
.tc-type-preview { cursor: default; max-width: 240px; border-color: var(--pe-primary); box-shadow: 0 0 0 3px var(--pe-primary-bg-subtle); }

/* Product form: parts that depend on how the type is sold */
#productForm[data-sold-by="Piece"] .only-area, #productForm[data-sold-by="Area"] .only-piece { display: none !important; }
.tc-type-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 88px), 1fr)); gap: .5rem; }
@media (min-width: 768px) { .tc-type-cards { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
@media (max-width: 767.98px) { .tc-type-cards .tc-choice-card { text-align: center; padding: .7rem .35rem; font-size: .875rem; overflow-wrap: anywhere; } }
.tc-basis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.tc-basis.tc-basis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tc-basis .tc-choice-card { padding: .65rem .85rem; height: 100%; }
@media (max-width: 575.98px) { .tc-basis, .tc-basis.tc-basis-2 { grid-template-columns: 1fr; } }

/* Product form: jump bar */
.tc-jumpbar { position: sticky; top: var(--pe-app-header-height); z-index: 1002; display: flex; gap: .4rem; margin: -.25rem 0 .75rem; padding: .5rem 0;
  overflow-x: auto; scrollbar-width: none; background: var(--pe-body-bg); }
.tc-jumpbar::-webkit-scrollbar { display: none; }
.tc-jump { display: inline-flex; align-items: center; gap: .4rem; flex: none; padding: .4rem .8rem .4rem .45rem; border: 1px solid var(--tc-border); border-radius: 50rem;
  background: var(--pe-secondary-bg); color: var(--pe-body-color); font-size: .85rem; font-weight: 500; text-decoration: none; transition: border-color .15s, background-color .15s, color .15s; }
.tc-jump:hover { border-color: var(--pe-primary-border-subtle); color: var(--pe-body-color); }
.tc-jump.is-current { border-color: var(--pe-primary); background: var(--pe-primary-bg-subtle); color: var(--pe-primary-text-emphasis); }
.tc-jump-mark { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--tc-border); font-size: .75rem; line-height: 1; flex: none; }
.tc-jump.is-done .tc-jump-mark { background: var(--pe-success); border-color: var(--pe-success); color: #fff; }
.tc-jump.has-error .tc-jump-mark { background: var(--pe-danger); border-color: var(--pe-danger); color: #fff; }
.tc-jump .tc-count:empty { display: none; }
.tc-form-sec { scroll-margin-top: calc(var(--pe-app-header-height) + 64px); }
.tc-subhead { margin: 1.25rem 0 .6rem; padding-top: 1rem; border-top: 1px dashed var(--tc-border); font-size: .8rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--tc-muted); }

/* Size & box */
.tc-size-inputs { display: flex; align-items: center; gap: .5rem; }
.tc-size-inputs .input-group { flex: 1 1 0; min-width: 0; }
.tc-size-inputs .form-control { font-size: 1.05rem; }
@media (max-width: 575.98px) {
  .tc-size-inputs .input-group-text { display: none; }   /* the label says mm */
  .tc-size-inputs .form-control { border-radius: var(--pe-border-radius) !important; text-align: center !important; padding-left: .5rem; padding-right: .5rem; }
  .tc-size-inputs .btn { padding-left: .6rem; padding-right: .6rem; }
}
.tc-size-quick { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.tc-size-quick-label { font-size: .8rem; color: var(--tc-muted); margin-right: .25rem; }
@media (max-width: 767.98px) { .tc-size-quick { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: none; } .tc-size-quick-label { display: none; } }
.tc-size-chip { display: inline-flex; flex-direction: column; align-items: center; flex: none; line-height: 1.15; padding: .3rem .6rem; border: 1px solid var(--tc-border);
  border-radius: .5rem; background: transparent; color: var(--pe-body-color); font-size: .8rem; font-weight: 500; transition: border-color .15s, background-color .15s; }
.tc-size-chip small { font-size: .68rem; font-weight: 400; color: var(--tc-muted); }
.tc-size-chip:hover { border-color: var(--pe-primary-border-subtle); }
.tc-size-chip[aria-pressed=true] { border-color: var(--pe-primary); background: var(--pe-primary-bg-subtle); color: var(--pe-primary-text-emphasis); }
.tc-stepper .form-control { font-size: 1.15rem; }
.tc-stepper .btn { width: 48px; }
.tc-box-result { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; border-radius: .85rem; border: 1px dashed var(--tc-border); background: var(--tc-soft);
  transition: background-color .2s, border-color .2s; }
.tc-box-result.is-ready { border-style: solid; border-color: var(--pe-primary-border-subtle); background: var(--pe-primary-bg-subtle); }
.tc-box-art { width: 96px; height: 72px; }
.tc-box-art .tile { fill: var(--pe-secondary-bg); stroke: var(--pe-primary); stroke-width: 1.2; }
.tc-box-art .tile.is-empty { fill: transparent; stroke: var(--tc-muted); stroke-dasharray: 3 2; }
.tc-box-art .more { font-size: 9px; font-weight: 600; fill: var(--pe-primary); }
.tc-box-eq { font-size: 1.45rem; font-weight: 700; line-height: 1.25; color: var(--pe-emphasis-color); }
.tc-box-result.is-ready #covBig { color: var(--pe-primary-text-emphasis); }
.tc-cov-override { margin-top: .75rem; padding: .75rem 1rem; border: 1px dashed var(--tc-border); border-radius: .75rem; }
@media (max-width: 575.98px) { .tc-box-art { width: 64px; height: 48px; } .tc-box-eq { font-size: 1.2rem; } .tc-box-result { gap: .75rem; padding: .75rem; } }

/* Price & tax */
.tc-price-link { display: flex; align-items: flex-end; gap: .75rem; }
.tc-price-box { flex: 1 1 0; min-width: 0; }
.tc-price-box .form-control, .tc-price-one .form-control { font-size: 1.25rem; }
.tc-price-eq { flex: none; width: 40px; height: 48px; display: grid; place-items: center; color: var(--pe-primary); font-size: 1.25rem; }
.tc-price-one { max-width: 420px; }
@media (max-width: 575.98px) {
  .tc-price-link { flex-direction: column; align-items: stretch; gap: .25rem; }
  .tc-price-eq { width: auto; height: 22px; transform: rotate(90deg); }
}
.tc-quote-unit { margin-top: 1rem; padding: .75rem 1rem; border-radius: .75rem; background: var(--tc-soft); }
.tc-quote-unit .tc-segmented { max-width: 420px; }
.tc-gst-other { width: 120px; }
.tc-pay { display: flex; flex-wrap: wrap; align-items: stretch; gap: .5rem 1.5rem; padding: 1rem 1.15rem; border-radius: .85rem; border: 1px solid var(--pe-primary-border-subtle);
  background: var(--pe-primary-bg-subtle); }
.tc-pay-label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--tc-muted); }
.tc-pay-amount { font-size: 1.75rem; font-weight: 700; line-height: 1.2; color: var(--pe-primary-text-emphasis); }
.tc-pay-per { font-size: .85rem; color: var(--tc-muted); }
.tc-pay-lines { list-style: none; margin: 0; padding: 0; flex: 1 1 220px; display: grid; align-content: center; gap: .2rem; font-size: .875rem; }
.tc-pay-lines li { display: flex; justify-content: space-between; gap: 1rem; }
.tc-pay-lines li > span:last-child { font-weight: 600; white-space: nowrap; }
.tc-pay-empty { display: flex; align-items: center; gap: .5rem; color: var(--tc-muted); }
.tc-pay-empty > i { font-size: 1.2rem; }
.tc-pay:has(.tc-pay-empty) { background: var(--tc-soft); border-color: var(--tc-border); border-style: dashed; }
.tc-fold { border: 1px solid var(--tc-border); border-radius: .85rem; }
.tc-more-toggle { display: flex; align-items: center; justify-content: space-between; gap: .75rem; width: 100%; padding: .75rem 1rem; border: 0; border-radius: .85rem;
  background: transparent; color: var(--pe-body-color); text-align: left; }
.tc-more-toggle > i { font-size: 1.25rem; transition: transform .2s; }
.tc-more-toggle:not(.collapsed) > i { transform: rotate(180deg); }
.tc-more-toggle:hover { background: var(--tc-soft); }
.tc-more-body { padding: .25rem 1rem 1rem; }
/* Product at a glance (beside the form on wide screens) */
.tc-glance .tc-thumb { width: 48px; height: 48px; font-size: 1.35rem; }
/* Default product picture (no photo yet): soft square with the product type's icon — same everywhere (TC.thumb / ProductThumb) */
.tc-thumb.is-default, .tc-public-thumb.is-default, .item-thumb.is-default {
  display: grid; place-items: center; background: linear-gradient(145deg, var(--tc-soft), var(--pe-tertiary-bg)); color: var(--tc-muted);
  border: 1px solid var(--tc-border); }
.tc-thumb-lg { width: 48px; height: 48px; font-size: 1.3rem; border-radius: .6rem; }
/* Item editor header: a photo big enough to recognise the product (scan → this dialog), facts on their own lines */
.tc-item-head { align-items: flex-start; gap: .9rem; }
.tc-item-head .btn-close { margin: 0 0 0 auto; }
.tc-item-modal-thumb { width: 96px; height: 96px; border-radius: 14px; font-size: 2.4rem; object-fit: cover; }
.tc-item-zoom { position: relative; display: block; padding: 0; border: 0; border-radius: 14px; background: none; cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.tc-item-zoom:active { transform: scale(.97); }
.tc-item-zoom-ic { position: absolute; right: 6px; bottom: 6px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: .85rem; }
.tc-item-name { margin: .1rem 0 0; font-size: 1.05rem; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-item-facts { display: flex; flex-direction: column; align-items: flex-start; gap: .25rem; margin-top: .3rem; font-size: .8125rem; color: var(--tc-muted); }
.tc-item-code { font-size: .75rem; }
.tc-item-price { font-weight: 700; color: var(--pe-body-color); font-variant-numeric: tabular-nums; }
.tc-item-price > span { font-weight: 400; color: var(--tc-muted); }
.tc-item-pack { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 50rem; background: var(--pe-tertiary-bg);
  font-size: .75rem; font-weight: 600; color: var(--pe-body-color); }
.tc-item-pack > i { color: var(--tc-muted); }
.tc-item-photo { display: block; width: 100%; aspect-ratio: 4 / 3; margin: 0 0 1rem; padding: 0; overflow: hidden; border: 1px solid var(--tc-border); border-radius: 14px;
  background: var(--tc-soft); cursor: zoom-out; }
.tc-item-photo.d-none { display: none; }
.tc-item-photo > img { width: 100%; height: 100%; object-fit: contain; }
/* Suggestions under the new cart's mobile number */
.tc-suggest { margin-top: .4rem; border: 1px solid var(--tc-border); border-radius: 12px; background: var(--tc-surface); box-shadow: 0 10px 28px -12px rgba(0, 0, 0, .25); overflow: hidden; }
.tc-suggest-item { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .6rem .8rem; border: 0; background: transparent; color: var(--pe-body-color);
  text-align: left; font-size: .9rem; text-transform: none; }
.tc-suggest-item + .tc-suggest-item { border-top: 1px solid var(--tc-border); }
.tc-suggest-item:hover, .tc-suggest-item.active { background: var(--pe-tertiary-bg); }
.tc-suggest-item .tc-avatar { width: 36px; height: 36px; }
.tc-suggest-item mark { padding: 0; background: rgba(var(--pe-primary-rgb), .14); color: inherit; border-radius: 3px; font-weight: 700; }
.tc-public-thumb.is-default { font-size: 1.4rem; }
.items-table .item-thumb.is-default { font-size: 1.05rem; }
.ts-dropdown .option .tc-opt-thumb { width: 36px; height: 36px; margin-right: .6rem; border-radius: 7px; font-size: 1.05rem; }
.ts-dropdown .option .tc-opt-price { flex: none; white-space: nowrap; }
.ts-dropdown .option { overflow-wrap: normal; word-break: normal; }
.tc-glance .tc-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.tc-glance-list { display: grid; gap: .45rem; font-size: .85rem; }
.tc-glance-list > div { display: flex; justify-content: space-between; gap: .75rem; }
.tc-glance-list dt { font-weight: 400; color: var(--tc-muted); white-space: nowrap; }
.tc-glance-list dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
#productForm[data-sold-by="Piece"] .tc-glance .only-area { display: none !important; }

/* Photos, 360 and 3D */
.tc-media-tabs .nav-link { padding: .4rem .5rem; font-size: .85rem; white-space: nowrap; }
.tc-count:not(:empty) { display: inline-block; min-width: 1.25rem; padding: 0 .35rem; margin-left: .15rem; border-radius: 50rem; font-size: .7rem; line-height: 1.25rem;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary-text-emphasis); }
.nav-pills .nav-link.active .tc-count:not(:empty) { background: rgba(255, 255, 255, .25); color: #fff; }
.tc-photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; border-radius: .75rem; transition: box-shadow .15s; }
@media (min-width: 576px) and (max-width: 1199.98px) { .tc-photo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tc-photo-grid.is-drop { box-shadow: 0 0 0 2px var(--pe-primary); }
.tc-ph { position: relative; aspect-ratio: 1; border-radius: .65rem; border: 1px solid var(--tc-border); background: var(--tc-soft); }
.tc-ph.is-dragging { opacity: .4; }
.tc-ph.drop-before { box-shadow: -3px 0 0 var(--pe-primary); }
.tc-ph.drop-after { box-shadow: 3px 0 0 var(--pe-primary); }
.tc-ph.has-error { border-color: var(--pe-danger); }
.tc-ph-img { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: calc(.65rem - 1px); overflow: hidden; }
.tc-ph-img img { width: 100%; height: 100%; object-fit: cover; }
.tc-ph[draggable=true] .tc-ph-img { cursor: grab; }
.tc-ph-main { position: absolute; left: .3rem; top: .3rem; padding: .05rem .4rem; border-radius: 50rem; font-size: .68rem; font-weight: 600;
  background: var(--pe-primary); color: #fff; pointer-events: none; }
.tc-ph-menu { position: absolute; right: .25rem; top: .25rem; }
.tc-ph-menu > .btn { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; border: 0; display: grid; place-items: center; }
.tc-ph-menu > .btn:hover, .tc-ph-menu > .btn:focus-visible { background: rgba(0, 0, 0, .7); color: #fff; }
.tc-ph-over { position: absolute; inset: auto 0 0 0; padding: .4rem; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); border-radius: 0 0 calc(.65rem - 1px) calc(.65rem - 1px); }
.tc-ph-over.is-error { inset: 0; border-radius: calc(.65rem - 1px); display: grid; place-content: center; justify-items: center; gap: .15rem; padding: .35rem; text-align: center;
  background: rgba(var(--pe-danger-rgb), .85); color: #fff; font-size: .68rem; line-height: 1.2; }
.tc-ph-over.is-error i { font-size: 1.1rem; }
.tc-upload-bar { height: 5px; }
.tc-ph-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; border: 2px dashed var(--tc-border); background: transparent;
  color: var(--pe-body-color); padding: .25rem; text-align: center; transition: border-color .15s, background-color .15s; }
.tc-ph-add i { font-size: 1.5rem; color: var(--pe-primary); }
.tc-ph-add:hover, .tc-ph-add:focus-visible { border-color: var(--pe-primary); background: var(--pe-primary-bg-subtle); }
.tc-media-list { display: grid; gap: .5rem; margin-bottom: .75rem; }
.tc-mrow { display: flex; gap: .65rem; align-items: flex-start; padding: .55rem; border: 1px solid var(--tc-border); border-radius: .65rem; }
.tc-mrow.has-error { border-color: var(--pe-danger); }
.tc-mrow-thumb { position: relative; flex: none; width: 64px; height: 64px; padding: 0; border: 0; border-radius: .5rem; overflow: hidden; display: grid; place-items: center;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary); font-size: 1.6rem; }
.tc-mrow-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tc-mrow .btn-sm { width: 32px; height: 30px; padding: 0; }
.tc-360 { position: absolute; left: 3px; bottom: 3px; padding: 0 .3rem; border-radius: .3rem; font-size: .62rem; font-weight: 700; background: rgba(0, 0, 0, .6); color: #fff; }
.tc-media-empty { display: grid; justify-items: center; gap: .15rem; padding: 1.25rem .75rem; border: 1px dashed var(--tc-border); border-radius: .75rem; text-align: center; }
.tc-media-empty > i { font-size: 1.75rem; color: var(--pe-primary); opacity: .8; }
.tc-link-form { margin-top: .75rem; padding: .75rem; border: 1px solid var(--tc-border); border-radius: .75rem; background: var(--tc-soft); }

/* Media viewer */
.tc-viewer .modal-body { position: relative; }
.tc-viewer-stage { position: relative; height: min(72vh, 680px); background: #111418; display: grid; place-items: center; overflow: hidden; }
@media (max-width: 991.98px) { .tc-viewer-stage { height: calc(100dvh - 124px); } }
.tc-viewer-stage.is-model, .tc-viewer-stage.is-preview3d { background: radial-gradient(circle at 50% 35%, #fbfbfc, #e2e5ea); }
[data-bs-theme=dark] .tc-viewer-stage.is-model, [data-bs-theme=dark] .tc-viewer-stage.is-preview3d { background: radial-gradient(circle at 50% 35%, #3a3f46, #1c1f23); }
.tc-viewer-stage.is-link { background: var(--pe-body-bg); }
.tc-viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; }
.tc-viewer-pano, .tc-viewer-frame, .tc-viewer-model { width: 100%; height: 100%; border: 0; display: block; }
.tc-viewer-loading { color: #c9ced6; font-size: .9rem; display: flex; align-items: center; }
.tc-viewer-stage.is-model .tc-viewer-loading, .tc-viewer-stage.is-link .tc-viewer-loading, .tc-viewer-stage.is-preview3d .tc-viewer-loading { color: var(--tc-muted); }
.tc-viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .9); color: #222; font-size: 1.5rem; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); z-index: 3; }
.tc-viewer-nav.prev { left: .75rem; }
.tc-viewer-nav.next { right: .75rem; }
.tc-viewer-nav:focus-visible { outline: 3px solid var(--pe-primary); }
.tc-ar-btn { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); }

/* Product page gallery */
.tc-gallery-hero { position: relative; display: block; width: 100%; padding: 0; border: 0; background: var(--tc-soft); cursor: zoom-in; }
.tc-gallery-hero .tc-product-hero { display: block; }
.tc-gallery-zoom { position: absolute; right: .6rem; bottom: .6rem; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); color: #fff; }
.tc-gallery-thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .4rem; padding: .6rem .6rem 0; }
.tc-gallery-thumb { position: relative; aspect-ratio: 1; padding: 0; border: 1px solid var(--tc-border); border-radius: .5rem; overflow: hidden; background: var(--tc-soft); }
.tc-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.tc-gallery-thumb.is-current { border-color: var(--pe-primary); box-shadow: 0 0 0 2px var(--pe-primary-bg-subtle); }
.tc-gallery-thumb .tc-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; font-weight: 600; }
.tc-gallery-views { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; padding: .6rem; }
.tc-view-btn { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border: 1px solid var(--tc-border); border-radius: .65rem; background: transparent;
  color: var(--pe-body-color); text-align: left; transition: border-color .15s, background-color .15s; }
.tc-view-btn:hover, .tc-view-btn:focus-visible { border-color: var(--pe-primary); background: var(--pe-primary-bg-subtle); }
.tc-view-btn > i { font-size: 1.35rem; color: var(--pe-primary); }
.tc-media-chip { display: inline-flex; align-items: center; gap: .15rem; margin-left: .3rem; padding: 0 .35rem; border-radius: .35rem; font-size: .68rem; font-weight: 600;
  vertical-align: middle; background: var(--pe-primary-bg-subtle); color: var(--pe-primary-text-emphasis); }
@media (max-width: 991.98px) { .tc-gallery-hero .tc-product-hero { max-height: 440px; } }

/* Product form: tile size dropdown, tile sizes master */
.tc-size-select { font-size: 1.05rem; font-weight: 600; padding-top: .6rem; padding-bottom: .6rem; }
.tc-size-shape { width: 44px; height: 44px; border-radius: .75rem; display: grid; place-items: center; background: var(--pe-primary-bg-subtle); }
.tc-size-shape svg { width: 40px; height: 40px; }
.tc-size-shape rect { fill: var(--pe-secondary-bg); stroke: var(--pe-primary); stroke-width: 1.5; }
.tc-size-preview { font-size: .85rem; color: var(--tc-muted); min-height: 1.25rem; }
.tc-size-preview strong { color: var(--pe-body-color); }

/* Image tile: edit button */
.tc-ph-edit { position: absolute; right: .25rem; bottom: .25rem; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: .9rem; }
.tc-ph-edit:hover, .tc-ph-edit:focus-visible { background: var(--pe-primary); color: #fff; }

/* Image editor */
.tc-ie-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.tc-ie-stage { position: relative; height: min(68vh, 640px); background: #15181c; }
.tc-ie-stage > img { display: block; max-width: 100%; }
.tc-ie-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #c9ced6; font-size: .9rem; background: #15181c; z-index: 2; }
.tc-ie-panel { padding: 1rem; border-left: 1px solid var(--tc-border); overflow-y: auto; max-height: min(68vh, 640px); }
.tc-ie-group + .tc-ie-group { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--tc-border); }
.tc-ie-title { display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--tc-muted); }
.tc-ie-title > i { font-size: 1rem; color: var(--pe-primary); }
.tc-ie-chips, .tc-ie-tools { display: flex; flex-wrap: wrap; gap: .35rem; }
.tc-ie-sizes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.tc-ie-sizes .tc-choice-card { padding: .5rem .65rem; }
.tc-ie-result { padding: .6rem .75rem; border-radius: .6rem; background: var(--pe-primary-bg-subtle); color: var(--pe-primary-text-emphasis); font-size: .85rem; min-height: 2.4rem; }
.tc-ie-result:empty { display: none; }
.tc-ie .cropper-view-box { outline-color: var(--pe-primary); }
.tc-ie .cropper-point, .tc-ie .cropper-line { background-color: var(--pe-primary); }
@media (max-width: 991.98px) {
  .tc-ie-layout { grid-template-columns: 1fr; }
  .tc-ie-stage { height: 46vh; }
  .tc-ie-panel { border-left: 0; border-top: 1px solid var(--tc-border); max-height: none; }
}

/* Searchable dropdowns (Tom Select, like Select2) in the Fabkin look */
.ts-wrapper.form-select { padding: 0 !important; min-height: calc(1.5em + 1rem + 2px); cursor: pointer; }
.ts-wrapper.form-select.single .ts-control, .ts-wrapper.form-select.single.input-active .ts-control {
  display: flex; align-items: center; min-height: inherit; padding: .5rem 2.7rem .5rem .9rem; border: 0 !important; box-shadow: none !important;
  background: transparent !important; color: var(--pe-body-color); font-size: .875rem; line-height: 1.5; cursor: pointer; }
.ts-wrapper.form-select .ts-control > .item { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-wrapper.form-select-sm { min-height: calc(1.5em + .5rem + 2px); }
.ts-wrapper.form-select-sm.single .ts-control { padding: .25rem 2rem .25rem .5rem; font-size: .765625rem; }
.ts-wrapper.form-select-lg { min-height: calc(1.5em + 1.4rem + 2px); }
.ts-wrapper.form-select-lg.single .ts-control { padding: .7rem 2.7rem .7rem 1.2rem; font-size: 1.09375rem; }
.ts-wrapper.form-select.focus { border-color: var(--pe-primary-border-subtle); }
.ts-wrapper.form-select.disabled { background-color: var(--pe-tertiary-bg); opacity: 1; }
.ts-wrapper.form-select.disabled .ts-control { opacity: .7; cursor: not-allowed; }
.ts-wrapper.form-select.w-auto { width: auto; min-width: 11rem; display: inline-block; }
select.input-validation-error + .ts-wrapper.form-select, select.is-invalid + .ts-wrapper.form-select { border-color: var(--pe-danger) !important; }
.tc-size-select + .ts-wrapper .ts-control { font-size: 1.05rem !important; font-weight: 600; }
.ts-dropdown { margin-top: .25rem; padding: 0; border: 1px solid var(--tc-border); border-radius: var(--pe-border-radius); box-shadow: var(--pe-box-shadow);
  background: var(--pe-secondary-bg) !important; color: var(--pe-body-color); z-index: 1060; overflow: hidden; }
body > .ts-dropdown { z-index: 1065; }
.ts-dropdown .dropdown-input-wrap { padding: .5rem; border-bottom: 1px solid var(--tc-border); }
.ts-dropdown .dropdown-input { width: 100%; padding: .4rem .65rem .4rem 2rem; border: 1px solid var(--tc-border); border-radius: .5rem; outline: 0;
  background: var(--pe-body-bg) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3e%3cpath d='M18.03 16.62 22.3 20.9l-1.4 1.41-4.28-4.28A9 9 0 1 1 18.03 16.62Zm-2-.74A7 7 0 1 0 15.88 16l.15-.12Z'/%3e%3c/svg%3e") no-repeat .6rem center / 1rem;
  color: var(--pe-body-color); font-size: .875rem; }
.ts-dropdown .dropdown-input:focus, .plugin-dropdown_input.focus .ts-dropdown .dropdown-input { border-color: var(--pe-primary-border-subtle) !important; box-shadow: 0 0 0 3px var(--pe-primary-bg-subtle) !important; outline: 0 !important; }
.ts-dropdown .ts-dropdown-content { max-height: 280px; padding: .35rem; }
.ts-dropdown .option { padding: .45rem .7rem; border-radius: .4rem; font-size: .875rem; color: var(--pe-body-color); }
.ts-dropdown .option.active { background: var(--pe-primary-bg-subtle); color: var(--pe-primary-text-emphasis); }
.ts-dropdown .option.selected { font-weight: 600; color: var(--pe-primary-text-emphasis); }
.ts-dropdown .option.selected::after { content: "\2713"; float: right; margin-left: .75rem; }
.ts-dropdown .no-results { padding: .5rem .7rem; color: var(--tc-muted); font-size: .85rem; }
.ts-dropdown .option[aria-disabled=true], .ts-dropdown .option.disabled { opacity: .45; cursor: not-allowed; background: transparent; }

/* ================= Phone & tablet app shell ================= */
/* Bottom tab bar: Home · Cart · Scan · Quotation · Account */
.tc-tabbar { display: none; }
@media (max-width: 1199.98px) {
  .tc-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1003; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: end;
    padding: .3rem .25rem calc(.35rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--pe-secondary-bg) 94%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--tc-border); box-shadow: 0 -6px 20px rgba(0, 0, 0, .06); }
  body.tc-own-bar .tc-tabbar { display: none; }
  body.tc-has-tabbar { padding-bottom: calc(68px + 3rem + env(safe-area-inset-bottom)); }   /* the last card stays clear of the bar and the Scan button */
  body.tc-has-tabbar .footer { display: none; }
  /* the page's own buttons replace the footer on these screens too */
  body.tc-own-bar .footer { display: none; }
}
@media (min-width: 992px) and (max-width: 1199.98px) { .tc-tabbar { left: var(--pe-app-sidebar-width); } [data-sidebar=icon] .tc-tabbar { left: var(--pe-app-sidebar-sm-width); } }
.tc-tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: .1rem; min-width: 0; padding: .3rem .15rem .1rem; border: 0; background: none;
  color: var(--tc-muted); font-size: .68rem; font-weight: 500; line-height: 1.2; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.tc-tab > i { display: grid; place-items: center; width: 52px; height: 28px; border-radius: 50rem; font-size: 1.3rem; transition: background-color .2s, color .2s; }
.tc-tab > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-tab:hover, .tc-tab:focus-visible { color: var(--pe-body-color); }
.tc-tab.active { color: var(--pe-primary-text-emphasis); font-weight: 600; }
.tc-tab.active > i { background: var(--pe-primary-bg-subtle); color: var(--pe-primary); }
.tc-tab .badge { position: absolute; top: .05rem; left: calc(50% + .45rem); min-width: 1.15rem; padding: .15rem .32rem; font-size: .62rem; border: 2px solid var(--pe-secondary-bg); }
.tc-tab-scan { margin-top: -1.35rem; color: var(--pe-body-color); }
.tc-scan-ring { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: .1rem; border-radius: 50%; background: var(--pe-primary); color: #fff; font-size: 1.6rem;
  box-shadow: 0 6px 16px rgba(var(--pe-primary-rgb), .38), 0 0 0 4px var(--pe-secondary-bg); transition: transform .15s; }
.tc-tab-scan:active .tc-scan-ring { transform: scale(.94); }
.tc-scan-ring > i { color: inherit; }

/* App bar (header) on phones */
@media (max-width: 991.98px) {
  .tc-appbar-title h6 { font-size: 1rem; }
}

/* Slide-in menu on phones and portrait tablets */
@media (max-width: 991.98px) {
  .pe-app-sidebar { display: flex !important; flex-direction: column; width: min(86vw, 300px); transform: translateX(-104%); visibility: hidden;
    transition: transform .26s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .26s; box-shadow: 8px 0 32px rgba(0, 0, 0, .18); border-radius: 0 1rem 1rem 0; }
  .pe-app-sidebar.show { transform: none; visibility: visible; transition: transform .26s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
  .pe-app-sidebar .pe-app-sidebar-menu { flex: 1 1 auto; min-height: 0; }
  body.tc-menu-open { overflow: hidden; }
}
.tc-drawer-user { display: flex; align-items: center; gap: .65rem; margin: .25rem 1rem .75rem; padding: .65rem .75rem; border-radius: .85rem;
  background: var(--pe-primary-bg-subtle); color: var(--pe-body-color); text-decoration: none; }
.tc-drawer-user:hover { color: var(--pe-body-color); background: color-mix(in srgb, var(--pe-primary) 16%, transparent); }
.tc-drawer-signout { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--tc-border); }
.tc-drawer-signout .pe-nav-link { text-align: left; }
.tc-drawer-signout .pe-nav-link .pe-nav-icon, .tc-drawer-signout .pe-nav-link .pe-nav-content { color: var(--pe-danger); }

/* Scan sheet */
.tc-scan-camera { position: relative; aspect-ratio: 1; max-width: 420px; margin: 0 auto; border-radius: 1rem; overflow: hidden; background: #111; }
.tc-scan-camera #globalQr { width: 100%; height: 100%; }
.tc-scan-camera #globalQr video { width: 100% !important; height: 100% !important; object-fit: cover; }
.tc-scan-frame { position: absolute; inset: 15%; border-radius: 1rem; pointer-events: none; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .25);
  background: linear-gradient(var(--pe-primary), var(--pe-primary)) left top / 28px 4px no-repeat, linear-gradient(var(--pe-primary), var(--pe-primary)) left top / 4px 28px no-repeat,
    linear-gradient(var(--pe-primary), var(--pe-primary)) right top / 28px 4px no-repeat, linear-gradient(var(--pe-primary), var(--pe-primary)) right top / 4px 28px no-repeat,
    linear-gradient(var(--pe-primary), var(--pe-primary)) left bottom / 28px 4px no-repeat, linear-gradient(var(--pe-primary), var(--pe-primary)) left bottom / 4px 28px no-repeat,
    linear-gradient(var(--pe-primary), var(--pe-primary)) right bottom / 28px 4px no-repeat, linear-gradient(var(--pe-primary), var(--pe-primary)) right bottom / 4px 28px no-repeat; }
@media (max-width: 575.98px) { .tc-scan-sheet .modal-body { display: flex; flex-direction: column; justify-content: center; } }

/* Account screen */
.tc-account { max-width: 640px; margin: 0 auto; padding-top: .75rem; }
.tc-avatar-xl { width: 64px; height: 64px; font-size: 1.4rem; }
.tc-account-hero { background: linear-gradient(135deg, var(--pe-primary-bg-subtle), var(--pe-secondary-bg) 70%); }
.tc-account-label { margin: 0 .25rem .4rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--tc-muted); }
.tc-account-list { border-radius: .85rem; overflow: hidden; }
.tc-account-list .list-group-item { display: flex; align-items: center; gap: .85rem; padding: .8rem 1rem; cursor: pointer; }
.tc-account-list .list-group-item, .tc-account-list .list-group-item:hover { color: var(--pe-body-color); }
.tc-account-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: .65rem; background: var(--pe-primary-bg-subtle); color: var(--pe-primary); font-size: 1.15rem; }
.tc-account-sub { padding-left: 3.85rem !important; }

/* Account menu in the top bar (wide screens): who is signed in, the account pages as icon rows, Sign out on its own */
.tc-user-menu { width: 280px; padding: 0; overflow: hidden; border-radius: 1rem; }
.tc-user-head { display: flex; align-items: center; gap: .8rem; padding: 1rem; border-bottom: 1px solid var(--tc-border);
  background: linear-gradient(135deg, var(--pe-primary-bg-subtle), var(--pe-secondary-bg) 75%); }
.tc-user-avatar { width: 46px; height: 46px; flex: 0 0 46px; font-size: 1rem; font-weight: 700; box-shadow: inset 0 0 0 1px var(--tc-border); }
.tc-user-name { overflow: hidden; font-size: .975rem; font-weight: 700; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.tc-user-meta { display: flex; align-items: center; gap: .3rem; min-width: 0; margin-top: .15rem; font-size: .78rem; color: var(--tc-muted); }
.tc-user-meta > i { flex: none; font-size: .85rem; }
.tc-user-meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-user-list { margin: 0; padding: .4rem; list-style: none; }
.tc-user-menu .dropdown-item { display: flex; align-items: center; gap: .7rem; padding: .45rem .55rem; border-radius: .65rem; font-size: .875rem; font-weight: 500; }
.tc-user-menu .dropdown-item:hover, .tc-user-menu .dropdown-item:focus-visible { background: var(--pe-tertiary-bg); color: var(--pe-body-color); }
.tc-user-menu .dropdown-item:active { background: var(--pe-primary-bg-subtle); color: var(--pe-body-color); }
.tc-user-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: .6rem; background: var(--pe-tertiary-bg); color: var(--pe-body-color); font-size: 1.05rem; }
.tc-user-menu .dropdown-item:hover .tc-user-icon { background: var(--tc-surface); }
.tc-user-foot { margin: 0; padding: .4rem; border-top: 1px solid var(--tc-border); }
.tc-user-menu .tc-user-signout { color: var(--pe-danger); }
.tc-user-signout .tc-user-icon { background: var(--pe-danger-bg-subtle); color: var(--pe-danger); }
.tc-user-menu .tc-user-signout:hover, .tc-user-menu .tc-user-signout:focus-visible, .tc-user-menu .tc-user-signout:active { background: var(--pe-danger-bg-subtle); color: var(--pe-danger-text-emphasis); }
.tc-user-menu .tc-user-signout:hover .tc-user-icon { background: var(--pe-danger); color: #fff; }


/* ================= Live updates & notifications ================= */
/* "Live" pill: green while connected, amber while reconnecting, grey when offline */
.tc-live-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .55rem; border-radius: 50rem; font-size: .7rem; font-weight: 600;
  line-height: 1.4; letter-spacing: .02em; vertical-align: middle; background: var(--pe-tertiary-bg); color: var(--tc-muted); white-space: nowrap; }
.tc-live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.tc-live-pill[data-state="live"] { background: var(--pe-success-bg-subtle); color: var(--pe-success-text-emphasis); }
.tc-live-pill[data-state="live"] .dot { background: var(--pe-success); box-shadow: 0 0 0 0 rgba(var(--pe-success-rgb), .5); animation: tc-live-pulse 2s infinite; }
.tc-live-pill[data-state="reconnecting"], .tc-live-pill[data-state="connecting"] { background: var(--pe-warning-bg-subtle); color: var(--pe-warning-text-emphasis); }
.tc-live-pill[data-state="reconnecting"] .dot, .tc-live-pill[data-state="connecting"] .dot { animation: tc-live-blink 1s infinite; }
h1 .tc-live-pill { font-family: var(--pe-body-font-family); }
@keyframes tc-live-pulse { 0% { box-shadow: 0 0 0 0 rgba(var(--pe-success-rgb), .55); } 70% { box-shadow: 0 0 0 6px rgba(var(--pe-success-rgb), 0); } 100% { box-shadow: 0 0 0 0 rgba(var(--pe-success-rgb), 0); } }
@keyframes tc-live-blink { 50% { opacity: .3; } }

/* Rows that just arrived or changed glow briefly */
.tc-live-new, .tc-live-changed { animation: tc-live-glow 2.6s ease-out; }
.tc-live-new { --tc-glow: rgba(var(--pe-success-rgb), .16); }
.tc-live-changed { --tc-glow: rgba(var(--pe-primary-rgb), .14); }
@keyframes tc-live-glow { 0%, 30% { background-color: var(--tc-glow); box-shadow: inset 3px 0 0 rgba(var(--pe-primary-rgb), .6); } 100% { background-color: transparent; box-shadow: none; } }
.card.tc-live-new, .card.tc-live-changed { animation-name: tc-live-glow-card; }
@keyframes tc-live-glow-card { 0%, 30% { box-shadow: 0 0 0 2px rgba(var(--pe-primary-rgb), .45); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .tc-live-new, .tc-live-changed, .tc-live-pill .dot { animation: none !important; } }

/* "New activity — show latest" bar on pages that can't update in place */
.tc-live-notice { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; padding: .55rem .9rem; border-radius: .65rem;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary-text-emphasis); font-size: .875rem; }

/* Bell */
.tc-bell-badge { position: absolute; top: 3px; right: 1px; min-width: 1.05rem; padding: .18rem .3rem; font-size: .6rem; border: 2px solid var(--pe-secondary-bg); }
.tc-bell-menu { width: min(380px, calc(100vw - 24px)); overflow: hidden; border-radius: 1rem; }
.tc-bell-head { display: flex; align-items: center; gap: .25rem; padding: .7rem .9rem .6rem; border-bottom: 1px solid var(--tc-border); }
.tc-bell-list { max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain; }
.tc-bell-foot { display: flex; align-items: center; justify-content: center; padding: .6rem; border-top: 1px solid var(--tc-border); font-size: .85rem; font-weight: 500; text-decoration: none; }
.tc-bell-foot:hover { background: var(--pe-tertiary-bg); }
#bellReadAll:disabled { opacity: .45; }

/* One notification (bell, page and pop-up) */
.tc-notif { position: relative; display: flex; gap: .75rem; align-items: flex-start; padding: .75rem .9rem; color: var(--pe-body-color); text-decoration: none; cursor: pointer;
  border-bottom: 1px solid var(--tc-border); transition: background-color .15s; }
.tc-notif:last-child { border-bottom: 0; }
.tc-notif:hover, .tc-notif:focus-visible { background: var(--pe-tertiary-bg); color: var(--pe-body-color); }
.tc-notif.unread { background: color-mix(in srgb, var(--pe-primary) 5%, transparent); }
.tc-notif-icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: .7rem; font-size: 1.1rem; }
.tc-notif-text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; gap: .1rem; }
.tc-notif-title { font-weight: 600; font-size: .875rem; line-height: 1.3; }
.tc-notif.unread .tc-notif-title { color: var(--pe-emphasis-color); }
.tc-notif-body { font-size: .8125rem; color: var(--tc-muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tc-notif-time { font-size: .72rem; color: var(--tc-muted); }
.tc-notif-dot { flex: none; width: 8px; height: 8px; margin-top: .4rem; border-radius: 50%; background: var(--pe-primary); }
.tc-notif-empty { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: 2.25rem 1rem; text-align: center; color: var(--tc-muted); }
.tc-notif-empty > i { font-size: 2rem; opacity: .6; }
.tc-notif-empty > span:first-of-type { color: var(--pe-body-color); font-weight: 500; }
.tc-notif-day { padding: .55rem .9rem .35rem; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--tc-muted);
  background: var(--pe-tertiary-bg); border-bottom: 1px solid var(--tc-border); }
.tc-notif-page { max-width: 760px; margin: 0 auto; }
.tc-notif-card { overflow: hidden; }

/* Pop-up when a notification arrives (top right; full width under the app bar on phones) */
.tc-notify-host { position: fixed; top: calc(var(--pe-app-header-height, 70px) + .5rem); right: 1rem; z-index: 1095; display: flex; flex-direction: column; gap: .5rem;
  width: min(380px, calc(100vw - 2rem)); pointer-events: none; }
.tc-notify-pop { position: relative; pointer-events: auto; border-radius: .9rem; overflow: hidden; background: var(--pe-secondary-bg); border: 1px solid var(--tc-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16); opacity: 0; transform: translateY(-8px) scale(.98); transition: opacity .22s, transform .22s; }
.tc-notify-pop.show { opacity: 1; transform: none; }
.tc-notify-pop.hide { opacity: 0; transform: translateX(16px); }
.tc-notify-pop .tc-notif { border: 0; padding-right: 2.25rem; background: transparent; }
.tc-notify-pop .tc-notif-dot { display: none; }
.tc-notify-pop .btn-close { position: absolute; top: .65rem; right: .65rem; font-size: .6rem; }
@media (max-width: 575.98px) { .tc-notify-host { right: .5rem; left: .5rem; width: auto; top: calc(var(--pe-app-header-height, 64px) + .25rem); } }

/* Sidebar shrunk to icons (← button on wide screens): icons only, centred; the name shows as a tooltip; badges become a dot.
   The theme only does this for menus with sub-menus, and ours are plain links. */
@media (min-width: 992px) {
  [data-sidebar=icon] .pe-app-sidebar .pe-nav-content,
  [data-sidebar=icon] .pe-app-sidebar .pe-menu-title,
  [data-sidebar=icon] .pe-app-sidebar .tc-drawer-user { display: none !important; }
  [data-sidebar=icon] .pe-app-sidebar .pe-main-menu .pe-slide { padding-inline: .5rem; }
  [data-sidebar=icon] .pe-app-sidebar .pe-nav-link { position: relative; justify-content: center; padding-inline: 0; }
  [data-sidebar=icon] .pe-app-sidebar .pe-nav-link .pe-nav-icon { margin: 0 auto; font-size: 1.25rem; }
  [data-sidebar=icon] .pe-app-sidebar .pe-nav-link .badge:not(.d-none) { position: absolute; top: .45rem; right: .7rem; width: .55rem; height: .55rem; min-width: 0;
    padding: 0; font-size: 0; border: 2px solid var(--pe-app-sidebar-bg); }
  [data-sidebar=icon] .pe-app-sidebar-logo .tc-brand { justify-content: center; }
}

/* Settings: a grid of group cards, every option editable in place */
.tc-settings-toolbar .tc-settings-scope { min-width: 240px; }
.tc-settings-toolbar .tc-settings-search { flex: 1 1 260px; max-width: 380px; }
.tc-settings-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: stretch; }
.tc-settings-card { margin-bottom: 0; height: 100%; transition: box-shadow .2s, border-color .2s; }
.tc-settings-card.is-dirty { border-color: color-mix(in srgb, var(--pe-warning) 55%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--pe-warning) 35%, transparent); }
.tc-settings-card .card-header { padding-block: .8rem; }
.tc-settings-card .tc-setting-row { gap: 1rem; padding: .85rem 0; }
.tc-settings-card .tc-setting-text { max-width: none; flex: 1 1 auto; }
.tc-settings-card .tc-setting-text .fs-12 { line-height: 1.4; }
.tc-settings-card .tc-num-input { width: 128px; }
.tc-settings-card .tc-setting-row.is-wide { flex-direction: column; align-items: stretch; gap: .6rem; }
.tc-settings-card .tc-setting-row.is-wide .tc-setting-control { align-self: stretch; }
.tc-settings-card .tc-setting-row.is-wide .tc-text-input { width: 100%; }
.tc-settings-card .tc-setting-row.is-wide .tc-segmented { display: flex; width: 100%; flex-wrap: nowrap; }
.tc-settings-card .tc-setting-row.is-wide .tc-segmented .btn { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.25; padding-inline: .4rem; }
.tc-settings-card .tc-setting-row.has-error { margin: 0 -1.25rem; padding-inline: 1.25rem; }
@media (max-width: 575.98px) {
  .tc-settings-toolbar .tc-settings-scope, .tc-settings-toolbar .tc-settings-search { flex: 1 1 100%; max-width: none; min-width: 0; }
}

/* ================= Back ================= */
/* Wide screens: a clearly visible "Back to …" pill in the page header */
.tc-back { align-items: center; gap: .35rem; flex: none; height: 2.25rem; max-width: 240px; padding: 0 .9rem 0 .65rem; border-radius: 50rem;
  border: 1px solid var(--pe-primary-border-subtle); background: var(--pe-primary-bg-subtle); color: var(--pe-primary-text-emphasis);
  font-size: .85rem; font-weight: 600; text-decoration: none; transition: background-color .15s, color .15s, border-color .15s; }
.tc-back > i { font-size: 1.15rem; transition: transform .15s; }
.tc-back > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-back:hover, .tc-back:focus-visible { background: var(--pe-primary); border-color: var(--pe-primary); color: #fff; }
.tc-back:hover > i { transform: translateX(-2px); }
/* Phones and tablets: a round Back in the top bar, in place of the menu button */
.tc-appbar-back { display: grid; place-items: center; flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary); font-size: 1.35rem; text-decoration: none;
  box-shadow: inset 0 0 0 1px var(--pe-primary-border-subtle); -webkit-tap-highlight-color: transparent; }
.tc-appbar-back:active { transform: scale(.94); background: var(--pe-primary); color: #fff; }
@media (max-width: 991.98px) { .tc-menu-lg-only { display: none !important; } }
/* The sidebar button shows fold / unfold (it used to be an arrow that looked like Back) */
[data-sidebar=icon] .tc-fold-icon::before { content: "\ef40"; }

/* ================= Cart list ================= */
.tc-tab-count { margin-left: .45rem; min-width: 1.4rem; padding: .05rem .45rem; border-radius: 50rem; font-size: .7rem; font-weight: 700; text-align: center;
  background: var(--pe-tertiary-bg); color: var(--tc-muted); }
.nav-link.active .tc-tab-count { background: rgba(255, 255, 255, .25); color: #fff; }
.cart-card { overflow: hidden; }
.cart-card.is-idle { box-shadow: inset 3px 0 0 var(--pe-primary); }
.cart-card h6 { font-weight: 600; }
.tc-cart-actions { position: relative; z-index: 2; display: flex; align-items: center; gap: .35rem; padding: .55rem .75rem; background: transparent;
  border-top: 1px dashed var(--tc-border); }
.tc-wa:hover, .tc-wa:focus-visible { color: #1da851 !important; }

/* Dark mode: "light" primary buttons (Continue, …) get readable light text on a soft tint of the theme colour —
   with a very dark theme colour the theme's own version is grey text on a black button */
[data-bs-theme=dark] .btn-light-primary { --pe-btn-color: var(--pe-body-color); --pe-btn-bg: rgba(var(--pe-primary-rgb), .2); }

/* Quotations on phones: one card each with space between, big action bar like the cart list */
.tc-q-list { display: grid; gap: .75rem; padding: .75rem; }
.tc-q-card { margin: 0; overflow: hidden; border: 1px solid var(--tc-border); border-radius: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.tc-q-card.is-old { opacity: .75; }
.tc-q-card > .card-body { padding: 1rem 1rem .9rem; }
.tc-q-name { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; }
.tc-q-meta { margin-top: .15rem; font-size: .875rem; color: var(--tc-muted); }
.tc-q-label { font-size: .75rem; color: var(--tc-muted); }
.tc-q-amount { font-size: 1.25rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tc-q-valid { font-size: .9375rem; font-weight: 600; line-height: 1.3; }
.tc-q-actions { border-top: 1px dashed var(--tc-border); }
/* a card whose ⋮ menu is open sits above the cards below it (their action bars would otherwise cover the menu) */
.cart-card:has(.dropdown-menu.show), .tc-q-card:has(.dropdown-menu.show) { position: relative; z-index: 30; }
:root { --tc-pdf: #c4320a; --tc-pdf-bg: #fdeee8; --tc-pdf-bg-hover: #fbdcd0; }
[data-bs-theme=dark] { --tc-pdf: #fb923c; --tc-pdf-bg: rgba(251, 146, 60, .15); --tc-pdf-bg-hover: rgba(251, 146, 60, .25); }
.btn.tc-btn-pdf, .btn.tc-btn-pdf:hover, .btn.tc-btn-pdf:focus-visible, .btn.tc-btn-pdf:active { color: var(--tc-pdf); border-color: transparent; }
.btn.tc-btn-pdf { background: var(--tc-pdf-bg); }
.btn.tc-btn-pdf:hover, .btn.tc-btn-pdf:focus-visible, .btn.tc-btn-pdf:active { background: var(--tc-pdf-bg-hover); }

/* Call (blue) and WhatsApp (green): the same colours on every screen, easy to tell apart at a glance */
:root { --tc-call: #1a64d6; --tc-call-bg: #e8f1fd; --tc-call-bg-hover: #d6e6fb; --tc-wa: #0f7a3b; --tc-wa-icon: #1da851; --tc-wa-bg: #e5f6eb; --tc-wa-bg-hover: #d0efdc; }
[data-bs-theme=dark] { --tc-call: #7cb2ff; --tc-call-bg: rgba(26, 100, 214, .22); --tc-call-bg-hover: rgba(26, 100, 214, .34); --tc-wa: #4ade80; --tc-wa-icon: #4ade80; --tc-wa-bg: rgba(37, 211, 102, .16); --tc-wa-bg-hover: rgba(37, 211, 102, .26); }
.btn.tc-btn-call, .btn.tc-btn-call:hover, .btn.tc-btn-call:focus-visible, .btn.tc-btn-call:active { color: var(--tc-call); border-color: transparent; }
.btn.tc-btn-call { background: var(--tc-call-bg); }
.btn.tc-btn-call:hover, .btn.tc-btn-call:focus-visible, .btn.tc-btn-call:active { background: var(--tc-call-bg-hover); }
.btn.tc-btn-wa, .btn.tc-btn-wa:hover, .btn.tc-btn-wa:focus-visible, .btn.tc-btn-wa:active { color: var(--tc-wa); border-color: transparent; }
.btn.tc-btn-wa i { color: var(--tc-wa-icon); }
.btn.tc-btn-wa { background: var(--tc-wa-bg); }
.btn.tc-btn-wa:hover, .btn.tc-btn-wa:focus-visible, .btn.tc-btn-wa:active { background: var(--tc-wa-bg-hover); }

/* Toolbar: search (+ New cart on phones) · status · sort and Everyone / Mine — one consistent set of 44 / 38px controls */
.tc-carts-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-bottom: 1rem; }
.tc-carts-tabs { order: 1; }
.tc-carts-find { order: 2; display: flex; gap: .5rem; flex: 1 1 280px; max-width: 460px; min-width: 0; }
.tc-carts-filters { order: 3; display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.tc-search-field { position: relative; flex: 1 1 auto; min-width: 0; }
.tc-search-field > i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); font-size: 1.1rem; color: var(--tc-muted); pointer-events: none; }
.tc-search-field > .form-control { height: 44px; padding-left: 2.6rem; border-radius: 12px; font-size: .9375rem; background-color: var(--tc-surface); }
.tc-new-cart-btn { flex: none; display: inline-flex; align-items: center; gap: .3rem; height: 44px; padding: 0 1rem; border-radius: 12px; font-weight: 600; white-space: nowrap; }
.tc-new-cart-btn > i { font-size: 1.15rem; }

/* Segmented control (cart status, Everyone / Mine) */
.tc-seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--tc-border); border-radius: 12px; background: var(--pe-tertiary-bg); }
.tc-seg-item { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 36px; padding: .3rem .95rem;
  border-radius: 9px; color: var(--pe-body-color); font-size: .9rem; font-weight: 500; white-space: nowrap; text-decoration: none; transition: background-color .15s, color .15s; }
.tc-seg-item:hover { color: var(--pe-body-color); background: rgba(var(--pe-body-color-rgb), .06); }
.tc-seg-item.active, .tc-seg-item.active:hover { background: var(--pe-primary); color: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.tc-seg-item .tc-tab-count { margin-left: 0; background: rgba(var(--pe-body-color-rgb), .09); color: var(--pe-body-color); }
.tc-seg-item.active .tc-tab-count { background: rgba(255, 255, 255, .24); color: #fff; }
.tc-seg-sm .tc-seg-item { min-height: 30px; padding: .2rem .85rem; font-size: .85rem; }
button.tc-seg-item { border: 0; background: transparent; font-family: inherit; line-height: 1.2; }

/* Chip button (sort) — same height as the small segmented control */
.tc-chip { display: inline-flex; align-items: center; gap: .4rem; height: 38px; padding: 0 .9rem; border: 1px solid var(--tc-border); border-radius: 50rem;
  background: var(--tc-surface); color: var(--pe-body-color); font-size: .875rem; font-weight: 500; white-space: nowrap; }
.tc-chip > i { flex: none; font-size: 1.05rem; color: var(--tc-muted); }
.tc-chip { max-width: 100%; }
.tc-chip-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tc-carts-filters > .dropdown { min-width: 0; }
.tc-carts-filters > .tc-seg { flex: none; }
.tc-chip:hover, .tc-chip[aria-expanded="true"] { border-color: var(--pe-primary-border-subtle); }

/* Cards: larger, easier-to-read text */
.cart-card > .card-body { padding: 1rem 1rem .9rem; }
.tc-cart-avatar { width: 44px; height: 44px; flex: 0 0 44px; font-size: .95rem; }
.tc-cart-name { margin: 0; font-size: 1.0625rem; line-height: 1.3; }
.tc-cart-contact { margin-top: .15rem; font-size: .875rem; color: var(--tc-muted); }
.tc-num { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.tc-cart-sum { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: .75rem; align-items: end; }
.tc-cart-total { grid-column: 2; grid-row: 1; text-align: right; }
.tc-cart-owner { grid-column: 1 / -1; grid-row: 2; }
.tc-cart-meta { list-style: none; margin: 0; padding: 0; min-width: 0; font-size: .875rem; line-height: 1.65; color: var(--tc-muted); }
.tc-cart-meta li { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.tc-cart-meta li > i { flex: none; font-size: 1rem; }
.tc-cart-meta li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-cart-meta .tc-meta-strong { color: var(--pe-body-color); font-weight: 500; }
.tc-cart-meta .tc-meta-quote { color: var(--pe-success-text-emphasis); font-weight: 600; }
.cart-card .cart-pill { white-space: nowrap; flex: none; }
.tc-cart-value-label { font-size: .75rem; color: var(--tc-muted); }
.cart-card .cart-value { font-size: 1.25rem; line-height: 1.3; }
.cart-card .tc-empty-pill { font-size: .8125rem; padding: .3rem .8rem; }
.cart-card .cart-pill { font-size: .75rem; }
.tc-cart-reason { margin-top: .6rem; font-size: .875rem; font-style: italic; color: var(--tc-muted); }
.tc-cart-actions { gap: .5rem; padding: .65rem 1rem; }
.tc-cart-actions .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 10px; font-size: .9rem; font-weight: 600; line-height: 1.2; }
.tc-cart-actions .btn > span { display: inline-flex; align-items: center; }
.tc-cart-actions .icon-btn-sm { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; font-size: 1.15rem; }

@media (max-width: 575.98px) {
  .tc-carts-head { display: none !important; }   /* the app bar names the page; the tab shows the count; New cart sits beside search */
  .tc-carts-find { order: 1; flex-basis: 100%; max-width: none; }
  .tc-carts-tabs { order: 2; flex-basis: 100%; }
  .tc-carts-tabs .tc-seg-item { flex: 1 1 0; padding-inline: .5rem; }
  .tc-carts-filters { order: 3; flex-basis: 100%; min-width: 0; margin-left: 0; justify-content: space-between; }
  .tc-carts-filters .tc-chip { padding-inline: .8rem; }
  .tc-carts-filters .tc-seg-sm .tc-seg-item { padding-inline: .75rem; }
}
@media (max-width: 389.98px) {   /* 360px-class phones */
  .tc-search-field > .form-control::placeholder { font-size: .8125rem; }   /* the whole hint fits beside "New Cart" */
  .tc-carts-filters .tc-chip, .tc-carts-filters .tc-seg-sm .tc-seg-item { padding-inline: .65rem; font-size: .8125rem; }
}
@media (max-width: 359.98px) {   /* the smallest phones */
  .tc-xs-hide, .tc-carts-filters .tc-chip > i { display: none; }
  .tc-new-cart-btn { padding-inline: .8rem; }
  .cart-card .cart-value { font-size: 1.1rem; }
}

/* ================= Cart page ================= */
/* Switch between the customers I'm serving */
.tc-cart-switch { display: flex; align-items: center; gap: .4rem; margin: 0 0 .85rem; padding-bottom: .15rem; overflow-x: auto; scrollbar-width: none; }
.tc-cart-switch::-webkit-scrollbar { display: none; }
.tc-cart-switch-label { flex: none; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--tc-muted); margin-right: .15rem; }
.tc-cart-chip { flex: none; display: inline-flex; align-items: center; gap: .4rem; max-width: 220px; padding: .3rem .55rem .3rem .3rem; border-radius: 50rem;
  border: 1px solid var(--tc-border); background: var(--tc-surface); color: var(--pe-body-color); font-size: .82rem; font-weight: 500; text-decoration: none;
  transition: border-color .15s, background-color .15s; }
.tc-cart-chip:hover { border-color: var(--pe-primary-border-subtle); color: var(--pe-body-color); }
.tc-cart-chip.active { border-color: var(--pe-primary); background: var(--pe-primary-bg-subtle); color: var(--pe-primary-text-emphasis); font-weight: 600; }
.tc-chip-avatar { display: grid; place-items: center; flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--pe-primary-bg-subtle);
  color: var(--pe-primary); font-size: .62rem; font-weight: 700; }
.tc-cart-chip.active .tc-chip-avatar { background: var(--pe-primary); color: #fff; }
.tc-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-chip-count { flex: none; min-width: 1.2rem; padding: 0 .35rem; border-radius: 50rem; background: var(--pe-tertiary-bg); font-size: .68rem; font-weight: 700; text-align: center; }
/* a selection tab: "DEFAULT" over "RAVI KUMAR · 31 Oct, 12:06 PM" */
.tc-cart-chip-2 { max-width: 260px; border-radius: .9rem; padding-top: .25rem; padding-bottom: .25rem; }
.tc-chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.tc-chip-no { font-weight: 700; opacity: .65; }
.tc-chip-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; font-weight: 500; color: var(--pe-secondary-color); }
.tc-cart-chip.active .tc-chip-sub { color: inherit; opacity: .8; }
.tc-cart-chip-new { padding-left: .6rem; border-style: dashed; color: var(--pe-primary); font-weight: 600; }
[data-bs-theme=dark] .tc-cart-chip-new { color: var(--pe-body-color); }
.tc-cart-chip-new i { font-size: 1rem; }
/* phones: "+ Add" and one button with this selection; it opens the open selections grouped by sales person */
.tc-cart-switch-m { position: relative; display: flex; align-items: stretch; gap: .4rem; margin: 0 0 .85rem; }
.tc-cart-switch-m > .dropdown { position: static; }   /* the list spans the whole bar */
.tc-cart-switch-m > .tc-cart-chip-new { border-radius: .9rem; }
.tc-cart-switch-btn { width: 100%; max-width: none; padding-right: .7rem; text-align: left; font: inherit; font-size: .82rem; }
.tc-cart-switch-btn > i { font-size: 1.1rem; opacity: .7; }
.tc-chip-more { flex: none; padding: .1rem .45rem; border-radius: 50rem; background: var(--tc-surface); font-size: .68rem; font-weight: 600; white-space: nowrap; }
.tc-cart-switch-menu[data-bs-popper] { left: 0; right: 0; }
.tc-cart-switch-menu { width: auto; max-height: 65vh; overflow-y: auto; padding: .35rem; border-radius: .9rem; }
.tc-cart-switch-group { display: flex; align-items: center; gap: .5rem; padding: .55rem .5rem .3rem; font-size: .72rem; font-weight: 700;
  letter-spacing: .03em; color: var(--pe-secondary-color); }
.tc-cart-switch-group:not(:first-child) { margin-top: .25rem; border-top: 1px solid var(--tc-border); padding-top: .65rem; }
.tc-cart-switch-item { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem .5rem 2.6rem; border-radius: .6rem; white-space: normal; }

.tc-note-dot { width: 7px; height: 7px; margin-left: .35rem; border-radius: 50%; background: var(--pe-primary); }

/* Items: quick − / + */
.tc-item-foot { display: flex; align-items: center; gap: .5rem; margin-top: .6rem; padding-left: calc(56px + 1rem); min-height: 2.25rem; }
.tc-stepper { display: inline-flex; align-items: center; flex: none; border: 1px solid var(--tc-border); border-radius: 50rem; background: var(--tc-surface); }
.tc-step-btn { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 0; border-radius: 50%; background: none; color: var(--pe-primary);
  font-size: 1.15rem; -webkit-tap-highlight-color: transparent; }
.tc-step-btn:hover { background: var(--pe-primary-bg-subtle); }
.tc-step-btn:active { transform: scale(.9); }
.tc-step-btn .ri-delete-bin-line { color: var(--pe-danger); font-size: 1rem; }
.tc-step-val { min-width: 4.4rem; text-align: center; font-size: .85rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tc-step-val small { color: var(--tc-muted); }
.cart-item.is-pending .line-amount { color: var(--pe-primary); }
@media (max-width: 575.98px) { .tc-item-foot { padding-left: 0; } }

/* Total: tap to open the summary on phones */
.tc-sum-toggle { border: 0; background: none; padding: 0; color: inherit; }
.tc-sum-chevron { transition: transform .2s; font-size: 1rem; }
.cart-summary.is-open .tc-sum-chevron { transform: rotate(180deg); }
.tc-sum-details > div { padding: .1rem 0; }
@media (max-width: 991.98px) {
  .tc-sum-details { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .28s ease, opacity .2s; }
  .tc-sum-details.open { max-height: 320px; opacity: 1; }
  .cart-summary.is-open { border-radius: 1rem 1rem 0 0; box-shadow: 0 -12px 32px rgba(0, 0, 0, .14); }
  .cart-summary .grand { font-size: 1.4rem; }
}

/* Snack bar ("Removed X · Undo") */
.tc-snack-host { position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom)); z-index: 1096; transform: translateX(-50%);
  width: min(460px, calc(100vw - 1.5rem)); pointer-events: none; }
@media (max-width: 991.98px) { body.tc-own-bar .tc-snack-host, body.tc-has-tabbar .tc-snack-host { bottom: calc(6.25rem + env(safe-area-inset-bottom)); } }
.tc-snack { display: flex; align-items: center; gap: .75rem; padding: .65rem .75rem .65rem 1rem; border-radius: .8rem; background: #1f2329; color: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .25); pointer-events: auto; opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; }
.tc-snack.show { opacity: 1; transform: none; }
.tc-snack-text { flex: 1 1 auto; min-width: 0; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-snack-action { flex: none; border: 0; background: none; color: #ffb27d; font-weight: 700; font-size: .875rem; text-transform: uppercase; letter-spacing: .03em; padding: .25rem .4rem; }
.tc-snack .btn-close { flex: none; font-size: .6rem; }
/* Phones / portrait tablets: the cart total is a real bottom bar (it used to stick only inside its own column, so it scrolled away) */
@media (max-width: 991.98px) {
  .cart-summary { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; z-index: 1002; border-radius: 1rem 1rem 0 0; }
  body:has(.cart-summary) { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  body:has(.cart-summary.is-open)::after { content: ""; position: fixed; inset: 0; z-index: 1001; background: rgba(0, 0, 0, .28); }
}

/* ================= Cart page: customer card, add bar, sections ================= */
.tc-cust-card { overflow: hidden; border-radius: 1rem; }
.tc-cust-card > .card-body { padding: 1rem 1rem .9rem; }
.tc-cust-avatar { width: 52px; height: 52px; flex: 0 0 52px; font-size: 1.1rem; font-weight: 700; }
.tc-cust-name { margin: 0; min-width: 0; font-size: 1.15rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-cust-meta { align-items: flex-start; margin-top: .45rem; line-height: 1.5; }
.tc-cust-meta .cart-pill { margin-top: .05rem; }
.tc-cust-meta > span:last-child > i { color: var(--tc-muted); }
.tc-cust-more { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; }
.tc-cust-line { display: flex; align-items: center; gap: .35rem; min-width: 0; margin-top: .25rem; font-size: .8125rem; }
.tc-cust-line > i { flex: none; color: var(--tc-muted); font-size: .9rem; }
/* Call · WhatsApp · History · Notes as contact-card tiles: a coloured icon above the label, each action its own colour */
:root { --tc-hist: #475467; --tc-hist-bg: #f0f2f5; --tc-notes: #a15c07; --tc-notes-icon: #d97706; --tc-notes-bg: #fdf3e1; }
[data-bs-theme=dark] { --tc-hist: #c3cad5; --tc-hist-bg: rgba(255, 255, 255, .07); --tc-notes: #fbbf24; --tc-notes-icon: #fbbf24; --tc-notes-bg: rgba(251, 191, 36, .14); }
.tc-cust-head { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem .75rem; }
.tc-cust-info { flex: 1 1 0; min-width: 0; }
.tc-cust-actions { order: 1; flex: 0 0 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .5rem; }
/* phones show the icon alone (the tile colour says what it is); wide screens add the word */
.tc-act-label { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tc-cust-actions > a, .tc-cust-actions > button { --tile-fg: var(--tc-hist); --tile-icon: var(--tc-hist); --tile-bg: var(--tc-hist-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; min-height: 56px; padding: .5rem .25rem;
  border: 0; border-radius: 14px; background: var(--tile-bg); color: var(--tile-fg); font-size: .78rem; font-weight: 600; line-height: 1.15;
  text-decoration: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; transition: transform .12s, filter .12s; }
.tc-cust-actions > .tc-call { --tile-fg: var(--tc-call); --tile-icon: var(--tc-call); --tile-bg: var(--tc-call-bg); }
.tc-cust-actions > .tc-wa { --tile-fg: var(--tc-wa); --tile-icon: var(--tc-wa-icon); --tile-bg: var(--tc-wa-bg); }
.tc-cust-actions > .tc-notes { --tile-fg: var(--tc-notes); --tile-icon: var(--tc-notes-icon); --tile-bg: var(--tc-notes-bg); }
.tc-cust-actions i { font-size: 1.7rem; line-height: 1; color: var(--tile-icon); }
.tc-cust-actions > a:hover, .tc-cust-actions > button:hover { color: var(--tile-fg); filter: brightness(.97); }
.tc-cust-actions > a:active, .tc-cust-actions > button:active { transform: scale(.96); }
.tc-cust-actions .tc-note-dot { position: absolute; top: -2px; right: -6px; margin: 0; background: var(--tc-notes-icon); box-shadow: 0 0 0 2px var(--tile-bg); }

/* Add bar: Scan + search the same height, code box on demand (always shown on wide screens) */
.tc-add-card { border-radius: .9rem; box-shadow: 0 2px 10px rgba(0, 0, 0, .04); }
.tc-scan-btn { display: inline-flex; align-items: center; gap: .4rem; height: 46px; padding: 0 1rem; border-radius: .7rem; font-size: 1rem; font-weight: 600; }
.tc-scan-btn i { font-size: 1.2rem; }
.tc-add-search { position: relative; }
.tc-add-search > i { position: absolute; left: .85rem; top: 50%; z-index: 3; transform: translateY(-50%); color: var(--tc-muted); font-size: 1.05rem; pointer-events: none; }
.tc-add-search .ts-wrapper { height: 46px; }
.tc-add-search .ts-wrapper .ts-control { height: 46px; min-height: 46px; display: flex; align-items: center; padding: 0 .85rem 0 2.4rem !important;
  border: 1px solid var(--tc-border) !important; border-radius: .7rem !important; background: var(--pe-body-bg) !important; box-shadow: none !important; font-size: .95rem; }
.tc-add-search .ts-wrapper.focus .ts-control { border-color: var(--pe-primary) !important; background: var(--tc-surface) !important; }
.tc-add-search .ts-control input { font-size: .95rem !important; }
.tc-code-toggle { width: 46px; height: 46px; padding: 0; display: grid; place-items: center; border-radius: .7rem; font-size: 1.2rem; }
.tc-code-toggle[aria-expanded="true"] { background: var(--pe-primary-bg-subtle); color: var(--pe-primary); border-color: var(--pe-primary-border-subtle) !important; }
.cart-toolbar { padding: .25rem 0 .5rem; margin-bottom: .25rem; }

/* "Products · 2" header and "Add another product" */
.tc-cart-section { display: flex; align-items: center; gap: .5rem; margin: .35rem .2rem .6rem; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--tc-muted); }
.tc-section-count { min-width: 1.35rem; padding: .05rem .4rem; border-radius: 50rem; background: var(--pe-tertiary-bg); color: var(--pe-body-color); text-align: center; }
/* ================= Locations (Product masters) and "Where it is kept" on products ================= */
.tc-loc-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: .75rem; background: var(--pe-primary-bg-subtle); color: var(--pe-primary); font-size: 1.2rem; }
.btn-check:checked + .tc-seg-item { background: var(--pe-primary); color: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.btn-check:focus-visible + .tc-seg-item { outline: 2px solid rgba(var(--pe-primary-rgb), .45); outline-offset: 1px; }
.tc-loc-kinds .tc-seg-item { flex: 1 1 0; padding-inline: .45rem; font-size: .85rem; }
.tc-loc-empty { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border: 1.5px dashed var(--tc-border); border-radius: 12px; }
.tc-loc-empty > i { font-size: 1.6rem; color: var(--tc-muted); }
.tc-loc-branch { margin: .75rem 0 .45rem; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tc-muted); }
.tc-loc-group:first-of-type .tc-loc-branch { margin-top: 0; }
.tc-loc-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.tc-loc-chip { display: inline-flex; align-items: center; gap: .4rem; height: 38px; margin: 0; padding: 0 .85rem; border: 1px solid var(--tc-border); border-radius: 50rem;
  background: var(--tc-surface); color: var(--pe-body-color); font-size: .875rem; font-weight: 500; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color .12s, border-color .12s, color .12s; }
.tc-loc-chip > i:first-child { color: var(--tc-muted); font-size: 1rem; }
.tc-loc-chip:hover { border-color: var(--pe-primary); }
.tc-loc-tick { display: none; font-size: 1rem; }
.btn-check:checked + .tc-loc-chip { border-color: var(--pe-primary); background: var(--pe-primary); color: #fff; }
.btn-check:checked + .tc-loc-chip > i { color: inherit; }
.btn-check:checked + .tc-loc-chip .tc-loc-tick { display: inline; }
.btn-check:focus-visible + .tc-loc-chip { outline: 2px solid rgba(var(--pe-primary-rgb), .45); outline-offset: 2px; }
.tc-loc-chip.d-none { display: none !important; }
/* the places on a product page, a cart item or a Quick Sell tile */
.tc-places { display: flex; flex-wrap: wrap; gap: .35rem; }
.tc-place { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border-radius: 50rem; background: var(--pe-tertiary-bg); font-size: .8125rem; font-weight: 500; }
.tc-place > i { color: var(--tc-muted); }
.tc-place-line { display: flex; align-items: center; gap: .3rem; min-width: 0; font-size: .75rem; color: var(--tc-muted); }
.tc-place-line > i { flex: none; font-size: .85rem; }
.tc-place-line > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Find in this cart */
.tc-cart-find { margin: -.15rem 0 .7rem; }
.tc-cart-find .tc-search-field > .form-control { height: 42px; }
.tc-cart-find-note { margin: .45rem .2rem 0; font-size: .8125rem; color: var(--tc-muted); }
.tc-cart-find-note:empty { display: none; }
.cart-item .tc-item-name mark { padding: 0 .05rem; border-radius: 3px; background: rgba(var(--pe-primary-rgb), .14); color: inherit; font-weight: inherit; }
.tc-add-more { display: flex; align-items: center; justify-content: center; gap: .4rem; width: 100%; margin-top: .25rem; padding: .8rem; border: 1.5px dashed var(--tc-border);
  border-radius: .75rem; background: transparent; color: var(--pe-primary); font-size: .875rem; font-weight: 600; }
.tc-add-more:hover { border-color: var(--pe-primary-border-subtle); background: var(--pe-primary-bg-subtle); }
.cart-item { border: 1px solid var(--tc-border); box-shadow: none; }

/* ================= Selection: the designs as a table, then the quantity size by size ================= */
.tc-sel-card { border: 1px solid var(--tc-border); box-shadow: none; overflow: hidden; margin-bottom: .75rem; }
.tc-sel-wrap { container-type: inline-size; }
.tc-sel-table, .tc-size-table { margin: 0; font-size: .85rem; }
.tc-sel-table > :not(caption) > * > *, .tc-size-table > :not(caption) > * > * { padding: .55rem .6rem; vertical-align: middle; }
.tc-sel-table thead th, .tc-size-table thead th { font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tc-muted);
  background: var(--tc-soft); white-space: nowrap; }
.tc-sel-table .num, .tc-size-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-sel-table .c-no { width: 2.2rem; color: var(--tc-muted); text-align: center; font-variant-numeric: tabular-nums; }
.tc-sel-table .c-photo { width: 68px; }
.tc-sel-photo { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--tc-soft);
  border: 1px solid var(--tc-border); color: var(--tc-muted); font-size: 1.3rem; }
.tc-sel-table .c-design { min-width: 9rem; }
.tc-sel-table .c-design .tc-item-name { font-size: .9rem; }
.tc-sel-table .c-size { white-space: nowrap; }
.tc-sel-table .c-qty { width: 1%; white-space: nowrap; text-align: center; }
.tc-sel-row.is-editable { cursor: pointer; }
.tc-sel-row.is-editable:hover > td { background: rgba(var(--pe-primary-rgb), .04); }
.tc-sel-row:focus-visible { outline: 2px solid var(--pe-primary); outline-offset: -2px; }
.tc-sel-row.is-pending [data-line-amount], .tc-sel-row.is-pending [data-area], .tc-sel-row.is-pending [data-weight] { color: var(--pe-primary); }
.tc-sel-row .tc-item-name mark { padding: 0 .05rem; border-radius: 3px; background: rgba(var(--pe-primary-rgb), .14); color: inherit; font-weight: inherit; }
.tc-sel-group > th { padding-top: .85rem !important; background: transparent; font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--tc-muted); }
.tc-sel-table tfoot td, .tc-size-table tfoot > tr > * { font-weight: 700; background: var(--tc-soft); border-bottom: 0; }
.tc-size-table tbody th { font-weight: 600; }
.tc-sel-table .x-size, .tc-sel-table .x-loc, .tc-sel-table .x-area, .tc-sel-table .x-amt { display: none; }
/* a narrower table folds its columns into the design's cell: first sq.ft, weight and amount, then size, location and the number */
@container (max-width: 760px) {
  .tc-sel-table .c-area, .tc-sel-table .c-wt, .tc-sel-table .c-amt { display: none; }
  .tc-sel-table .x-area:not(:empty) { display: block; }
  .tc-sel-table .x-amt { display: inline; }
}
/* phones: the same rows, laid out as tidy cards — a large photo; the name; finish, size and location as small tags; sq.ft and
   weight in bold; the box stepper on the right */
@container (max-width: 600px) {
  .tc-sel-table .c-size, .tc-sel-table .c-loc, .tc-sel-table .c-no { display: none; }
  .tc-sel-table thead { display: none; }
  .tc-sel-table > tbody > tr > *, .tc-sel-table > tfoot > tr > * { padding: .8rem .45rem; border-bottom-color: var(--tc-border); }
  .tc-sel-table .c-photo { width: 68px; padding-left: .75rem !important; padding-right: .15rem !important; vertical-align: top; }
  .tc-sel-photo { width: 56px; height: 56px; border-radius: 12px; border: 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-size: 1.3rem; }
  .tc-sel-table .c-design { min-width: 0; overflow-wrap: anywhere; vertical-align: top; }
  .tc-sel-table .c-design .tc-item-name { font-size: .95rem; font-weight: 700; line-height: 1.25; -webkit-line-clamp: 2; }
  /* finish, size and location: small tags on one line */
  .tc-sel-table .c-design > .tc-item-sub:not(.x-area) { display: inline-flex; align-items: center; gap: .2rem; max-width: 100%; margin: .35rem .25rem 0 0;
    padding: .12rem .5rem; border-radius: 50rem; background: var(--tc-soft); color: var(--pe-body-color); font-size: .72rem; font-weight: 500;
    line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tc-sel-table .c-design > .tc-item-sub:not(.x-area) i { margin-right: .1rem !important; color: var(--tc-muted); }
  .tc-sel-table .c-design > .tc-item-sub.x-loc { background: rgba(var(--pe-primary-rgb), .1); color: var(--pe-primary); font-weight: 600; letter-spacing: .02em; }
  .tc-sel-table .c-design > .tc-item-sub.x-loc i { color: inherit; }
  /* no sq.ft · weight line on phones (the totals stay above the list and in the summary) */
  .tc-sel-table .x-area, .tc-sel-table .x-area:not(:empty) { display: none; }
  .tc-sel-table .c-design .tc-item-note { margin-top: .4rem; }
  /* the stepper: compact and soft, side by side (− number +), at the top of the row */
  .tc-sel-table .c-qty { padding-right: .7rem !important; padding-left: .2rem !important; vertical-align: top; }
  .tc-sel-table .tc-stepper { flex-direction: row; gap: 0; border: 0; border-radius: 50rem; background: var(--tc-soft); padding: 2px; }
  .tc-sel-table .tc-step-btn { width: 1.9rem; height: 1.9rem; border-radius: 50%; }
  .tc-sel-table .tc-step-val { min-width: 2.3rem; padding: 0 .1rem; font-size: .92rem; }
  .tc-sel-table .tc-step-val small { display: none; }   /* the boxes are the number in the middle */
  .tc-sel-table .qty-chip { display: inline-block; padding: .3rem .55rem; border-radius: 10px; font-weight: 600; }
  .tc-sel-group > th { padding: .7rem .8rem .35rem !important; }
  .tc-sel-table tfoot td.c-design { font-size: .9rem; }
}
.tc-size-card .card-header { padding: .7rem .9rem; }
.tc-size-card { container-type: inline-size; }
.tc-size-card .table-responsive { overscroll-behavior-x: contain; }
.tc-size-table tbody th { white-space: nowrap; }
/* phones: the By size / By finish switch on a row of its own, the table compact with its first column pinned */
@container (max-width: 520px) {
  .tc-size-card .card-header .tc-seg { flex: 1 1 100%; margin-left: 0 !important; }
  .tc-size-card .card-header .tc-seg-item { flex: 1 1 0; }
  .tc-size-table { width: max-content; min-width: 100%; font-size: .8rem; }
  .tc-size-table > :not(caption) > * > * { padding: .5rem .55rem; }
  .tc-size-table > :not(caption) > * > :first-child { position: sticky; left: 0; z-index: 1; padding-left: .8rem; background: var(--tc-surface);
    box-shadow: inset -1px 0 0 var(--tc-border); }
  .tc-size-table thead > tr > :first-child, .tc-size-table tfoot > tr > :first-child { background: linear-gradient(var(--tc-soft), var(--tc-soft)), var(--tc-surface); }
  .tc-size-table > :not(caption) > * > :last-child { padding-right: .8rem; }
}
@container (max-width: 400px) { .tc-size-table .c-designs { display: none; } .tc-size-table { font-size: .78rem; } }

/* ================= Catalogue download dialog: layout, logo, brand name, contact details, product PDFs ================= */
.tc-cd-group { margin: 0 0 1.1rem; padding: 0; border: 0; min-width: 0; }
.tc-cd-group:last-child { margin-bottom: 0; }
.tc-cd legend.form-label { float: none; width: auto; margin-bottom: .45rem; font-size: .875rem; }
.tc-cd .tc-seg-item { flex: 1 1 0; min-width: 0; padding-inline: .5rem; white-space: normal; text-align: center; line-height: 1.15; }
.tc-cd-detail { display: flex; align-items: center; gap: .6rem; min-height: 2.25rem; margin-top: .55rem; font-size: .8125rem; color: var(--tc-muted); }
.tc-cd-detail.d-none { display: none !important; }
.tc-cd-logo { flex: none; height: 38px; max-width: 120px; padding: 3px; object-fit: contain; border: 1px solid var(--tc-border); border-radius: 8px; background: #fff; }
.tc-cd-pdfs { padding: .75rem .85rem; border: 1px solid var(--tc-border); border-radius: 12px; background: var(--tc-surface); }
@media (max-width: 400px) { .tc-cd .tc-seg-item > i { display: none; } }
@media (min-width: 576px) { .modal-dialog.tc-cd { max-width: 620px; } }
/* four logo choices: two rows of two on phones */
@media (max-width: 575.98px) { .tc-cd .tc-seg-4 { flex-wrap: wrap; } .tc-cd .tc-seg-4 .tc-seg-item { flex: 1 1 calc(50% - 2px); } }

/* Selection: the quantity typed straight into the row; a design just added is lit up for a moment */
.tc-step-input { width: 3.2rem; padding: 0; border: 0; background: transparent; color: inherit; font-weight: 700; text-align: center;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.tc-step-input::-webkit-outer-spin-button, .tc-step-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tc-step-input:focus { outline: 2px solid rgba(var(--pe-primary-rgb), .45); outline-offset: 2px; border-radius: 6px; background: var(--tc-surface); }
.tc-sel-row.is-new > td { animation: tc-new-row 2.2s ease-out; }
@keyframes tc-new-row { 0%, 40% { background: rgba(var(--pe-primary-rgb), .12); } 100% { background: transparent; } }

/* Save & PDF: with or without images */
.tc-pdf-choice .tc-choice-card { width: 100%; background: var(--tc-surface); color: inherit; }
.tc-pdf-choice .tc-choice-card:hover { border-color: var(--pe-primary); }
.tc-pdf-choice .tc-choice-card.is-suggested { border-color: var(--pe-primary); box-shadow: 0 0 0 1px var(--pe-primary); }

/* ================= New cart / customer details dialog ================= */
.tc-newcart .modal-content { border-radius: 1.1rem; border: 0; }
.tc-newcart .modal-header { gap: .75rem; align-items: center; border-bottom: 1px solid var(--tc-border); }
.tc-newcart .modal-title { font-weight: 700; margin: 0; }
.tc-newcart-icon { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: .8rem; background: var(--pe-primary-bg-subtle);
  color: var(--pe-primary); font-size: 1.3rem; }
.tc-newcart .modal-body { padding: 1.1rem 1.25rem; }
.tc-newcart .modal-footer { border-top: 1px solid var(--tc-border); }
.tc-newcart .input-group-lg .input-group-text { font-size: 1rem; color: var(--tc-muted); }
.tc-newcart .form-control-lg, .tc-newcart .input-group-lg .form-control { font-size: 1.05rem; }
.tc-newcart #ncMobile { letter-spacing: .03em; }
.tc-nc-state { background: transparent; border-left: 0; }
/* Returning customer card under the mobile number */
.tc-returning { display: flex; align-items: center; gap: .65rem; margin-top: .6rem; padding: .55rem .75rem; border-radius: .75rem;
  background: var(--pe-success-bg-subtle); border: 1px solid var(--pe-success-border-subtle); animation: tc-fade-in .25s ease; }
.tc-returning .tc-avatar { width: 34px; height: 34px; font-size: .75rem; background: var(--pe-success); color: #fff; }
@keyframes tc-fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
/* "More details · optional" */
.tc-more-toggle { display: flex; align-items: center; gap: .4rem; width: 100%; padding: .7rem .85rem; border: 1px dashed var(--tc-border); border-radius: .75rem;
  background: transparent; color: var(--pe-body-color); font-size: .875rem; text-align: left; }
.tc-more-toggle:hover { border-color: var(--pe-primary-border-subtle); background: var(--pe-primary-bg-subtle); }
.tc-more-toggle .tc-more-plus { color: var(--pe-primary); font-size: 1.1rem; }
.tc-more-toggle .tc-more-chevron { transition: transform .2s; font-size: 1.1rem; color: var(--tc-muted); }
.tc-more-toggle[aria-expanded="true"] { border-style: solid; border-bottom-left-radius: 0; border-bottom-right-radius: 0; background: var(--pe-tertiary-bg); }
.tc-more-toggle[aria-expanded="true"] .tc-more-chevron { transform: rotate(180deg); }
.tc-more-count { padding: .05rem .5rem; border-radius: 50rem; background: var(--pe-primary); color: #fff; font-size: .7rem; font-weight: 700; }
.tc-more-body { padding: .25rem .85rem .9rem; border: 1px solid var(--tc-border); border-top: 0; border-radius: 0 0 .75rem .75rem; }
.tc-more-label { display: flex; align-items: center; gap: .4rem; margin: 1rem 0 .4rem; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--tc-muted); }
.tc-more-label > i { font-size: .95rem; color: var(--pe-primary); }
.tc-newcart .form-label.small { margin-bottom: .25rem; color: var(--tc-muted); }
@media (max-width: 575.98px) {
  .tc-newcart .modal-content { border-radius: 0; }
  .tc-newcart .modal-footer { padding-bottom: calc(.75rem + env(safe-area-inset-bottom)); }
  .tc-newcart .modal-footer .btn { flex: 1 1 0; padding-block: .7rem; }
}

/* ================= Phones: compact page headers ================= */
/* "Live" shows once connected; it only turns amber / grey after a connection was lost (no flash on every page load) */
.tc-live-pill[data-state="connecting"] { display: none; }
@media (max-width: 991.98px) {
  .page-header { margin: .25rem 0 .9rem; gap: .5rem; }
  .page-header h1.tc-title-dup { display: none !important; }
  .page-header .sub { font-size: .8125rem; line-height: 1.4; }
}
@media (max-width: 575.98px) {
  /* actions in one row (scrolls sideways if there are many) instead of wrapping onto two or three rows */
  .page-header > :last-child:not(:first-child) { display: flex; flex-wrap: nowrap !important; gap: .4rem; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .page-header > :last-child:not(:first-child)::-webkit-scrollbar { display: none; }
  .page-header > :last-child:not(:first-child) .btn, .page-header > .btn:last-child { white-space: nowrap; flex: none; padding: .45rem .8rem; font-size: .85rem; }
  .page-header > .btn:last-child:not(:first-child) { width: 100%; }
  /* the main action first, so it's never the one cut off at the edge */
  .page-header > :last-child:not(:first-child) > .btn-primary,
  .page-header > :last-child:not(:first-child) > :has(> .btn-primary) { order: -1; }
}

/* ================= Cart page polish (phone first) ================= */
/* Customer card: compact, content starts sooner */
.tc-cust-card > .card-body { padding: .85rem 1rem; }
.tc-cust-avatar { width: 44px; height: 44px; flex: 0 0 44px; font-size: .95rem; }
.tc-cust-name { font-size: 1.05rem; line-height: 1.3; display: block; -webkit-line-clamp: unset; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.tc-cust-line { margin-top: .1rem; }
.tc-cust-more { width: 32px; height: 32px; }
.tc-cust-card > .tc-cust-head { padding-bottom: 1rem; }

/* Wide screens: the customer card is one row — Back · who · Call WhatsApp History Notes · ⋮ — instead of a lone Back
   row above it and three stretched icon bars under it */
@media (min-width: 992px) {
  .tc-cust-card { container: cust-card / inline-size; }
  .tc-cust-card > .tc-cust-head { flex-wrap: nowrap; gap: 1rem; padding: .9rem 1.25rem; }
  .tc-cust-back { align-self: stretch; align-items: center; padding-right: 1rem; border-right: 1px solid var(--tc-border); }
  .tc-cust-avatar { width: 48px; height: 48px; flex: 0 0 48px; font-size: 1rem; }
  .tc-cust-name { font-size: 1.125rem; }
  .tc-cust-actions { order: 0; flex: none; display: flex; gap: .5rem; }
  .tc-cust-actions > a, .tc-cust-actions > button { flex-direction: row; gap: .45rem; width: 40px; min-height: 0; height: 40px; padding: 0; border-radius: 50rem; font-size: .85rem; }
  .tc-cust-actions i { font-size: 1.2rem; }
  .tc-cust-actions > :focus-visible { outline: 2px solid rgba(var(--pe-primary-rgb), .45); outline-offset: 2px; }
  .tc-cust-head > .dropdown .tc-cust-more { width: 40px; height: 40px; font-size: 1.1rem; }
  /* room for the words once the card is wide enough (sidebar open on a laptop: round icon buttons with tooltips) */
  @container cust-card (min-width: 1040px) {
    .tc-cust-actions > a, .tc-cust-actions > button { width: auto; padding: 0 1rem 0 .85rem; }
    .tc-act-label { position: static !important; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; }
  }
}

/* Add bar: one clean search field (code button inside it); Scan beside it on wide screens, floating on phones */
.cart-toolbar { padding: .1rem 0 .65rem; margin-bottom: .1rem; }
.tc-add-search .ts-wrapper .ts-control { background: var(--tc-surface) !important; box-shadow: 0 1px 2px rgba(0, 0, 0, .04) !important; }
.tc-add-search .tc-code-toggle { position: absolute; right: .35rem; top: 50%; z-index: 3; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center;
  padding: 0; border: 0; border-radius: .55rem; background: transparent; color: var(--tc-muted); font-size: 1.15rem; }
.tc-add-search .tc-code-toggle[aria-expanded="true"], .tc-add-search .tc-code-toggle:hover { background: var(--pe-tertiary-bg); color: var(--pe-body-color); }
@media (max-width: 991.98px) { .tc-add-search .ts-wrapper .ts-control { padding-right: 2.9rem !important; } }
/* Scan sits beside the search (the bar stays pinned at the top while scrolling): a square on phones, labelled on wide screens */
@media (max-width: 991.98px) { .tc-scan-btn { width: 46px; padding: 0; justify-content: center; } .tc-scan-btn i { font-size: 1.35rem; } }
/* Search and Scan read as one row: same height, same corner radius, same light shadow (a heavy shadow made Scan look lower) */
.cart-toolbar .tc-scan-btn, .cart-toolbar .tc-scan-btn:hover, .cart-toolbar .tc-scan-btn:focus { box-shadow: 0 1px 2px rgba(0, 0, 0, .06) !important; }
.cart-toolbar .tc-scan-btn:active { transform: scale(.96); }
/* the search box's edge was nearly invisible on the light page, so it looked shorter than Scan — a clear edge makes them read equal */
.cart-toolbar .tc-add-search .ts-wrapper:not(.focus) .ts-control { border-color: #d3d8de !important; }
[data-bs-theme=dark] .cart-toolbar .tc-add-search .ts-wrapper:not(.focus) .ts-control { border-color: rgba(255, 255, 255, .16) !important; }

/* Item card: full name, details, then total + quantity */
.cart-item .card-body { padding: .85rem .9rem .75rem; }
.cart-item .thumb { width: 52px; height: 52px; }
.tc-item-name { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-item-sub { font-size: .78rem; color: var(--tc-muted); margin-top: .1rem; }
.tc-item-note { font-size: .78rem; margin-top: .3rem; color: var(--pe-body-color); }
.cart-item .tc-item-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .65rem; padding: .55rem 0 0;
  border-top: 1px dashed var(--tc-border); min-height: 0; }
.cart-item .line-amount { font-size: 1.02rem; }
.cart-item .tc-step-btn { width: 2.1rem; height: 2.1rem; }
.tc-empty-pill { display: inline-block; padding: .2rem .65rem; border-radius: 50rem; background: var(--pe-tertiary-bg); color: var(--tc-muted); font-size: .75rem; font-weight: 600; }
/* New cart: the "valid number" tick sits inside the mobile box */
.tc-newcart .input-group { position: relative; }
.tc-nc-ok { position: absolute; right: .85rem; top: 50%; z-index: 6; transform: translateY(-50%); color: var(--pe-success); font-size: 1.2rem; pointer-events: none; }
.tc-newcart #ncMobile { padding-right: 2.5rem; border-top-right-radius: var(--pe-border-radius-lg) !important; border-bottom-right-radius: var(--pe-border-radius-lg) !important; }
.tc-returning-label { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--pe-success-text-emphasis); }

/* ================= Phones & tablets: top bar in the theme colour ================= */
/* --tc-appbar-bg / -fg come from the theme palette (white or dark text, whichever reads better on the colour). */
@media (max-width: 991.98px) {
  .app-header { background: var(--tc-appbar-bg, var(--pe-primary)) !important; border-bottom: 0 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .14); }
  .app-header .tc-appbar-title h6 { color: var(--tc-appbar-fg, #fff); font-weight: 700; }
  .app-header .tc-appbar-title .fs-12, .app-header .tc-appbar-title .text-muted { color: rgba(var(--tc-appbar-fg-rgb, 255, 255, 255), .75) !important; }
  .app-header .vertical-toggle, .app-header .header-btn, .app-header .tc-appbar-back {
    background: rgba(var(--tc-appbar-fg-rgb, 255, 255, 255), .14) !important; color: var(--tc-appbar-fg, #fff) !important; border: 0 !important; box-shadow: none !important; }
  .app-header .vertical-toggle i, .app-header .header-btn i, .app-header .tc-appbar-back i { color: var(--tc-appbar-fg, #fff) !important; }
  .app-header .vertical-toggle:active, .app-header .header-btn:active, .app-header .tc-appbar-back:active { background: rgba(var(--tc-appbar-fg-rgb, 255, 255, 255), .24) !important; transform: scale(.95); }
  .app-header .tc-avatar { background: rgba(var(--tc-appbar-fg-rgb, 255, 255, 255), .22); color: var(--tc-appbar-fg, #fff); }
  .app-header .tc-bell-badge { border-color: var(--tc-appbar-bg, var(--pe-primary)); }
  /* breathing room between the bar and the page */
  .app-wrapper > .container-fluid:first-child { padding-top: .9rem; }
}

/* ================= Title Case for names of things: buttons, headings, labels, tabs, menus, placeholders ================= */
/* Only first letters change ("Create quotation" → "Create Quotation"); what people type into boxes is never touched.
   Normal text stays normal: counts, times and units ("1 h ago", "18 boxes · 279 sq.ft"), sentences (help text,
   alerts, toasts, empty states) and hints in brackets inside labels ("Rate (per sq.ft)", "Room (optional)"). */
.btn, button, label, .form-label, .form-check-label,
h1, h2, h3, h4, h5, h6, .modal-title, .card-title, .dropdown-header, .dropdown-item,
.nav-link, .tc-seg-item, .tc-chip, .badge, .cart-pill, .tc-empty-pill, th, .pe-nav-content,
.tc-cart-value-label, .tc-cart-chip,
input::placeholder, textarea::placeholder, .ts-control input::placeholder { text-transform: capitalize; }
[data-ago], .tc-plain, label .text-muted, label small, .form-label .text-muted, .form-label small,
.btn .text-muted, .btn small, .btn .fs-12, button .fs-12, .card-title .text-muted, .modal-title .text-muted, th .text-muted, th small,
.mono, .tc-no-case, code, kbd, .form-text, .alert, .toast, .tc-snack-text, .tc-notif-body, a[href^="mailto:"],
input[type="email"]::placeholder, input[type="url"]::placeholder, input[inputmode="email"]::placeholder,
input[placeholder*="@"]::placeholder, input[placeholder*="www"]::placeholder, input[placeholder*="http"]::placeholder,
input.mono::placeholder, [data-no-case]::placeholder, .tc-no-case input::placeholder, .tc-no-case textarea::placeholder { text-transform: none; }

/* Yes | No for on/off settings */
.tc-yesno .btn { min-width: 3.75rem; }

/* ================= Quick sell (POS) ================= */
.tc-pos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
@media (min-width: 992px) { .tc-pos { grid-template-columns: minmax(0, 1fr) 360px; } }
.tc-pos-head { position: sticky; top: var(--pe-app-header-height); z-index: 20; display: grid; gap: .65rem; padding: .25rem 0 .8rem; background: var(--pe-body-bg); }
.tc-pos-customer { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.tc-pos-cust-btn { display: flex; align-items: center; gap: .65rem; width: 100%; min-height: 54px; padding: .4rem .8rem .4rem .45rem; border: 1px solid var(--tc-border);
  border-radius: 14px; background: var(--tc-surface); color: var(--pe-body-color); text-align: left; text-transform: none; }
.tc-pos-cust-btn .tc-avatar { width: 40px; height: 40px; }
.tc-pos-cust-btn:hover { border-color: rgba(var(--pe-primary-rgb), .45); }
.tc-pos-cust-label { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--tc-muted); }
.tc-pos-cust-name { display: block; overflow: hidden; font-size: 1rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.tc-pos-cust-phone { font-weight: 400; color: var(--tc-muted); font-size: .875rem; }
.tc-pos-cust-menu { min-width: 16rem; max-height: 60vh; overflow-y: auto; }
.tc-pos-icon-btn { flex: none; width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--tc-border); border-radius: 14px;
  background: var(--tc-surface); color: var(--pe-body-color); font-size: 1.35rem; }
.tc-pos-icon-btn:hover { border-color: rgba(var(--pe-primary-rgb), .45); color: var(--pe-body-color); }
.tc-pos-start { min-height: 48px; border-radius: 12px; font-weight: 600; white-space: nowrap; }
.tc-pos-search > .form-control { height: 46px; }
/* suggestions under the Quick Sell search: over the tiles, the same look as the new-cart suggestions */
.tc-pos-suggest { position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 30; max-height: min(70vh, 460px); overflow-y: auto; margin-top: 0;
  scroll-padding-bottom: 50px; }   /* a row picked with the arrows stays clear of the sticky footer */
.tc-pos-sug-row { cursor: pointer; }
.tc-pos-sug-row .tc-thumb { width: 44px; height: 44px; }
.tc-pos-sug-act { flex: none; display: flex; align-items: center; gap: .35rem; }
.tc-pos-sug-btn { display: inline-flex; align-items: center; justify-content: center; gap: .2rem; height: 36px; min-width: 36px; padding: 0 .8rem; border: 0; border-radius: 10px;
  background: var(--pe-primary); color: #fff; font-size: .82rem; font-weight: 600; }
.tc-pos-sug-btn.is-plus { width: 36px; padding: 0; font-size: 1.1rem; }
.tc-pos-sug-in { display: flex; align-items: center; gap: .25rem; margin-top: .1rem; font-size: .75rem; font-weight: 600; color: var(--pe-success-text-emphasis); white-space: nowrap; }
/* stays at the foot of the list while it scrolls */
.tc-pos-sug-all { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: center; gap: .4rem; width: 100%; padding: .7rem; border: 0; border-top: 1px solid var(--tc-border);
  background: var(--tc-surface); color: var(--pe-body-color); font-size: .85rem; font-weight: 600; }
.tc-pos-sug-all:hover { background: var(--pe-tertiary-bg); }
.tc-pos-tile.is-found { animation: tc-pos-found 1.6s ease; }
@keyframes tc-pos-found { 0%, 60% { box-shadow: 0 0 0 3px var(--pe-primary); } 100% { box-shadow: none; } }
/* Prices hidden (Developer → Modules): anything marked as a price disappears */
body[data-prices="off"] [data-price-only] { display: none !important; }

/* ================= Developer → Modules ================= */
.tc-mods .list-group-item { padding: 0; }
.tc-mod-row { display: flex; align-items: center; gap: .85rem; margin: 0; padding: .8rem var(--pe-card-cap-padding-x, 1.25rem); cursor: pointer; font-weight: 400; }
.tc-mod-row:hover { background: var(--pe-tertiary-bg); }
.tc-mod-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  background: var(--pe-primary-bg-subtle); color: var(--pe-primary); font-size: 1.15rem; transition: background-color .15s, color .15s; }
.tc-mod.is-off .tc-mod-icon { background: var(--pe-tertiary-bg); color: var(--tc-muted); }
.tc-mod-name { display: flex; align-items: center; gap: .45rem; font-size: .9375rem; font-weight: 600; line-height: 1.3; }
.tc-mod-state { padding: .05rem .5rem; border-radius: 50rem; background: var(--pe-success-bg-subtle); color: var(--pe-success-text-emphasis); font-size: .68rem; font-weight: 700; }
.tc-mod.is-off .tc-mod-state { background: var(--pe-tertiary-bg); color: var(--tc-muted); }
.tc-mod-desc { display: block; margin-top: .1rem; font-size: .8125rem; line-height: 1.4; color: var(--tc-muted); }
.tc-mod-why { display: block; margin-top: .25rem; font-size: .75rem; font-weight: 600; color: var(--pe-warning-text-emphasis); }
.tc-mod-why:empty { display: none; }
.tc-mod .form-switch .form-check-input { width: 2.6em; height: 1.4em; margin: 0; cursor: pointer; }
.tc-mod.is-locked .form-check-input { opacity: .45; cursor: not-allowed; }
.tc-mod.is-nudge .tc-mod-why { animation: tc-mod-nudge .45s ease; }
@keyframes tc-mod-nudge { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.tc-mod-chip { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 50rem; background: var(--pe-tertiary-bg); font-size: .75rem; font-weight: 500; }
.tc-mods-foot { padding-inline: var(--pe-card-cap-padding-x, 1.25rem); }
@media (max-width: 575.98px) { .tc-mods-foot .btn { width: 100%; } }

/* ================= Reports: the period card ================= */
/* Phones: dates → presets (one sideways-scrolling row) → From · To · Apply. Wide screens: dates + custom range on top, presets below. */
.tc-period { display: grid; grid-template-areas: "head" "chips" "custom"; gap: .8rem; padding: 1rem; }
.tc-period-head { grid-area: head; display: flex; align-items: center; gap: .65rem; min-width: 0; }
.tc-period-head .tc-group-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 1.1rem; }
.tc-period-label { font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--tc-muted); }
.tc-period-range { font-size: .95rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.tc-period-scope { font-weight: 500; color: var(--tc-muted); }
.tc-period-chips { grid-area: chips; display: flex; gap: .45rem; min-width: 0; margin-inline: -1rem; padding-inline: 1rem; overflow-x: auto; scrollbar-width: none; }
.tc-period-chips::-webkit-scrollbar { display: none; }
.tc-period-chip { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 .95rem; border: 1px solid var(--tc-border); border-radius: 50rem;
  background: var(--tc-surface); color: var(--pe-body-color); font-size: .85rem; font-weight: 500; white-space: nowrap; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.tc-period-chip:hover { border-color: var(--pe-primary); color: var(--pe-body-color); }
.tc-period-chip.active { border-color: var(--pe-primary); background: var(--pe-primary); color: #fff; }
.tc-period-chip:active { transform: scale(.97); }
.tc-period-custom { grid-area: custom; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: .5rem; align-items: end; }
.tc-period-field { display: block; min-width: 0; margin: 0; }
.tc-period-field > span { display: block; margin-bottom: .25rem; font-size: .75rem; font-weight: 600; color: var(--tc-muted); }
.tc-period-field > .form-control { height: 42px; padding-inline: .7rem; font-size: .875rem; font-variant-numeric: tabular-nums; }
.tc-period-apply { height: 42px; padding-inline: 1.1rem; }
@media (min-width: 768px) {
  .tc-period { grid-template-areas: "head custom" "chips chips"; grid-template-columns: minmax(0, 1fr) auto; align-items: end; padding: 1rem 1.25rem; }
  .tc-period-head { align-self: center; }
  .tc-period-chips { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; }
  .tc-period-custom { grid-template-columns: 170px 170px auto; }
}
/* Phones: Scan insights and Excel share the row equally instead of sitting small at the left */
@media (max-width: 575.98px) {
  .page-header > .tc-report-actions:not(:first-child) > .btn, .page-header > .tc-report-actions:not(:first-child) > .dropdown { flex: 1 1 0; min-width: 0; }
  .tc-report-actions > .dropdown > .btn { width: 100%; }
}

.tc-pos-cats { display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .1rem; }
.tc-pos-cats::-webkit-scrollbar { display: none; }
.tc-pos-cat { flex: none; display: inline-flex; align-items: center; gap: .4rem; height: 38px; padding: 0 .9rem; border: 1px solid var(--tc-border); border-radius: 50rem;
  background: var(--tc-surface); color: var(--pe-body-color); font-size: .875rem; font-weight: 500; white-space: nowrap; }
.tc-pos-cat > i { font-size: 1rem; }
.tc-pos-cat.active { border-color: var(--pe-primary); background: var(--pe-primary); color: #fff; }
.tc-pos-cat-n { padding: .05rem .45rem; border-radius: 50rem; background: rgba(var(--pe-body-color-rgb), .08); font-size: .72rem; font-weight: 700; }
.tc-pos-cat.active .tc-pos-cat-n { background: rgba(255, 255, 255, .25); }

.tc-pos-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 576px) { .tc-pos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px) { .tc-pos-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 992px) { .tc-pos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .tc-pos-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1700px) { .tc-pos-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tc-pos-tile { position: relative; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--tc-border); border-radius: 16px;
  background: var(--tc-surface); transition: box-shadow .2s ease, border-color .2s ease; }
.tc-pos-tile.in-cart { border-color: var(--pe-primary); box-shadow: 0 0 0 1px var(--pe-primary); }
@media (hover: hover) { .tc-pos-tile:hover { border-color: rgba(var(--pe-primary-rgb), .45); box-shadow: 0 12px 26px -14px rgba(0, 0, 0, .3); } }
.tc-pos-tile.is-popping { animation: tc-pos-pop .35s ease; }
@keyframes tc-pos-pop { 40% { transform: scale(.965); } }
.tc-pos-tile-main { display: block; }
.tc-pos-img { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; padding: 0; border: 0; background: var(--tc-soft); }
.tc-pos-img.is-zoom { cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.tc-pos-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
@media (hover: hover) { .tc-pos-img.is-zoom:hover img { transform: scale(1.04); } }
.tc-pos-img-default { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(145deg, var(--tc-soft), var(--pe-tertiary-bg));
  color: var(--tc-muted); font-size: 2.6rem; }
.tc-pos-badge { position: absolute; top: .5rem; right: .5rem; min-width: 30px; height: 30px; padding: 0 .55rem; display: grid; place-items: center; border-radius: 50rem;
  background: var(--pe-primary); color: #fff; font-size: .85rem; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.tc-pos-info { display: block; padding: .65rem .75rem .2rem; }
.tc-pos-name { display: -webkit-box; min-height: 2.6em; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: .9375rem; font-weight: 600; line-height: 1.3; }
.tc-pos-sub { display: block; margin-top: .15rem; overflow: hidden; font-size: .78rem; color: var(--tc-muted); white-space: nowrap; text-overflow: ellipsis; }
.tc-pos-code { display: block; overflow: hidden; font-size: .72rem; color: var(--tc-muted); white-space: nowrap; text-overflow: ellipsis; letter-spacing: .02em; }
.tc-pos-price { display: block; margin-top: .3rem; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tc-pos-price > span { display: block; font-size: .72rem; font-weight: 500; color: var(--tc-muted); line-height: 1.2; }   /* "per sq.ft" under the amount */
.tc-pos-act { margin-top: auto; padding: .5rem .75rem .75rem; }
.tc-pos-add { display: inline-flex; align-items: center; justify-content: center; gap: .3rem; width: 100%; min-height: 40px; border: 0; border-radius: 10px;
  background: rgba(var(--pe-primary-rgb), .1); color: var(--pe-body-color); font-weight: 600; }
.tc-pos-add:hover, .tc-pos-add:focus-visible { background: var(--pe-primary); color: #fff; }
.tc-pos-step { display: flex; align-items: center; height: 40px; overflow: hidden; border-radius: 10px; background: var(--pe-primary); color: #fff; }
.tc-pos-step > button { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: inherit; font-size: 1.15rem; }
.tc-pos-step > button:active { background: rgba(255, 255, 255, .18); }
.tc-pos-step > span { flex: 1; min-width: 0; overflow: hidden; font-size: .875rem; font-weight: 700; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.tc-pos-step > span > b, .tc-pos-step > span > small { font-size: inherit; font-weight: inherit; }
/* a narrow tile (360px phones): the number over its unit, so "12 pieces" never turns into "12 pi…" */
.tc-pos-step:not(.is-sm) { container: pos-step / inline-size; }
@container pos-step (max-width: 149.98px) {
  .tc-pos-step > span { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
  .tc-pos-step > span > b { font-size: .95rem; }
  .tc-pos-step > span > small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; font-size: .6875rem; font-weight: 600; opacity: .85; }
}
.tc-pos-step.is-sm { height: 34px; width: 140px; flex: none; }
.tc-pos-step.is-sm > button { width: 34px; height: 34px; font-size: 1rem; }
.tc-pos-none { grid-column: 1 / -1; padding: 3rem 1rem; text-align: center; color: var(--pe-body-color); }
.tc-pos-none > i { display: block; margin-bottom: .5rem; font-size: 2rem; color: var(--tc-muted); }
.tc-pos-more { padding: 1.25rem 0 .5rem; text-align: center; }
.tc-pos-loading { color: var(--tc-muted); font-size: .875rem; }

/* the cart: a column beside the tiles on wide screens */
.tc-pos-cart { position: sticky; top: calc(var(--pe-app-header-height) + 1rem); display: flex; flex-direction: column; max-height: calc(100vh - var(--pe-app-header-height) - 2rem);
  overflow: hidden; border: 1px solid var(--tc-border); border-radius: 16px; background: var(--tc-surface); }
.tc-pos-cart-head { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--tc-border); }
.tc-pos-cart-head > .min-w-0 { flex: 1 1 auto; }
.tc-pos-cart-title { font-size: 1.05rem; font-weight: 700; }
.tc-pos-count { min-width: 30px; height: 30px; padding: 0 .55rem; display: grid; place-items: center; border-radius: 50rem; background: var(--pe-primary); color: #fff; font-weight: 700; font-size: .85rem; }
.tc-pos-cart-list { flex: 1 1 auto; overflow-y: auto; }
.tc-pos-line { display: flex; align-items: center; gap: .7rem; padding: .75rem 1.25rem; border-bottom: 1px solid var(--tc-border); }
.tc-pos-line > .tc-thumb { width: 46px; height: 46px; }
.tc-pos-line-name { font-size: .9rem; font-weight: 600; }
.tc-pos-line-sub { font-size: .75rem; color: var(--tc-muted); }
.tc-pos-line-amt { font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-pos-cart-empty { padding: 2rem 1.25rem; text-align: center; }
.tc-pos-cart-empty > i { display: block; margin-bottom: .4rem; font-size: 1.9rem; color: var(--tc-muted); }
.tc-pos-cart-foot { display: grid; gap: .6rem; padding: 1rem 1.25rem; border-top: 1px solid var(--tc-border); }
.tc-pos-total { display: flex; align-items: baseline; justify-content: space-between; font-weight: 600; }
.tc-pos-total > strong { font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.tc-pos-cart-foot .btn { min-height: 44px; border-radius: 10px; font-weight: 600; }
.tc-pos-bar, .tc-pos-backdrop, .tc-pos-grab { display: none; }

/* phones and tablets: a bottom bar with the total; tapping it slides the cart up as a sheet */
@media (max-width: 991.98px) {
  .tc-pos-cart { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 1046; max-height: 85vh; border-radius: 20px 20px 0 0; border-bottom: 0;
    transform: translateY(105%); transition: transform .28s ease; box-shadow: 0 -12px 32px rgba(0, 0, 0, .22); padding-bottom: env(safe-area-inset-bottom); }
  .tc-pos-cart.open { transform: none; }
  .tc-pos-grab { display: block; width: 44px; height: 5px; margin: .55rem auto 0; border-radius: 50rem; background: var(--tc-border); }
  .tc-pos-backdrop { display: block; position: fixed; inset: 0; z-index: 1045; background: rgba(0, 0, 0, .4); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .tc-pos-backdrop.open { opacity: 1; pointer-events: auto; }
  .tc-pos-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1003; display: flex; align-items: center; gap: .6rem;
    padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--tc-border); background: var(--tc-surface); box-shadow: 0 -8px 24px rgba(0, 0, 0, .08); }
  .tc-pos-bar-main { display: flex; flex: 1 1 auto; align-items: center; gap: .65rem; min-width: 0; min-height: 48px; text-transform: none; }
  button.tc-pos-bar-main:not(.btn) { padding: 0; border: 0; background: transparent; color: var(--pe-body-color); text-align: left; }
  .tc-pos-bar-main.btn { justify-content: center; border-radius: 12px; font-weight: 600; }
  .tc-pos-bar-icon { position: relative; flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--pe-tertiary-bg); font-size: 1.3rem; }
  .tc-pos-bar-badge { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 .35rem; display: grid; place-items: center; border-radius: 50rem;
    background: var(--pe-primary); color: #fff; font-size: .72rem; font-weight: 700; box-shadow: 0 0 0 2px var(--tc-surface); }
  .tc-pos-bar-go { flex: none; min-height: 48px; border-radius: 12px; font-weight: 600; padding-inline: 1rem; }
  body:has(.tc-pos-bar) .app-wrapper { padding-bottom: 6.5rem; }
  .tc-pos-cust-phone { display: none; }
}

/* Products:SimpleForm — parts of the product form that are not asked for (kept in the form so saved values stay) */
.tc-simple-hide { display: none !important; }

/* Product list (simple) and the selection: the display location as a small tag */
.tc-design-table .tc-place, .tc-sel-table .tc-place { padding: .2rem .6rem; white-space: nowrap; letter-spacing: .02em; }

/* Product form: the display location in capitals; the design's PDF */
.tc-caps { text-transform: uppercase; letter-spacing: .02em; }
.tc-pdf-row { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border: 1px solid var(--tc-border); border-radius: 12px; background: var(--tc-surface); }
.tc-pdf-row.is-removed { border-style: dashed; color: var(--tc-muted); }
.tc-pdf-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--tc-pdf-bg); color: var(--tc-pdf); font-size: 1.25rem; }
.tc-pdf-add { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 72px; padding: .75rem; border: 1.5px dashed var(--tc-border);
  border-radius: 12px; background: transparent; color: var(--tc-muted); font-weight: 500; }
.tc-pdf-add:hover, .tc-pdf-add:focus-visible { border-color: var(--tc-pdf); color: var(--tc-pdf); background: var(--tc-pdf-bg); }
.tc-pdf-add i { font-size: 1.4rem; }
@media (max-width: 575.98px) { .tc-pdf-row { flex-wrap: wrap; } .tc-pdf-row > .flex-grow-1 { flex-basis: calc(100% - 52px); } }

/* Searchable dropdowns matched to the Fabkin theme (its form inputs, dropdown menus and select boxes) */
.ts-wrapper.form-select { min-height: 0; }
.ts-wrapper.form-select.single .ts-control, .ts-wrapper.form-select.single.input-active .ts-control { min-height: calc(1.5em + 1rem); padding: .5rem 2.7rem .5rem .9rem; font-size: .875rem; }
.ts-wrapper.form-select-sm.single .ts-control { min-height: calc(1.5em + .5rem); }
.ts-wrapper.form-select-lg.single .ts-control { min-height: calc(1.5em + 1.4rem); }
.ts-wrapper.form-select { background-color: var(--pe-secondary-bg); border-color: var(--pe-border-color); transition: border-color .15s ease-in-out; }
.ts-wrapper.form-select.focus, .ts-wrapper.form-select.dropdown-active { border-color: var(--pe-primary) !important; box-shadow: none !important; }
.ts-dropdown { margin-top: .25rem; border: 1px solid var(--pe-border-color); border-radius: .3125rem; box-shadow: 0 4px 24px 0 rgba(62, 57, 107, .18);
  background: var(--pe-secondary-bg) !important; }
[data-bs-theme=dark] .ts-dropdown { box-shadow: 0 4px 24px 0 rgba(0, 0, 0, .45); }
.ts-dropdown .ts-dropdown-content { padding: .5rem; }
.ts-dropdown .option { padding: .5rem 1rem; border-radius: .3125rem; font-size: .875rem; line-height: 1.5; color: var(--pe-body-color); }
.ts-dropdown .option.active { background: rgba(var(--pe-primary-rgb), .1); color: var(--pe-primary); }
.ts-dropdown .option.selected { background: var(--pe-primary); color: #fff; font-weight: 500; }
.ts-dropdown .option.selected.active { background: var(--pe-primary); color: #fff; filter: brightness(.95); }
.ts-dropdown .option.selected::after { content: "\eb7b"; font-family: "remixicon", sans-serif; font-weight: normal; float: right; margin-left: .75rem; }
.ts-dropdown .dropdown-input-wrap { padding: .5rem .5rem 0; border-bottom: 0; }
.ts-dropdown .dropdown-input { padding: .5rem .9rem .5rem 2.1rem; border: 1px solid var(--pe-border-color); border-radius: var(--pe-border-radius);
  background-color: var(--pe-secondary-bg); font-size: .8125rem; background-position: .7rem center; }
.ts-dropdown .dropdown-input:focus, .plugin-dropdown_input.focus .ts-dropdown .dropdown-input { border-color: var(--pe-primary) !important; box-shadow: none !important; }
.ts-dropdown .no-results { padding: .5rem 1rem; }

/* Sign-in code (Security:LoginOtp): six big, evenly spaced digits */
.tc-otp-input { font-size: 1.75rem !important; font-weight: 600; letter-spacing: .6em; padding-left: 1.2em !important; font-variant-numeric: tabular-nums; }
.tc-otp-input::placeholder { letter-spacing: .6em; text-transform: none; }

/* Quotation page: the totals row under the items (boxes, quantity, weight) */
.tc-q-totals td, li.tc-q-totals { background: var(--pe-tertiary-bg); border-top: 2px solid var(--pe-border-color); }

/* Selection cards: the firm under the customer's name */
.tc-cart-firm { font-size: .8125rem; font-weight: 600; color: var(--pe-body-color); opacity: .8; }

/* ---------------- Catalogs: builder, layout designer, PDF preview ---------------- */
.tc-layout-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.tc-layout-cards .tc-choice-card { height: 100%; padding: .8rem .9rem; }
.tc-catalog-items { max-height: 60vh; overflow-y: auto; }
.tc-catalog-item { padding-top: .5rem; padding-bottom: .5rem; }
.tc-catalog-item .tc-drag { cursor: grab; font-size: 1.1rem; }
.tc-catalog-item.is-dragging { opacity: .45; }
.tc-catalog-item .btn-group .btn { padding: .2rem .4rem; }
.tc-field-list .list-group-item { padding-top: .45rem; padding-bottom: .45rem; }
.tc-field-list .btn-group .btn { padding: .15rem .4rem; }
.tc-pdf-frame { position: relative; height: 75vh; min-height: 420px; background: var(--tc-soft); border-radius: 0 0 var(--bs-card-inner-border-radius, .75rem) var(--bs-card-inner-border-radius, .75rem); overflow: hidden; }
.tc-pdf-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.tc-pdf-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .5rem; color: var(--tc-muted); text-align: center; padding: 1rem; }
.tc-pdf-empty i { font-size: 2.5rem; opacity: .6; }
@media (min-width: 1200px) { .tc-sticky-preview { position: sticky; top: calc(var(--pe-app-header-height) + 16px); } }
@media (max-width: 767.98px) { .tc-pdf-frame { height: 60vh; } .tc-layout-cards { grid-template-columns: 1fr 1fr; } }
.tc-check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .35rem 1rem; }

/* ---------------- catalogue layout designer: pages · the page · settings ---------------- */
.tc-designer-name { font-size: 1.15rem; font-weight: 600; max-width: 460px; }
.tc-designer { display: grid; grid-template-columns: 170px minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.tc-designer-pages, .tc-designer-panel { position: sticky; top: calc(var(--pe-app-header-height) + 16px); max-height: calc(100vh - var(--pe-app-header-height) - 32px); }
.tc-designer-pages { display: flex; flex-direction: column; }
.tc-designer-panel { overflow-y: auto; }
@media (max-width: 1199.98px) {
  .tc-designer { grid-template-columns: 160px minmax(0, 1fr); }
  .tc-designer-panel { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 767.98px) {
  .tc-designer { grid-template-columns: minmax(0, 1fr); }
  .tc-designer-pages { position: static; max-height: none; }
  .tc-pthumbs { flex-direction: row !important; overflow-x: auto; }
  .tc-pthumb { width: 116px; flex: none; }
}

/* names typed by people, shown as they were typed (the app title-cases buttons) */
.tc-layers .list-group-item, .tc-pthumb-sheet, .tc-pthumb-sheet * { text-transform: none; }

/* the pages */
.tc-pthumbs { list-style: none; margin: 0; padding: .7rem; overflow-y: auto; flex: 1 1 auto; display: flex; flex-direction: column; gap: .7rem; }
.tc-pthumb-sheet { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--tc-border); border-radius: .3rem; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08); cursor: pointer; }
.tc-pthumb-sheet .tc-el { cursor: pointer; }
.tc-pthumb-sheet .tc-el:hover { outline: none; }
.tc-pthumb.is-current .tc-pthumb-sheet { outline: 2px solid var(--pe-primary); outline-offset: 2px; }
.tc-pthumb.is-dragging { opacity: .4; }
.tc-pthumb-meta { display: flex; align-items: center; gap: .3rem; font-size: .75rem; margin-top: .35rem; min-width: 0; }
.tc-pthumb-num { flex: none; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--tc-soft); display: grid; place-items: center; font-weight: 600; color: var(--tc-muted); font-size: .68rem; }
.tc-pthumb.is-current .tc-pthumb-num { background: var(--pe-primary); color: #fff; }
.tc-pthumb-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-pthumb { position: relative; }
.tc-pthumb-actions { position: absolute; top: 4px; right: 4px; display: none; flex-direction: column; gap: 2px; z-index: 2; }
.tc-pthumb:hover .tc-pthumb-actions, .tc-pthumb.is-current .tc-pthumb-actions { display: flex; }
.tc-pthumb-actions button { width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 1px solid var(--tc-border); border-radius: 5px;
  background: var(--tc-surface); color: var(--tc-muted); font-size: .8rem; line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.tc-pthumb-actions button:disabled { display: none; }
.tc-pthumb-actions button:hover:not(:disabled) { color: var(--pe-primary); border-color: var(--pe-primary); }
@media (hover: none) { .tc-pthumb.is-current .tc-pthumb-actions { display: flex; } }

/* the page being designed */
.tc-designer-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.tc-designer-toolbar .btn { display: inline-flex; align-items: center; gap: .3rem; }
.tc-tool-label { font-size: .8rem; }
@media (max-width: 1499.98px) { .tc-tool-label { display: none; } }
.tc-stage { position: relative; display: flex; justify-content: center; align-items: flex-start; min-height: 420px; padding: 16px; overflow: auto;
  border: 1px solid var(--tc-border); border-radius: .75rem;
  background: var(--tc-soft) radial-gradient(circle, rgba(0, 0, 0, .07) 1px, transparent 1px) 0 0 / 16px 16px; }
.tc-dpage { position: relative; flex: none; background: #fff; overflow: hidden; outline: none; touch-action: none; user-select: none;
  box-shadow: 0 8px 28px -10px rgba(0, 0, 0, .4), 0 0 0 1px rgba(0, 0, 0, .06); }
.tc-el { position: absolute; cursor: move; }
.tc-el img { display: block; width: 100%; height: 100%; pointer-events: none; }
.tc-el-fill { width: 100%; height: 100%; }
.tc-el-text { display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; line-height: 1.2; white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-el-empty { opacity: .35; font-style: italic; }
.tc-dpage .tc-el:hover { outline: 1px dashed rgba(var(--pe-primary-rgb), .75); }
.tc-dpage .tc-el.is-selected:hover { outline: none; }
.tc-el-ph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; width: 100%; height: 100%; overflow: hidden;
  border: 1px dashed #b8c0ca; background: rgba(243, 244, 246, .75); color: #8a94a1; font-size: .68rem; line-height: 1.15; text-align: center; padding: 2px; }
.tc-el-ph i { font-size: 1.5em; }
.tc-el-qr i { font-size: 2.6em; }
.tc-el-qr.is-missing { opacity: .55; }
/* a design photo: one of the catalogue's designs, picked at random (marked with a shuffle sign), its name on a dark band if asked */
.tc-el-caption { position: absolute; left: 0; right: 0; bottom: 0; overflow: hidden; background: rgba(30, 38, 48, .65); color: #fff;
  font-weight: 600; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; }
.tc-el-random { position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--pe-primary); font-size: .75rem; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); pointer-events: none; }
.tc-pthumbs .tc-el-random, .tc-lp .tc-el-random { display: none; }
.tc-addpage-sheet .tc-el-random { top: 2px; left: 2px; width: 13px; height: 13px; font-size: .5rem; }
.tc-el-design { border-style: solid; background: repeating-linear-gradient(135deg, rgba(243, 244, 246, .9) 0 8px, rgba(229, 231, 235, .9) 8px 16px); }
/* a product card (a designs page of your own): photo above / beside the details, or the photo alone with the name across it */
.tc-card { position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden; }
.tc-card.has-border { border: 1px solid #dde2e8; background: #fff; }
.tc-card.is-beside { flex-direction: row; align-items: stretch; }
.tc-card-photo { position: relative; flex: none; display: grid; place-items: center; overflow: hidden; background: #f3f4f6; color: #9aa3ad; }
.tc-card-photo img { position: absolute; inset: 0; width: 100%; height: 100%; }
.tc-card-text { display: flex; align-items: flex-start; gap: .4em; flex: 1 1 auto; min-width: 0; min-height: 0; overflow: hidden; line-height: 1.3; }
.tc-card.is-beside .tc-card-text { align-items: center; }
.tc-card-lines { display: flex; flex-direction: column; gap: .12em; flex: 1 1 auto; min-width: 0; }
.tc-card-lines b { display: block; line-height: 1.2; overflow-wrap: anywhere; }
.tc-card-lines span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-card-lines i { font-style: normal; color: #6b7785; }
.tc-card-qr { flex: none; aspect-ratio: 1; display: grid; place-items: center; align-self: center; border: 1px dashed #b8c0ca; color: #8a94a1; }
.tc-card-num { position: absolute; top: 4px; left: 4px; min-width: 20px; height: 20px; padding: 0 5px; display: grid; place-items: center; border-radius: 10px;
  background: var(--pe-primary); color: #fff; font-size: .68rem; font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); pointer-events: none; }
.tc-pthumb-sheet .tc-card-num { display: none; }
.tc-sel { position: absolute; pointer-events: none; border: 1.5px solid var(--pe-primary); box-shadow: 0 0 0 1px rgba(255, 255, 255, .8); }
.tc-h { position: absolute; width: 10px; height: 10px; transform: translate(-50%, -50%); pointer-events: auto; background: #fff; border: 1.5px solid var(--pe-primary); border-radius: 2px; }
@media (pointer: coarse) { .tc-h { width: 20px; height: 20px; border-radius: 50%; } }
.tc-h-nw { left: 0; top: 0; cursor: nwse-resize; }      .tc-h-n { left: 50%; top: 0; cursor: ns-resize; }
.tc-h-ne { left: 100%; top: 0; cursor: nesw-resize; }   .tc-h-e { left: 100%; top: 50%; cursor: ew-resize; }
.tc-h-se { left: 100%; top: 100%; cursor: nwse-resize; } .tc-h-s { left: 50%; top: 100%; cursor: ns-resize; }
.tc-h-sw { left: 0; top: 100%; cursor: nesw-resize; }   .tc-h-w { left: 0; top: 50%; cursor: ew-resize; }
.tc-guide { position: absolute; pointer-events: none; background: #e83e8c; z-index: 5; }
.tc-guide-v { top: 0; bottom: 0; width: 1px; }
.tc-guide-h { left: 0; right: 0; height: 1px; }
.tc-dpage-empty { position: absolute; inset: 18% 12%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; padding: 1rem;
  border: 2px dashed var(--tc-border); border-radius: .75rem; color: var(--tc-muted); text-align: center; pointer-events: none; font-size: .9rem; }
.tc-dpage-empty i { font-size: 2.2rem; }
.tc-designer-tip { min-height: 1.3em; margin-top: .5rem; font-size: .78rem; color: var(--tc-muted); text-align: center; }
.tc-zoom { position: absolute; right: 12px; bottom: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }

/* the designs page: a sketch of where the products go */
.tc-dpage.is-products { cursor: default; }
.tc-prod { position: absolute; inset: 0; display: flex; flex-direction: column; font-size: 10px; }
.tc-prod-head { display: flex; align-items: center; gap: 6%; flex: none; border-bottom: 2px solid; }
.tc-prod-head b { width: 12%; height: 55%; border-radius: 2px; opacity: .85; }
.tc-prod-head i, .tc-prod-foot i, .tc-prod-card i, .tc-prod-row span { display: block; background: #dde2e8; border-radius: 99px; }
.tc-prod-head i { width: 24%; height: 18%; }
.tc-prod-band { flex: none; margin-top: 2.5%; border-radius: 2px; }
.tc-prod-grid { flex: 1 1 auto; display: grid; min-height: 0; margin: 2.5% 0; }
.tc-prod-card { display: flex; flex-direction: column; gap: 5%; min-height: 0; overflow: hidden; padding: 4%; border: 1px solid #e4e8ed; border-radius: 3px; }
.tc-prod-card b { flex: 1 1 auto; min-height: 0; background: #eef1f4; border-radius: 2px; }
.tc-prod-card div { display: flex; flex-direction: column; gap: 6px; flex: none; }
.tc-prod-card i { height: 5px; }
.tc-prod-card.is-list { flex-direction: row; align-items: center; }
.tc-prod-card.is-list b { flex: 0 0 30%; height: 90%; }
.tc-prod-card.is-list div { flex: 1 1 auto; }
.tc-prod-grid.is-table { gap: 0 !important; }
.tc-prod-row { display: flex; align-items: center; gap: 5%; padding: 0 2%; border-bottom: 1px solid #e4e8ed; }
.tc-prod-row span { flex: 1 1 0; height: 5px; }
.tc-prod-foot { display: flex; align-items: center; flex: none; border-top: 1px solid #e4e8ed; }
.tc-prod-foot i { width: 40%; height: 4px; }
.tc-pthumb-sheet .tc-prod-card div { gap: 2px; }
.tc-pthumb-sheet .tc-prod-card i, .tc-pthumb-sheet .tc-prod-row span { height: 2px; }
.tc-prod-note { position: absolute; left: 10%; right: 10%; top: 36%; display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 1rem;
  background: rgba(255, 255, 255, .96); border: 1px solid var(--tc-border); border-radius: .75rem; box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .3);
  color: var(--pe-body-color); font-size: .85rem; text-align: center; }
.tc-prod-note i { font-size: 1.7rem; color: var(--pe-primary); }
[data-bs-theme=dark] .tc-prod-note { background: rgba(33, 37, 41, .96); }

/* settings */
.tc-panel-tabs { padding: 0 .5rem; }
.tc-panel-tabs .nav-link { padding: .65rem .85rem; }
.tc-empty-panel { padding: 1rem .5rem; color: var(--tc-muted); text-align: center; font-size: .9rem; }
.tc-empty-panel i { display: block; margin-bottom: .4rem; font-size: 2rem; }
.tc-layers .list-group-item { padding: .35rem .6rem; font-size: .8rem; }
.tc-item-pic { padding: .4rem; background: var(--tc-soft); border-radius: .5rem; text-align: center; }
.tc-item-pic img { max-width: 100%; max-height: 140px; }
.tc-layout-cards-xs { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.tc-layout-cards-xs .tc-choice-card { padding: .5rem .6rem; text-align: center; }
.tc-layout-cards-xs .tc-choice-icon { margin: 0 auto .15rem; }
.tc-check-grid-1 { grid-template-columns: 1fr; }

/* import: choose PDF pages */
.tc-pdf-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; }
.tc-pdf-pick-page { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .5rem; cursor: pointer;
  border: 1px solid var(--tc-border); border-radius: .5rem; font-size: .8rem; }
.tc-pdf-pick-page canvas { max-width: 100%; height: auto; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.tc-pdf-pick-page input { position: absolute; top: .5rem; left: .5rem; }
.tc-pdf-pick-page:has(input:checked) { border-color: var(--pe-primary); box-shadow: 0 0 0 3px var(--pe-primary-bg-subtle); }
.tc-pdf-frame-modal { height: 80vh; border-radius: 0 0 var(--bs-modal-inner-border-radius) var(--bs-modal-inner-border-radius); }

/* a layout's pages drawn small: the layouts list and the layout picker */
.tc-lp { display: flex; gap: .55rem; overflow-x: auto; padding: .75rem; background: var(--tc-soft); scrollbar-width: thin; }
.tc-lp-page { position: relative; flex: none; display: block; overflow: hidden; border-radius: 2px; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.tc-lp-page .tc-el { cursor: inherit; }
.tc-lp, .tc-lp * { text-transform: none; }
.tc-layout-card .tc-lp { align-items: center; gap: 9px; height: 196px; padding: 12px; border-radius: var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0; }
.tc-layout-card .tc-lp-page { box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .05); }
/* centred while they fit; a long strip still scrolls from its first page */
.tc-layout-card .tc-lp-page:first-child { margin-left: auto; }
.tc-layout-card .tc-lp-page:last-child { margin-right: auto; }
.tc-layout-card .card-body { padding: 1.1rem 1.25rem; }
.tc-layout-card .card-body > .d-flex .fw-semibold { font-size: 1.02rem; }
.tc-layout-card .card-body .fs-12 { font-size: .82rem !important; }
@media (max-width: 575.98px) { .tc-layout-card .tc-lp { height: 180px; padding: 10px; gap: 8px; } }
.tc-layout-card .tc-lp:hover { background: var(--pe-primary-bg-subtle); }
.tc-layout-choice { padding: 0 !important; overflow: hidden; }
.tc-layout-choice .tc-lp { padding: .55rem; gap: .4rem; min-height: 100px; }
.tc-layout-choice-body { display: block; padding: .55rem .75rem .65rem; }
.tc-layout-cards-wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* the catalogues list: a card per catalogue — its cover (the PDF's first page, drawn small) beside its first designs' photos */
.tc-cat-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.tc-cat-toolbar .tc-search-field { min-width: 220px; }
.tc-cat-count { margin-left: auto; font-size: .82rem; color: var(--tc-muted); white-space: nowrap; }
.tc-cat-card { overflow: hidden; transition: box-shadow .15s, transform .15s; }
.tc-cat-card:hover { box-shadow: 0 10px 28px -14px rgba(0, 0, 0, .35); }
.tc-cat-cover { position: relative; display: flex; align-items: stretch; gap: 14px; height: 310px; padding: 18px; background: var(--tc-soft);
  border-radius: var(--bs-card-inner-border-radius) var(--bs-card-inner-border-radius) 0 0; overflow: hidden; }
@media (max-width: 575.98px) { .tc-cat-cover { height: 250px; padding: 14px; gap: 10px; } }
.tc-cat-cover.is-plain { justify-content: center; }
.tc-cat-cover:hover { background: var(--pe-primary-bg-subtle); }
.tc-cat-page { flex: none; display: flex; align-items: center; }   /* as tall as the cover; the page is drawn to fit it */
.tc-cat-page .tc-lp-page { box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .05); }
.tc-cat-page, .tc-cat-page * { text-transform: none; }
.tc-cat-page .tc-el, .tc-cat-page .tc-el-random { cursor: inherit; }
.tc-cat-page .tc-el-random { display: none; }
.tc-cat-designs { flex: 1 1 auto; min-width: 0; align-self: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 6px; }
.tc-cat-design { position: relative; display: block; overflow: hidden; border-radius: 8px; background: #e9ecef; }
.tc-cat-design img { width: 100%; height: 100%; object-fit: cover; }
.tc-cat-more { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(30, 38, 48, .55); color: #fff; font-weight: 700; font-size: 1.25rem; }
.tc-cat-card .card-body { padding: 1.1rem 1.25rem; }
.tc-cat-card .card-body .fs-12 { font-size: .82rem !important; }
.tc-cat-card .badge { font-size: .78rem; padding: .38em .65em; }
.tc-cat-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 1.08rem; font-weight: 600; line-height: 1.3; margin-bottom: .25rem; }
.tc-cat-title:hover { color: var(--pe-primary) !important; }

/* the catalogue builder: choose designs (a grid of photos), then the designs in the catalogue, in order */
.tc-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; max-height: 460px; overflow-y: auto; padding: 2px; }
.tc-pick { position: relative; display: flex; flex-direction: column; gap: .1rem; padding: .35rem .35rem .5rem; text-align: left; color: var(--pe-body-color);
  border: 1px solid var(--tc-border); border-radius: .65rem; background: var(--tc-surface); transition: border-color .15s, box-shadow .15s; }
.tc-pick:hover { border-color: var(--pe-primary-border-subtle); }
.tc-pick.is-picked { border-color: var(--pe-primary); box-shadow: 0 0 0 2px var(--pe-primary-bg-subtle); }
.tc-pick-photo { display: grid; place-items: center; aspect-ratio: 1; margin-bottom: .3rem; overflow: hidden; border-radius: .45rem; background: var(--tc-soft);
  color: var(--tc-muted); font-size: 1.5rem; }
.tc-pick-photo img { width: 100%; height: 100%; object-fit: cover; }
.tc-pick-name { font-size: .8rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tc-pick-meta { font-size: .7rem; color: var(--tc-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-pick-check { position: absolute; top: .55rem; right: .55rem; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, .15); background: rgba(255, 255, 255, .92); color: transparent; font-size: .85rem; }
.tc-pick.is-picked .tc-pick-check { border-color: var(--pe-primary); background: var(--pe-primary); color: #fff; }
.tc-pick-empty { grid-column: 1 / -1; padding: 1.75rem 1rem; text-align: center; color: var(--tc-muted); }
.tc-pick-empty i { display: block; margin-bottom: .35rem; font-size: 1.8rem; }
@media (max-width: 575.98px) {
  .tc-pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; max-height: 420px; }
  .tc-pick { padding: .25rem .25rem .4rem; }
  .tc-pick-name { font-size: .74rem; }
  .tc-pick-meta { display: none; }
  .tc-pick-check { top: .4rem; right: .4rem; width: 20px; height: 20px; }
}

/* add a page: blank, imported, a copy — or a ready-made page, drawn small */
.tc-addpage-start { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.tc-addpage-option, .tc-addpage-card { display: flex; flex-direction: column; align-items: stretch; text-align: left; color: var(--pe-body-color);
  border: 1px solid var(--tc-border); border-radius: .75rem; background: var(--tc-surface); transition: border-color .15s, box-shadow .15s; }
.tc-addpage-option { gap: .5rem; padding: .8rem .9rem; }
.tc-addpage-option i { font-size: 1.4rem; line-height: 1; color: var(--pe-primary); }
.tc-addpage-option strong { display: block; font-size: .88rem; }
.tc-addpage-option span span { display: block; margin-top: .1rem; font-size: .78rem; color: var(--tc-muted); }
.tc-addpage-option:hover:not(:disabled), .tc-addpage-card:hover, .tc-addpage-option:focus-visible, .tc-addpage-card:focus-visible {
  border-color: var(--pe-primary); box-shadow: 0 0 0 3px var(--pe-primary-bg-subtle); outline: none; }
.tc-addpage-option:disabled { opacity: .55; cursor: not-allowed; }
.tc-addpage-ready { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem .85rem; }
.tc-addpage-card { gap: .2rem; padding: .55rem .55rem .65rem; }
.tc-addpage-label { margin-top: .4rem; font-size: .85rem; font-weight: 600; }
.tc-addpage-hint { font-size: .75rem; line-height: 1.35; color: var(--tc-muted); }
@media (max-width: 575.98px) {
  .tc-addpage-start { grid-template-columns: minmax(0, 1fr); gap: .5rem; }
  .tc-addpage-option { flex-direction: row; align-items: center; padding: .65rem .8rem; }
  .tc-addpage-ready { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* PDF loader (site.js TC.showBusy): covers the page while a PDF is being made */
.tc-busy { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; padding: 16px;
  background: rgba(var(--pe-body-bg-rgb, 255, 255, 255), .72); backdrop-filter: blur(2px); }
.tc-busy.show { display: flex; }
.tc-busy-card { background: var(--pe-body-bg); border: 1px solid var(--tc-border); border-radius: 14px; padding: 26px 34px; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12); max-width: 320px; }
.tc-busy-card .spinner-border { width: 2.4rem; height: 2.4rem; }
