/* Manrope (SIL Open Font License, see static/fonts/OFL.txt), self-hosted
   because the CSP allows fonts from this origin only. */
@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope-latin-wght.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #0e2648;
  --panel: #173460;
  --text: #e8e9ec;
  --muted: #8d9bb6;
  --accent: #f8c257;
  --danger: #ff5470;
  /* Shrinks on narrow phones instead of eating the whole screen when open;
     stays a fixed 260px everywhere wider. Used by .product-sidebar,
     body.sidebar-open #app-root, and .catalog-toggle-btn.open together so
     the three always agree on how much room the sidebar actually takes. */
  --sidebar-width: min(260px, 85vw);
  --users-sidebar-width: min(320px, calc(100vw - 64px));
  --site-nav-height: 62px;
  --fullscreen-products-width: min(190px, 20vw);
  --fullscreen-tools-width: min(160px, 18vw);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #26446f;
}

.app-header h1 {
  margin: 0;
  font-size: 1.25rem;
}

/* Acts as a "home" link back to the saved-quotes dashboard (see
   list_quotes in app.py) — plain text color/weight so it doesn't read as
   a typical blue underlined link, just a subtle hover to show it's
   clickable. */
.app-title-link {
  color: inherit;
  text-decoration: none;
}

.app-title-link:hover {
  color: var(--accent);
}

/* Who and where the quote being built is for — a slim bar pinned directly
   under the builder's header (see index.html), visible in both the editor
   and Review views so the name/address are never out of sight
   while placing fixtures. */
.quote-details-bar {
  /* Positioned + raised so the Address suggestion popovers
     (.directory-suggestions / .directory-prompt, which live inside this
     bar's stacking context — the glass backdrop-filter below creates one)
     paint over the photo stage that follows, but still under the fixed
     product sidebar (300) and every modal (500+). */
  position: relative;
  z-index: 45;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  border-bottom: 1px solid #26446f;
  background: var(--panel);
}

/* The builder's autosave read-out, at the end of the quote details bar.
   Deliberately understated — it's reassurance, not a control. Goes amber
   only when a save has actually failed. */
.autosave-status {
  align-self: center;
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.autosave-status.failed {
  color: #f6c453;
}

.quote-details-bar label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 220px;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.quote-details-bar input {
  flex: 1;
  min-width: 0;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid #26446f;
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
}

.quote-details-bar input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Address prediction (directory.js): the input is wrapped in a
   positioning container so the suggestion list and the "did you mean …?"
   prompt can float directly under it, over whatever's below the bar. */
.directory-field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}

.directory-field input {
  width: 100%;
}

.directory-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #26446f;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.directory-suggestion {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  white-space: normal;
}

.directory-suggestion:hover,
.directory-suggestion.active {
  background: rgba(248, 194, 87, 0.16);
}

.directory-suggestion-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.directory-suggestion-meta {
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.directory-prompt {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 60;
  min-width: min(100%, 220px);
  max-width: min(420px, 90vw);
  padding: 0.55rem 0.7rem;
  border: 1px solid #26446f;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  font-size: 0.8rem;
  color: var(--text);
  white-space: normal;
  line-height: 1.35;
}

.directory-prompt-note {
  color: var(--muted);
}

.directory-prompt-ask {
  border-color: rgba(248, 194, 87, 0.55);
}

.directory-prompt-ask strong {
  color: var(--accent);
}

.directory-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.directory-prompt-btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.6rem;
}

/* The generated quote ID, shown as a small secondary line under a
   human-given quote name — in the page heading (quote.html) and in the
   saved-quotes table (quotes_list.html) alike, so the ID stays visible
   (e.g. for support/lookup purposes) without competing with the name. */
.quote-id-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}

/* The address line under the quote page's heading, so whoever opens a
   saved quote sees where it's for without scrolling. */
.quote-for-sub {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}

/* A quote's stage (see QUOTE_STAGES in app.py) — shown next to the quote
   name/title and in every quotes table (quotes_list.html). */
.quote-status-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.quote-status-badge.paid-full {
  background: rgba(59, 178, 111, 0.18);
  color: #4ade80;
}

.quote-status-badge.paid-partial {
  background: rgba(255, 165, 59, 0.18);
  color: #ffa53b;
}

.quote-status-badge.paid-none {
  background: rgba(160, 170, 166, 0.18);
  color: var(--muted);
}

/* Paid in full *and* shipped/handed off (see QUOTE_STAGES in app.py) — a
   distinct color from paid-full so "money's in" and "the whole job is
   done" don't read the same at a glance. */
.quote-status-badge.stage-completed {
  background: rgba(248, 194, 87, 0.18);
  color: var(--accent);
}

.quote-status-badge.stage-invoice {
  background: rgba(167, 112, 239, 0.2);
  border-color: rgba(196, 155, 255, 0.3);
  color: #cda7ff;
}

/* "$X paid of $Y" line under the quote page's header toolbar (see
   quote-stage-btn/quote-stage-badge in quote.html) — kept in sync with the
   stage modal by quote.js. */
.quote-payment-summary {
  margin: 0.5rem 0 0;
  font-weight: 600;
  color: var(--muted);
}

/* Dashboard sections on /quotes (quotes_list.html): the two "needs
   follow-up" lists plus the full list underneath. */
.dashboard-section {
  margin-bottom: 2.5rem;
}

.dashboard-section h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

/* The count badge that follows a heading ("Locations 3", "Quotes 12").
   Spaced off the word and centered on the text's midline everywhere it's
   used — inline in a card h3, a page h1, or a flex section heading (where
   the parent's gap already separates it, so the margin is zeroed there). */
.dashboard-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  margin-left: 0.5rem;
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  vertical-align: middle;
  position: relative;
  top: -0.08em;
}

.dashboard-section h2 .dashboard-section-count {
  margin-left: 0;
  top: 0;
}

.dashboard-section-hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}

/* The ▸/▾ prefix already signals it's expandable/collapsible — plain text
   color rather than the usual blue underlined link look. */
.dashboard-section-title-link {
  color: var(--text);
  text-decoration: none;
}

.dashboard-section-title-link:hover {
  color: var(--accent);
}

.dashboard-section-more {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

.dashboard-section-more a {
  color: var(--accent);
}

.dashboard-pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.dashboard-pagination-label {
  font-size: 0.82rem;
  color: var(--muted);
}

.quote-notes {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--panel);
  border-radius: 10px;
}

.quote-notes strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.quote-notes p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.toolbar {
  display: flex;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: 1px solid #26446f;
  background: var(--panel);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
}

/* Form controls don't inherit the page font by default. */
button,
input,
select,
textarea {
  font-family: inherit;
}

.btn:hover {
  border-color: var(--accent);
}

/* Needed explicitly: at equal specificity a plain [hidden] (the browser's
   own default) loses to .btn's own `display: inline-flex` above, so
   setting .hidden on a .btn (e.g. #scene-measure-undo-btn, shown/hidden
   per-click by waitForModelClick in main.js) would silently fail to
   actually hide it without this override — same issue already hit and
   fixed for .scene-fixture-hud-btn below. */
.btn[hidden] {
  display: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Admin-only destructive actions (deleting a quote) — a distinct color so
   it doesn't sit next to Edit/Save looking like just another neutral
   action. Regular users never see a button with this class at all (see
   quotes_list.html/quote.html), so it's never a trap for them to avoid. */
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  border-color: #fff;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 1.5rem;
  background: #0c2445;
  border-bottom: 1px solid #26446f;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Goes back to the saved-quotes dashboard (see list_quotes in app.py) —
   shown on every logged-in page (this bar lives in base.html, not any one
   page's own template) so there's always a way back to it, not just from
   the main editor's own title. */
.user-bar-home-link {
  color: var(--muted);
  text-decoration: none;
}

.user-bar-home-link:hover {
  color: var(--accent);
}

/* Pushes itself (and everything after it — the logout form) flush right,
   leaving the home link alone on the left, without needing
   justify-content: space-between on the row (which would space *every*
   child apart evenly instead of just grouping these two on one side). */
.user-bar-info {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-bar-role {
  text-transform: capitalize;
  color: var(--accent);
}

.user-bar .link-btn {
  font-size: 0.8rem;
}

.edit-mode-banner {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--accent);
}

.login-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  width: min(90vw, 340px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
  background: var(--panel);
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  text-align: center;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.login-card input {
  padding: 0.55rem;
  border-radius: 6px;
  border: 1px solid #26446f;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.login-card .btn {
  justify-content: center;
  margin-top: 0.25rem;
}

.login-error {
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  background: rgba(255, 84, 112, 0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
  font-size: 0.85rem;
}

.login-success {
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(73, 217, 138, 0.6);
  border-radius: 8px;
  background: rgba(73, 217, 138, 0.12);
  color: #79e8aa;
  font-size: 0.85rem;
  line-height: 1.4;
}

.login-intro {
  margin: -0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  text-align: center;
}

.login-secondary {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.login-secondary .btn,
.login-back-link {
  justify-content: center;
}

.login-back-link {
  color: var(--accent);
  font-size: 0.82rem;
  text-align: center;
}

.admin-users-page {
  /* Wide enough that the nine-column users table fits without a
     horizontal scrollbar on a normal desktop window. */
  width: min(1600px, calc(100% - 2rem));
  margin: 2rem auto 4rem;
}

.admin-users-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-users-header h1,
.admin-users-header p {
  margin: 0;
}

.admin-users-header h1 {
  margin: 0.25rem 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.admin-users-header > div > p:last-child {
  color: var(--muted);
}

.admin-users-table-wrap {
  /* No horizontal scrollbar: the table below is laid out to always fit
     (tight cells, wrapping actions/emails), so hidden only clips the
     rounded corners. */
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(22, 46, 82, 0.72);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(24px) saturate(145%);
}

.gmail-admin-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(22, 46, 82, 0.72);
  backdrop-filter: blur(24px) saturate(145%);
}

.gmail-admin-card h2,
.gmail-admin-card p {
  margin: 0;
}

.gmail-status {
  margin-top: 0.3rem !important;
  color: var(--muted);
}

.gmail-status-connected,
.gmail-success {
  color: #49d98a;
}

/* The per-account Manage modal on the Users page (see admin_users.html) —
   left-aligned content, unlike the small centered confirm-style modals the
   base .modal-content is tuned for. Each per-user setting is one
   .manage-user-section; future settings add another. */
.manage-user-modal-content {
  align-items: stretch;
  text-align: left;
  width: min(440px, calc(100vw - 2rem));
  max-height: 85vh;
  overflow-y: auto;
}

.manage-user-modal-content h2 {
  margin: 0;
}

.manage-user-summary {
  margin: -0.6rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.manage-user-section[hidden],
.manage-user-tier-options[hidden] {
  /* The flex display below would otherwise beat the hidden attribute's
     built-in display:none. */
  display: none;
}

.manage-user-section {
  border: 1px solid #26446f;
  border-radius: 8px;
  padding: 0.75rem 0.9rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.manage-user-section legend {
  padding: 0 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.manage-user-section input[type="email"],
.manage-user-section input[type="text"] {
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(7, 22, 42, 0.45);
  color: var(--text);
  font-family: inherit;
}

.manage-user-tier-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.manage-user-status {
  min-height: 1em;
  color: var(--danger);
  font-size: 0.78rem;
}

.manage-user-modal-content .modal-actions {
  justify-content: flex-end;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-users-table th,
.admin-users-table td {
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: middle;
}

/* Long emails wrap instead of forcing the table wider; dates and IDs stay
   on one line at a size that fits. */
.admin-users-table td:nth-child(2) {
  overflow-wrap: anywhere;
}

.admin-users-table td:nth-child(6) {
  white-space: nowrap;
}

.admin-users-table code {
  font-size: 0.8rem;
}

.admin-users-table th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-users-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-users-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.admin-user-name {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
}

.admin-user-name .home-user-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.admin-user-role {
  display: inline-flex;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
}

.admin-user-role-admin {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.admin-user-status {
  display: inline-flex;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 0.75rem;
}

.admin-user-status-active {
  color: #79e8aa;
  border-color: rgba(73, 217, 138, 0.35);
  background: rgba(73, 217, 138, 0.08);
}

.admin-user-status-pending {
  color: #ffd166;
  border-color: rgba(255, 209, 102, 0.35);
  background: rgba(255, 209, 102, 0.08);
}

/* Price tier checkbox rows — used inside the Manage modal (see
   admin_users.html); .admin-user-tiers-all is the read-only summary shown
   in the table's Pricing column. */
.admin-user-tier-option {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}

.admin-user-tier-option input {
  accent-color: var(--accent);
}

.admin-user-tier-option:has(input:disabled) {
  color: var(--muted);
  cursor: default;
}

.admin-user-tiers-all {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* The hard-locked owner account's badges on the Users page (see
   admin_users.html / is_owner in auth.py). */
.admin-user-role-owner {
  background: rgba(255, 199, 89, 0.16);
  color: #ffc759;
}

.admin-user-locked {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.admin-user-access-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.admin-user-access-status {
  color: var(--danger);
  font-size: 0.72rem;
}

.admin-users-table code {
  color: var(--muted);
}

.admin-users-empty {
  color: var(--muted);
  text-align: center !important;
}

@media (max-width: 680px) {
  .admin-users-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.quote-row-actions {
  vertical-align: middle;
  text-align: right;
}

.quote-row-actions-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  white-space: nowrap;
}

.quote-row-actions-inner .btn {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

/* Admin-only browse-by-user panel on the Saved Quotes page — an overlay
   drawer (doesn't push .quote-page's content over the way the main
   editor's product sidebar does; .quote-page's auto-centered margin isn't
   worth fighting for what's a quick admin utility panel) opened via
   users-toggle-btn, closed by clicking outside it (see quotes-list.js). */
.users-toggle-btn {
  position: fixed;
  top: 5rem;
  left: 0;
  z-index: 560;
  padding: 0.6rem 0.9rem;
  border: 1px solid #26446f;
  border-left: none;
  border-radius: 0 8px 8px 0;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: left 0.2s ease;
}

.users-toggle-btn.open {
  left: calc(var(--users-sidebar-width) - 1px);
  width: 52px;
  min-height: 48px;
  padding: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0 14px 14px 0;
}

.users-sidebar {
  position: fixed;
  top: var(--site-nav-height);
  left: 0;
  bottom: 0;
  width: var(--users-sidebar-width);
  background: var(--panel);
  border-right: 1px solid #26446f;
  border-radius: 0 18px 18px 0;
  padding: 1.2rem;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 550;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.users-sidebar.open {
  transform: translateX(0);
}

.users-sidebar-header h2 {
  margin: 0 0 0.55rem;
  font-size: 1.1rem;
  color: var(--text);
}

.users-sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 54px;
  padding: 0.7rem 0.85rem;
  border-radius: 13px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.users-sidebar-item:hover {
  background: var(--bg);
}

.users-sidebar-item.active {
  background: var(--accent);
  color: #fff;
}

.users-sidebar-role {
  margin-left: 0.4rem;
  font-size: 0.7rem;
  text-transform: capitalize;
  color: var(--muted);
}

.users-sidebar-item.active .users-sidebar-role {
  color: rgba(255, 255, 255, 0.85);
}

.users-sidebar-count {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 34px;
  height: 30px;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: rgba(5, 18, 36, 0.74);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  text-align: center;
}

.users-sidebar-item.active .users-sidebar-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.users-sidebar-divider {
  height: 1px;
  margin: 0.5rem 0;
  background: #26446f;
}

.quotes-filter-note {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.quotes-filter-note a {
  color: var(--accent);
}

.saved-quotes-owner {
  display: inline-flex;
  align-items: center;
  margin-left: 0.55rem;
  padding: 0.28rem 0.7rem;
  border: 1px solid rgba(117, 160, 255, 0.35);
  border-radius: 999px;
  background: rgba(248, 194, 87, 0.13);
  color: #fbe3b0;
  font-size: 0.75rem;
  font-weight: 650;
  vertical-align: middle;
}

.quotes-search-row {
  margin: 0 0 1.5rem;
}

.quotes-search-input {
  width: 100%;
  max-width: 360px;
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  border: 1px solid #26446f;
  background: var(--panel);
  color: var(--text);
  font-size: 0.95rem;
}

#app-root {
  padding: 1.5rem;
  margin-left: 0;
  transition: margin-left 0.2s ease;
}

/* Push the whole grid clear of the open sidebar instead of letting it sit
   underneath, so photos are never partially covered while it's open. */
body.sidebar-open #app-root {
  margin-left: var(--sidebar-width);
}

#photo-stage-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  align-items: flex-start;
  min-height: 60vh;
}

.empty-state {
  color: var(--muted);
  margin-top: 4rem;
}

.photo-stage {
  position: relative;
  flex: 0 0 auto;
  width: min(320px, 80vw);
  height: 240px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  cursor: zoom-in;
  transform-origin: center center;
  perspective: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  /* Stops phones/tablets from treating a double-tap here as their own
     page-zoom gesture, so it reaches our own double-tap-to-fullscreen
     handling instead (see onDoubleClickOrTap in main.js) — also drops the
     ~300ms tap delay some mobile browsers add while they wait to see if a
     tap is the start of a double-tap. */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Sized via aspect-ratio (set inline per-photo in JS) to exactly match the
   true photo, letterboxed within the stage rather than cropped. Fixtures
   and ropes are positioned as percentages of THIS element, not the outer
   stage — so those percentages stay pixel-accurate to the real photo
   whether the stage is a small grid tile, zoomed, or fullscreen, instead of
   shifting/deforming when the crop changes between those modes. */
.photo-content {
  position: relative;
  max-width: 100%;
  max-height: 100%;
}

.photo-stage-placeholder {
  flex: 0 0 auto;
  visibility: hidden;
}

.photo-stage.zoom-active {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  /* A zoomed grid photo grows past its tile and can reach up under the
     quote-details bar (z-index 45) and the sticky site nav — it has to
     float above both while zoomed (still under modals at 100 and the
     fullscreen stage at 500), then drops back into the grid on zoom-out. */
  z-index: 90;
  cursor: default;
}

.photo-stage.fullscreen-mode {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  z-index: 500;
  cursor: default;
}

/* Scrolled in past the normal fit-to-screen framing (see the wheel handler
   in main.js) — draggable to look around, same as any other pannable
   image viewer. */
.photo-stage.fullscreen-mode.zoomed-in {
  cursor: grab;
}

.photo-stage.fullscreen-mode.panning {
  cursor: grabbing;
}

.photo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.photo-fullscreen-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
}

.photo-stage.fullscreen-mode .photo-fullscreen-close {
  display: flex;
}

/* Only shown once the photo is "active" (zoom-active — see initPhotoZoom in
   main.js) so it doesn't clutter every grid tile at once. Sits top-right,
   same spot as the fullscreen close button — the two never show at once
   (a stage is either zoom-active or fullscreen-mode, never both), so they
   don't collide. */
.photo-delete-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: var(--danger);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 55;
}

.photo-stage.zoom-active .photo-delete-btn {
  display: flex;
}

/* Always visible in the base grid (not gated behind zoom-active like the
   delete button) — reordering is a grid-level action, so the handle needs
   to be there before the user has clicked into any single photo. */
.photo-drag-handle {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  user-select: none;
  z-index: 56;
}

.photo-drag-handle:active {
  cursor: grabbing;
}

.photo-stage.fullscreen-mode .photo-drag-handle {
  display: none;
}

/* Only appears after hovering the handle for 1s (see the mouseenter timer
   in main.js) — the .visible class is what JS toggles; opacity/visibility
   (not display) so the fade transition has something to animate.
   Anchored to the handle's left edge (not centered on it) and extending
   rightward — the handle sits right at the stage's own left edge, and the
   stage clips overflow, so a centered tooltip would get cut off on the left. */
.photo-drag-handle-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: rgba(14, 33, 60, 0.95);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 400;
  white-space: nowrap;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #26446f;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  z-index: 57;
}

.photo-drag-handle-tooltip.visible {
  opacity: 1;
  visibility: visible;
}

/* Shown on whichever other photo tile the dragged photo is currently
   hovering directly over, telling the user a drop here swaps the two
   photos' positions instead of inserting into a gap. */
.photo-stage.drag-swap-target::after {
  content: "Swap";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 194, 87, 0.4);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  z-index: 46;
  pointer-events: none;
}

/* A thin glowing bar marking exactly where the dragged photo would land if
   dropped in the gap it's currently hovering (as opposed to swapping —
   see .drag-swap-target above). Lives on <body>, not inside any stage, so
   its fixed positioning follows the true viewport. */
.photo-insert-indicator {
  position: fixed;
  width: 4px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  z-index: 300;
  pointer-events: none;
}

.photo-insert-indicator[hidden] {
  display: none;
}

.fullscreen-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 400;
}

.quote-page {
  /* Roomier reading width for a single quote (the photos are the point).
     Saved Quotes overrides this to the full section width below. */
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* /quotes only (see quotes_list.html) — .quote-page alone is also the
   single-quote view (quote.html), which still wants the narrower reading
   width above; the dashboard's own tables read better with real width to
   stretch into instead of being squeezed into an 800px column. */
.quote-page.quotes-dashboard {
  max-width: 1600px;
}

.quote-photos {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quote-photo {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.quote-table {
  background: var(--panel);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
}

.quote-table th,
.quote-table td {
  padding: 0.8rem 0.75rem;
  border-right: 0;
}

.quote-table thead th {
  background: rgba(255, 255, 255, 0.035);
}

.quote-table tbody tr:last-child td {
  border-bottom: 0;
}

.quote-table th:first-child,
.quote-table td:first-child {
  padding-left: 1rem;
}

.quote-table th:last-child,
.quote-table td:last-child {
  padding-right: 1rem;
}

.review-section {
  /* The builder's Review Quote screen — widened to match the quote view,
     so the line-item table with three price tiers isn't cramped. */
  max-width: 1100px;
  margin: 2rem auto;
  padding: 1.5rem;
  background: var(--panel);
  border-radius: 10px;
}

.review-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #26446f;
}

.review-details label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.review-details input,
.review-details textarea {
  padding: 0.55rem;
  border-radius: 6px;
  border: 1px solid #26446f;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.review-table th,
.review-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #26446f;
}

/* Manufacturer and the spec one-liner ("40W · 120V · 4200 lm · 3000K ·
   IP65"), tucked under a line item's product name on both the Review screen
   and the saved quote — five more columns would push the prices off the edge
   of the table, and these read fine stacked. Same treatment as
   .quote-id-sub, which plays the same role in the quotes tables. */
.line-item-sub {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.review-total {
  margin-top: 1rem;
  font-size: 1.1rem;
  text-align: right;
}

/* Past versions of a quote, kept because they'd already been sent (see
   archive_current_revision in app.py). Listed under the line items on the
   live quote page only. */
/* The quote page's two-column shell: the versions panel docks on the left
   (sticky, so it stays in reach while scrolling a long quote) and the
   quote itself keeps its reading width beside it. With no revisions the
   panel doesn't render and the flex centering leaves the quote exactly
   where it always was. */
.quote-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 1.5rem;
}

/* A long unbroken name or address (a pasted link, an email address) wraps
   instead of stretching the quote page or the quote tables sideways. */
.app-header h1,
.quote-for-sub,
.quote-table td,
.review-table td {
  overflow-wrap: anywhere;
}

/* Allowed to be narrower than its widest content (the line-item table,
   which scrolls inside its own box on a phone); as a flex item it otherwise
   grows to fit it and pushes the page wider than the screen. */
.quote-layout > .quote-page {
  width: 100%;
  min-width: 0;
}

.quote-versions-panel {
  flex: 0 0 240px;
  position: sticky;
  top: calc(var(--site-nav-height) + 1rem);
  margin-top: 2rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--glass-highlight), rgba(255, 255, 255, 0.02)), var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.quote-versions-panel h3 {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
}

.quote-versions-hint {
  margin: 0 0 0.8rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.quote-version-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.quote-version-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}

a.quote-version-item:hover {
  border-color: var(--glass-border-bright);
  background: rgba(255, 255, 255, 0.06);
}

/* Whichever version is on screen right now — moves with the in-place
   switcher (see initVersionSwitcher in quote.js). */
.quote-version-item.quote-version-active {
  border-color: rgba(248, 194, 87, 0.45);
  background: rgba(248, 194, 87, 0.1);
}

.quote-version-title {
  font-size: 0.86rem;
  font-weight: 650;
}

.quote-version-badge {
  margin-left: 0.3rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(248, 194, 87, 0.25);
  color: #fdf0d2;
  font-size: 0.66rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quote-version-meta {
  font-size: 0.74rem;
  color: var(--muted);
}

/* Narrow screens: the panel sits above the quote as a normal block. */
@media (max-width: 900px) {
  .quote-layout {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }

  .quote-versions-panel {
    position: static;
    margin: 1.5rem 1.5rem 0;
  }
}

/* Which revision a quote is on — only shown once there's more than one, so
   a quote that's never been revised doesn't carry a meaningless "Rev 1". */
.quote-status-badge.quote-rev-badge {
  background: rgba(160, 170, 166, 0.18);
  color: var(--muted);
}

/* Banner across the top of an archived revision, in place of the payment
   summary the live quote shows there. */
.quote-rev-banner {
  margin: 0.5rem 0 0;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--accent);
  background: rgba(248, 194, 87, 0.08);
  border-radius: 4px;
  color: var(--muted);
  max-width: 70ch;
}

.review-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
}

.photo-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: var(--text);
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  pointer-events: none;
}

.photo-measure-point {
  position: absolute;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(248, 194, 87, 0.3), 0 4px 14px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  z-index: 65;
}

.fixture-count-btn {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 58;
  padding: 0.38rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(12, 32, 60, 0.68);
  color: var(--muted);
  font: 600 0.7rem/1 var(--font);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(12px) saturate(145%);
  backdrop-filter: blur(12px) saturate(145%);
}

.fixture-count-btn:hover {
  color: var(--text);
  border-color: rgba(248, 194, 87, 0.5);
}

.fixture-count-btn.active {
  border-color: rgba(134, 184, 255, 0.7);
  background: linear-gradient(180deg, rgba(246, 190, 78, 0.94), rgba(204, 146, 38, 0.9));
  color: #fff;
  box-shadow: 0 8px 22px rgba(37, 100, 211, 0.34), inset 0 1px rgba(255, 255, 255, 0.35);
}

.photo-stage.fullscreen-mode .fixture-count-btn {
  position: fixed;
  right: calc(var(--fullscreen-tools-width) + 0.75rem);
  bottom: 0.75rem;
  font-size: 0.78rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal[hidden] {
  display: none;
}

.add-photo-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: min(90vw, 320px);
  height: 220px;
  margin-top: 2rem;
  border: 2px dashed #35527f;
  border-radius: 10px;
  background: #1d3963;
  color: var(--muted);
  cursor: pointer;
}

.add-photo-tile:hover {
  border-color: var(--accent);
  color: var(--text);
}

.add-photo-icon {
  font-size: 2rem;
  line-height: 1;
}

.modal-content {
  background: var(--panel);
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

#camera-video {
  max-width: min(90vw, 640px);
  border-radius: 8px;
}

/* Row layout (canvas left, everything else in a side column to the
   right) — overrides .modal-content's default centered column so the
   measure panel below never sits on top of the model it's asking about. */
.model-3d-view-content {
  flex-direction: row;
  align-items: flex-start;
}

.model-3d-view-canvas {
  max-width: min(60vw, 520px);
  max-height: min(70vh, 520px);
  width: min(60vw, 520px);
  height: min(70vh, 520px);
  border-radius: 8px;
  background: #0c2445;
  cursor: grab;
  flex-shrink: 0;
}

.model-3d-view-canvas:active {
  cursor: grabbing;
}

.model-3d-view-side {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 220px;
  flex-shrink: 0;
}

/* The "how many feet is that" step — replaces a plain prompt() (see
   measureModelDimensions in model-3d-view.js), which is always screen-
   centered and can't be moved off of the model it's asking about. In-flow
   here (not position:fixed like .rope-hud) since .model-3d-view-side
   already puts it beside the canvas rather than on top of it. */
.model-3d-view-measure-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(14, 33, 60, 0.95);
  border: 1px solid #26446f;
  border-radius: 10px;
  padding: 0.9rem;
}

.model-3d-view-measure-panel[hidden] {
  display: none;
}

/* Shared by the Add Product modal's real-world-size field and the bigger
   3D view's per-axis measure panel — a whole-feet input next to a 0-11.99
   inches input, so a fixture smaller than a foot (or an odd size like
   1'4") can be entered precisely instead of forcing it into one decimal-
   feet field. */
.feet-inches-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.feet-inches-row input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #26446f;
  background: var(--panel);
  color: var(--text);
  font-size: 0.95rem;
}

.feet-inches-unit {
  color: var(--muted);
  font-size: 0.85rem;
}

.model-3d-view-measure-input {
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #26446f;
  background: var(--panel);
  color: var(--text);
  font-size: 0.95rem;
}

.model-3d-view-measure-panel .btn {
  width: 100%;
  justify-content: center;
}

#send-modal .modal-content {
  align-items: stretch;
  width: min(92vw, 760px);
  max-height: min(86vh, 760px);
  padding: 1.5rem;
}

#send-modal label {
  font-size: 0.85rem;
  color: var(--muted);
}

#send-modal input {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #26446f;
  background: var(--bg);
  color: var(--text);
}

/* One row per recipient (see addEmailRow in quote.js) — built up
   dynamically as "+ Add recipient" is clicked. */
.send-email-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.15rem;
}

.send-email-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.send-email-row .send-email-input {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
}

.send-price-tier {
  flex: 0 0 150px;
  padding: 0.5rem;
}

/* The pre-send email preview (see quote.html / quote.js): the iframe holds
   the exact email the server would send, rendered on white the way a mail
   client shows it — the frame keeps its light styling isolated from this
   page's dark theme. */
.email-preview-content {
  align-items: stretch;
  width: min(860px, calc(100vw - 2rem));
  height: min(85vh, 940px);
}

.email-preview-content h2 {
  margin: 0;
}

.email-preview-frame {
  flex: 1;
  min-height: 0;
  width: 100%;
  border: 1px solid #26446f;
  border-radius: 10px;
  background: #fff;
}

.email-preview-content .modal-actions {
  justify-content: flex-end;
}

/* "Who should lose this fixture?" — the delete flow's choice modal for a
   fixture shared with every account (see index.html/product-editor.js). */
.delete-fixture-modal-content {
  align-items: stretch;
  text-align: left;
  width: min(440px, calc(100vw - 2rem));
}

.delete-fixture-modal-content h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.delete-fixture-modal-content .modal-actions {
  justify-content: flex-end;
}

@media (max-width: 620px) {
  #send-modal .modal-content {
    width: min(94vw, 760px);
    padding: 1rem;
  }

  .send-email-row {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .send-email-row .send-email-input {
    grid-column: 1 / -1;
    width: 100%;
  }

  /* Email and tier each take a full row; Preview and × share the third. */
  .send-price-tier {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.price-tier-cell {
  font-size: 0.78rem;
  line-height: 1.65;
  white-space: nowrap;
}

.price-tier-totals {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
}

.send-email-remove-btn {
  flex-shrink: 0;
  padding: 0.3rem 0.7rem;
  font-size: 0.9rem;
  line-height: 1;
}

#send-email-add-btn {
  align-self: flex-start;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.send-status {
  min-height: 1.2rem;
  font-size: 0.8rem;
  color: var(--danger);
}

#stage-modal .modal-content {
  align-items: stretch;
  width: min(90vw, 360px);
}

.stage-modal-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.stage-modal-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.stage-modal-amount-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stage-modal-amount-row label {
  font-size: 0.85rem;
  color: var(--muted);
}

.stage-modal-amount-row input {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #26446f;
  background: var(--bg);
  color: var(--text);
}

.stage-modal-amount-preview {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* An author-level `display` (above) always beats the browser's default
   `[hidden] { display: none }` regardless of selector specificity — same
   pitfall as .add-product-modal-content label[hidden] elsewhere in this
   file. */
.stage-modal-amount-row[hidden] {
  display: none;
}

.add-product-modal-content {
  align-items: stretch;
  width: min(90vw, 420px);
  max-height: 85vh;
  overflow-y: auto;
}

.add-product-modal-content h2 {
  margin: 0;
  font-size: 1.1rem;
}

.add-product-modal-content label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* An author-level `display` (above) always beats the browser's default
   `[hidden] { display: none }` regardless of selector specificity — so
   without this, a hidden label here would still render. */
.add-product-modal-content label[hidden] {
  display: none;
}

.add-product-modal-content input[type="text"],
.add-product-modal-content input[type="number"],
.add-product-modal-content select {
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #26446f;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

.add-product-checkbox-row {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

/* Visually subordinate to "Use rope-style placement" above it — only
   relevant/shown when that's checked (see product-editor.js). */
.add-product-nested-checkbox {
  margin-left: 1.4rem;
  font-size: 0.8rem;
}

.add-product-category-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.link-btn {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

.add-product-image-source {
  border: 1px solid #26446f;
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.product-price-tiers {
  margin: 0;
  padding: 0.8rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(8, 25, 48, 0.28);
}

.product-price-tiers legend {
  padding: 0 0.35rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
}

.product-price-tiers > p {
  margin: 0 0 0.7rem;
}

.product-price-tier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.product-price-tier-grid label {
  min-width: 0;
}

@media (max-width: 520px) {
  .product-price-tier-grid { grid-template-columns: 1fr; }
}

.add-product-image-source legend {
  padding: 0 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Part number, manufacturer, and the electrical figures a commercial buyer
   needs off the finished quote — grouped into their own box so the fixture's
   own placement/pricing settings above stay easy to scan. */
.add-product-specs {
  border: 1px solid #26446f;
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.add-product-specs legend {
  padding: 0 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.add-product-specs-optional {
  font-weight: 400;
  opacity: 0.8;
}

/* One user-defined spec: its name, its value, and a button to drop the row.
   The name column is narrower than the value since spec names ("Wattage",
   "Finish") are short and predictable while values can run long. */
.spec-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto;
  gap: 0.4rem;
  align-items: center;
}

.spec-row input {
  width: 100%;
}

.spec-row-remove-btn {
  padding: 0.3rem 0.6rem;
  line-height: 1;
  color: var(--muted);
}

.spec-row-remove-btn:hover {
  color: #ff6b6b;
}

.spec-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Preset bundles sit to the right of "+ Add Spec", pushed to the far edge so
   the one-at-a-time and all-at-once paths read as distinct choices rather
   than one run-on row of buttons. */
.spec-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.spec-presets-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.spec-preset-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}

.image-source-tabs {
  display: flex;
  gap: 0.5rem;
}

.image-source-tab {
  flex: 1;
  justify-content: center;
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
}

.image-source-tab[hidden] {
  display: none;
}

.image-source-tab.active {
  border-color: var(--accent);
  color: var(--accent);
}

.shape-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.shape-picker[hidden] {
  display: none;
}

.shape-option {
  aspect-ratio: 1;
  padding: 0.4rem;
  border-radius: 8px;
  border: 1px solid #26446f;
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shape-option:hover {
  border-color: var(--accent);
}

.shape-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.shape-option img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-picker {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.upload-picker[hidden] {
  display: none;
}

.model3d-picker {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}

.model3d-picker[hidden] {
  display: none;
}

.model3d-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.new-product-model-preview {
  /* Drag sets the fixture's placement orientation (see product-editor.js);
     touch-action off so the same drag works on touch instead of scrolling. */
  cursor: grab;
  touch-action: none;
  width: 160px;
  height: 160px;
  border-radius: 8px;
  border: 1px solid #26446f;
  background: var(--bg);
}

.new-product-model-preview[hidden] {
  display: none;
}

.bend-config {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: -0.4rem;
  padding: 0.7rem 0.8rem;
  border-radius: 8px;
  border: 1px solid #26446f;
  background: var(--bg);
}

.bend-config[hidden] {
  display: none;
}

.bend-axis-options {
  display: flex;
  gap: 0.5rem;
}

.bend-axis-options[hidden] {
  display: none;
}

.bend-axis-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid #26446f;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}

.bend-axis-btn:hover {
  border-color: var(--accent);
}

.bend-axis-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #0c2445;
}

.bend-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
}

.bend-preview-canvas {
  width: 160px;
  height: 160px;
  border-radius: 8px;
  border: 1px solid #26446f;
  background: var(--bg);
}

.bend-preview-canvas[hidden] {
  display: none;
}

.model3d-status {
  font-size: 0.8rem;
  color: var(--muted);
}

.current-image-picker {
  display: flex;
  align-items: flex-start;
}

.current-image-picker[hidden] {
  display: none;
}

.new-product-image-preview {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #26446f;
  background: var(--bg);
}

.fixture-sharing-fieldset {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
}

.fixture-sharing-fieldset > label {
  display: grid;
  gap: 0.4rem;
}

.fixture-sharing-fieldset select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--glass-border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
}

.fixture-audience-users {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.45rem;
  padding: 0.65rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.fixture-audience-users[hidden] {
  display: none;
}

.fixture-audience-user {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.add-product-error {
  min-height: 1.1rem;
  font-size: 0.8rem;
  color: var(--danger);
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translate(-50%, 1rem);
  background: var(--panel);
  border: 1px solid #26446f;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 300;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.catalog-toggle-btn {
  position: fixed;
  top: 5rem;
  left: 0;
  z-index: 560;
  padding: 0.6rem 0.9rem;
  border: 1px solid #26446f;
  border-left: none;
  border-radius: 0 8px 8px 0;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: left 0.2s ease;
}

.catalog-toggle-btn.open {
  left: var(--sidebar-width);
}

.product-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--panel);
  border-right: 1px solid #26446f;
  padding: 1.25rem 1rem;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 550;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.product-sidebar.open {
  transform: translateX(0);
}

/* Mirrors .catalog-toggle-btn/.product-sidebar above, flipped to the right
   edge — only shown while a photo is fullscreen (see
   showFullscreenToolsPanel/hideFullscreenToolsPanel in main.js), since
   that's the one time the main toolbar these buttons normally live in is
   covered and unreachable. */
.fullscreen-tools-toggle-btn {
  position: fixed;
  top: 5rem;
  right: 0;
  z-index: 560;
  padding: 0.6rem 0.9rem;
  border: 1px solid #26446f;
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  transition: right 0.2s ease;
}

.fullscreen-tools-toggle-btn.open {
  right: var(--sidebar-width);
}

.fullscreen-tools-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--panel);
  border-left: 1px solid #26446f;
  padding: 1.25rem 1rem;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  z-index: 550;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.fullscreen-tools-panel.open {
  transform: translateX(0);
}

.product-sidebar h2 {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}

.product-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.product-asset-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
  margin: 0 0 0.85rem;
  padding: 0.25rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.product-asset-tab {
  min-width: 0;
  padding: 0.48rem 0.35rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
}

.product-asset-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.product-asset-tab.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(246, 190, 78, 0.82), rgba(204, 146, 38, 0.76));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.25), 0 5px 14px rgba(170, 118, 24, 0.25);
}

.add-product-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid #26446f;
  background: var(--panel);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The author-level `display: flex` above would otherwise beat the
   browser's default `[hidden] { display: none }` — same pitfall as
   .add-product-modal-content label[hidden]. Hidden when the account isn't
   allowed to manage fixtures (see index.html / can_manage_fixtures). */
.add-product-btn[hidden] {
  display: none;
}

.add-product-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #26446f;
  background: var(--panel);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
}

.category-header:hover {
  border-color: var(--accent);
}

.category-arrow {
  color: var(--muted);
  font-size: 0.75rem;
}

.category-items[hidden] {
  display: none;
}

.category-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0 0.25rem 0.75rem;
}

.catalog-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.4rem 0.5rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #26446f;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.catalog-item[hidden] {
  display: none;
}

body.fullscreen-panels-open .product-asset-tabs {
  grid-template-columns: 1fr;
  margin-bottom: 0.55rem;
}

body.fullscreen-panels-open .product-asset-tab {
  padding: 0.4rem 0.25rem;
  font-size: 0.65rem;
}

.catalog-item:hover {
  border-color: var(--accent);
}

.catalog-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.catalog-item-name {
  font-size: 0.85rem;
}

.catalog-item-price {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Opens the Add Product modal pre-filled for this product (see
   product-editor.js's openForEdit) — extra right padding on .catalog-item
   above keeps this clear of the price text. */
.catalog-item-menu-btn {
  position: absolute;
  top: 0.15rem;
  right: 0.15rem;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.catalog-item-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.catalog-item-menu-btn[hidden] {
  display: none;
}

.placement-ghost {
  position: fixed;
  width: 60px;
  height: 60px;
  object-fit: contain;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0.85;
  z-index: 200;
}

/* Overrides .placement-ghost's fixed 60x60 product-icon size with something
   that actually looks like a dragged photo thumbnail. */
.photo-drag-ghost {
  width: 140px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.placed-item {
  position: absolute;
  touch-action: none;
  cursor: grab;
}

.rope-layer,
.rope-draft-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.rope-hit {
  stroke: transparent;
  stroke-width: 6;
  vector-effect: non-scaling-stroke;
  pointer-events: stroke;
  cursor: pointer;
}

.rope-glow {
  stroke: #ffdd78;
  /* A wide, faint stroke stands in for the blur filter that used to be
     here: an SVG blur is re-rasterized every animation frame, per rope,
     and was the single biggest drain with many ropes on screen. */
  stroke-width: 14;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.3;
}

/* Tube look: dark casing (base) wider than the lit core leaves a rim of
   shadow along the core's edges, reading as round instead of a flat line.
   A thin bright highlight on top sells it further. */
.rope-base {
  stroke: #2a2118;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.rope-core {
  stroke: #f0a93c;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.rope-highlight {
  stroke: #fff6d2;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.85;
}

.rope-item.selected .rope-core {
  stroke: #ffc35c;
}

.rope-item.selected .rope-highlight {
  stroke: #ffffff;
}

.rope-item.selected .rope-glow {
  opacity: 0.85;
  stroke-width: 13;
}

/* Selection swaps the path's `d` to straight point-to-point segments (see
   updatePaths() in placement.js) — this dash pattern breaks that single
   straight path visually into a chain of short, separate-looking bulbs so
   it reads as "many little rope lights attached to each other" rather than
   one solid straight strand, hinting that each stretch is independently
   grabbable. Deselecting drops the dasharray and swaps back to the smoothed
   `d`, so it reads as one solid rope again. */
.rope-item.selected .rope-base,
.rope-item.selected .rope-core,
.rope-item.selected .rope-highlight,
.rope-item.selected .rope-glow {
  stroke-dasharray: 4.5 2.2;
}

/* Segmented lights (product.segmented — see renderRopeItem in placement.js):
   each lit path is a run of zero-length subpaths, one per bulb, so these
   widths are bulb diameters. A thin dark wire strings them together. */
.rope-wire {
  stroke: #2a2118;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.85;
}

.rope-segmented .rope-glow {
  stroke-width: 12;
}

.rope-segmented .rope-base {
  stroke-width: 6;
  opacity: 0.85;
}

.rope-segmented .rope-core,
.rope-segmented .rope-show {
  stroke-width: 4.6;
}

.rope-segmented .rope-highlight {
  stroke-width: 1.6;
}

/* Bulbs are already separate: no selection dashes, and the light shows
   color whole bulbs (alternating between the two runs) instead of running
   dashes along a strand. */
.rope-segmented .rope-glow,
.rope-segmented .rope-base,
.rope-segmented .rope-core,
.rope-segmented .rope-highlight,
.rope-segmented .rope-show {
  stroke-dasharray: none !important;
}

.rope-segmented.selected .rope-wire {
  stroke: #f8c257;
  opacity: 1;
}

/* Downlight (product.downlight): the light goes down the wall under each
   bulb, painted on the photo's light map (light-map.js, which also gives
   each show's light its colors), so there's no halo all around the bulb. */
.rope-downlight .rope-glow {
  display: none;
}
.rope-delete-btn {
  position: absolute;
  transform: translate(-50%, calc(-100% - 8px));
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--danger);
  border: 1.5px solid #fff;
  color: #fff;
  font-size: 8px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  z-index: 12;
}

.rope-delete-btn[hidden] {
  display: none;
}

.photo-stage.fullscreen-mode .rope-delete-btn {
  width: 30px;
  height: 30px;
  font-size: 16px;
  border-width: 3px;
  transform: translate(-50%, calc(-100% - 14px));
}

.rope-footage-btn {
  position: absolute;
  transform: translate(-50%, 10px);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: rgba(14, 33, 60, 0.9);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 0.65rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  z-index: 12;
}

.rope-footage-btn[hidden] {
  display: none;
}

.photo-stage.fullscreen-mode .rope-footage-btn {
  font-size: 0.9rem;
  padding: 0.3rem 0.8rem;
  transform: translate(-50%, 18px);
}

/* Sits to the side of the midpoint (delete is above, footage is below)
   rather than stacked with them, so all three controls stay clear of one
   another. --label-shift-x/y (set by clampLabelToStage in
   label-position.js) nudge it back onscreen if that would push it past the
   photo's edge — same mechanism as the fixture/rope name labels. */
.rope-edit-points-btn {
  position: absolute;
  transform: translate(calc(8px + var(--label-shift-x, 0px)), calc(-50% + var(--label-shift-y, 0px)));
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: rgba(14, 33, 60, 0.9);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 0.65rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  z-index: 12;
}

.rope-edit-points-btn[hidden] {
  display: none;
}

.photo-stage.fullscreen-mode .rope-edit-points-btn {
  font-size: 0.9rem;
  padding: 0.3rem 0.8rem;
  transform: translate(calc(14px + var(--label-shift-x, 0px)), calc(-50% + var(--label-shift-y, 0px)));
}

/* While actually editing, anchored to the top-left corner of the rope's own
   bounding box instead of the midpoint (which a drag can easily land a dot
   on top of) — pushed up and to the left from that corner so it stays right
   next to the rope without ever sitting on one of its points, wherever they
   end up. */
.rope-edit-points-btn.active {
  transform: translate(
    calc(-100% - 6px + var(--label-shift-x, 0px)),
    calc(-100% - 6px + var(--label-shift-y, 0px))
  );
  background: var(--accent);
  color: #fff;
}

.photo-stage.fullscreen-mode .rope-edit-points-btn.active {
  transform: translate(
    calc(-100% - 10px + var(--label-shift-x, 0px)),
    calc(-100% - 10px + var(--label-shift-y, 0px))
  );
}

.rope-name-label {
  position: absolute;
  /* Offset fully to the left of its point instead of centered on it — a
     centered label would sit directly on top of the rope's line, covering
     it. Delete/footage sit at the midpoint offset up/down, so offsetting
     the name label sideways at the start point also keeps it clear of
     those on short ropes where the two anchor points are close together.
     --label-shift-x/y (set by clampLabelToStage in label-position.js) pull
     the label back inside the photo's frame if this offset would otherwise
     push it past the edge. */
  transform: translate(calc(-100% - 8px + var(--label-shift-x, 0px)), calc(-50% + var(--label-shift-y, 0px)));
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.8);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 12;
}

/* Shows regardless of selection when the toolbar toggle is on — this rule
   deliberately outranks the [hidden] state set by selection syncing. */
body.show-fixture-names .rope-name-label {
  display: block;
}

/* Same reasoning as .item-label-text: a rope's name is a caption too, and
   holds its size as the view zooms. There's no --item-scale here — a rope
   label isn't inside a scaled fixture box. */
.rope-name-label {
  scale: calc(1 / var(--view-zoom, 1));
}

/* Matched to .item-label-text above, so a rope's name and a fixture's read
   as the same kind of caption. */
.photo-stage.fullscreen-mode .rope-name-label {
  font-size: 0.5rem;
  padding: 0.1rem 0.3rem;
  transform: translate(calc(-100% - 8px + var(--label-shift-x, 0px)), calc(-50% + var(--label-shift-y, 0px)));
}

/* Ropes don't have an .item-img to target, so the fixture highlighter gets
   its own rule: the same pulsing glow filter applied to the tube's stroke
   layers instead. */
body.highlight-fixtures .rope-item .rope-base,
body.highlight-fixtures .rope-item .rope-core,
body.highlight-fixtures .rope-item .rope-highlight {
  filter: drop-shadow(0 0 8px rgba(255, 241, 118, 0.85)) brightness(1.35) saturate(1.3);
  animation: fixture-highlight-pulse 1.1s ease-in-out infinite alternate;
}

.rope-draft-path {
  stroke: #ffdd78;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 3 2;
  vector-effect: non-scaling-stroke;
  opacity: 0.9;
}

.rope-draft-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f8c257;
  border: 1.5px solid #fff;
  cursor: grab;
  touch-action: none;
  z-index: 41;
}

.rope-draft-dot::before {
  /* Enlarges the actual hit-area well beyond the visible dot without
     making the dot itself look bigger — small dots are easy to miss. */
  content: "";
  position: absolute;
  inset: -9px;
}

.rope-draft-dot.dragging {
  cursor: grabbing;
  background: #f9d48a;
}

.photo-stage.fullscreen-mode .rope-draft-dot {
  width: 13px;
  height: 13px;
  border-width: 2px;
}

/* On a phone or tablet a fingertip covers the spot, so the points are
   smaller and so is the area that grabs one: points can go close together,
   and a tap beside a point places a new one instead of grabbing it. */
@media (pointer: coarse) {
  .rope-draft-dot,
  .photo-stage.fullscreen-mode .rope-draft-dot {
    width: 6px;
    height: 6px;
    border-width: 1px;
  }

  .rope-draft-dot::before {
    inset: -5px;
  }
}

/* Fixed to the viewport's right edge (not the photo) so it never sits on
   top of — or has to be worked around on — the picture the user is placing
   points on. */
.rope-hud {
  position: fixed;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.6rem;
  width: 210px;
  padding: 0.9rem;
  background: rgba(14, 33, 60, 0.95);
  border: 1px solid #26446f;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  z-index: 570;
}

/* Needed explicitly: at equal specificity a plain [hidden] (the browser's
   own default) loses to .rope-hud's own `display: flex` above — never an
   issue for placement.js's own rope-placement HUD, which is only ever
   added to the DOM while active and removed (not hidden) otherwise, but
   #scene-measure-hud in index.html is static markup that stays in the
   page permanently and relies on toggling `hidden` (see waitForModelClick/
   cancelSceneMeasurement in main.js) — without this override, setting
   .hidden on it did nothing, which is why it could appear to be "stuck on
   screen" even on a fresh page load that never touched the measuring tool
   at all. Same issue already hit and fixed for .scene-fixture-hud-btn and
   .btn elsewhere in this file. */
.rope-hud[hidden] {
  display: none;
}

.rope-hud-hint {
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.35;
}

.rope-hud .btn {
  width: 100%;
  justify-content: center;
}

/* The selection frame. Product icons are square files with wide
   transparent margins, so this is drawn on the measured artwork bounds
   (--art-* , set by applyArtBounds in placement.js) instead of the image
   box — otherwise the dashed square floats way out from the fixture.
   Defaults to the full box for anything unmeasured (3D models, bendable
   canvases). */
.item-frame {
  position: absolute;
  left: var(--art-l, 0%);
  top: var(--art-t, 0%);
  right: var(--art-r, 0%);
  bottom: var(--art-b, 0%);
  pointer-events: none;
}

.placed-item.selected .item-frame {
  outline: 1px dashed var(--accent);
  outline-offset: 2px;
}

.photo-stage.fullscreen-mode .placed-item.selected .item-frame {
  outline-width: 2px;
  outline-offset: 3px;
}

/* A rope's bounding box can span most of the photo — a box outline around
   it would cover huge unrelated areas. Its own thicker/brighter stroke
   (.rope-item.selected .rope-core / .rope-glow above) is the indicator
   instead, so it hugs the actual line. */
.photo-stage.fullscreen-mode .rope-item.selected,
.rope-item.selected {
  outline: none;
}

body.highlight-fixtures .placed-item .item-img {
  outline: 3px solid #fff176;
  outline-offset: 3px;
  border-radius: 6px;
  filter: drop-shadow(0 0 10px rgba(255, 241, 118, 0.85)) brightness(1.35) saturate(1.3);
  animation: fixture-highlight-pulse 1.1s ease-in-out infinite alternate;
}

@keyframes fixture-highlight-pulse {
  from {
    filter: drop-shadow(0 0 6px rgba(255, 241, 118, 0.7)) brightness(1.25) saturate(1.2);
  }
  to {
    filter: drop-shadow(0 0 20px rgba(255, 241, 118, 1)) brightness(1.5) saturate(1.4);
  }
}

.placed-item .item-img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  backface-visibility: hidden;
}

.handle {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid #fff;
  color: #fff;
  font-size: 8px;
  line-height: 1;
  text-align: center;
  display: none;
  align-items: center;
  justify-content: center;
  user-select: none;
  z-index: 10;
}

.placed-item.selected .handle {
  display: flex;
}

.handle-rotate {
  top: calc(var(--art-t, 0%) - 18px);
  left: var(--art-cx, 50%);
  transform: translateX(-50%);
  cursor: grab;
}

.handle-resize {
  bottom: calc(var(--art-b, 0%) - 5px);
  right: calc(var(--art-r, 0%) - 5px);
  cursor: nwse-resize;
}

.handle-turn {
  bottom: calc(var(--art-b, 0%) - 5px);
  left: calc(var(--art-l, 0%) - 5px);
  cursor: move;
  background: #b16bff;
}

.handle-copy {
  top: calc(var(--art-t, 0%) - 5px);
  left: calc(var(--art-l, 0%) - 5px);
  cursor: pointer;
  background: #3bb26f;
}

.handle-delete {
  top: calc(var(--art-t, 0%) - 5px);
  right: calc(var(--art-r, 0%) - 5px);
  background: var(--danger);
  cursor: pointer;
}

/* Right-middle edge — drag to make the fixture longer/shorter along its own
   length without changing its overall size (handle-resize does that). */
.handle-stretch {
  top: var(--art-cy, 50%);
  right: calc(var(--art-r, 0%) - 5px);
  transform: translateY(-50%);
  cursor: ew-resize;
  background: #ffa53b;
}

/* The group padlock (see applyGroupMarking in placement.js). Sits mid-left,
   opposite the stretch handle, and — unlike every other handle — shows on
   ONE fixture only: the primary member of the selected group, so a locked
   row of twenty carries a single padlock rather than twenty. The two rules
   below have to out-specify `.placed-item.selected .handle { display: flex }`
   in both directions, hence the doubled-up selectors. */
.placed-item.selected .handle-group-lock {
  display: none;
}

.placed-item.selected.group-primary .handle-group-lock {
  display: flex;
  background: #f6c453;
  border-color: #fff;
  color: #3a2b00;
  cursor: pointer;
  font-size: 8px;
}

.handle-group-lock {
  top: var(--art-cy, 50%);
  left: calc(var(--art-l, 0%) - 5px);
  transform: translateY(-50%);
}

/* Bottom-center, mirroring handle-rotate's top-center position — drag
   perpendicular to the fixture to push its middle that way and bow it
   into an arc (see wireBend in placement.js). Only present for a product
   marked bendable (see renderPlacedItem in placement.js). */
.handle-bend {
  bottom: calc(var(--art-b, 0%) - 18px);
  left: var(--art-cx, 50%);
  transform: translateX(-50%);
  cursor: ns-resize;
  background: #22d3c5;
}

/* The photo (and everything on it) renders much bigger in fullscreen, so the
   tiny grid-sized handles become hard to grab — scale them up to match. */
.photo-stage.fullscreen-mode .handle {
  /* Big enough to grab on a touchscreen, small enough not to bury the
     fixture they belong to — the old 30px discs swamped anything placed
     at a realistic size. */
  width: 19px;
  height: 19px;
  font-size: 10px;
  border-width: 2px;
}

.photo-stage.fullscreen-mode .handle-rotate {
  top: calc(var(--art-t, 0%) - 24px);
}

.photo-stage.fullscreen-mode .handle-resize {
  bottom: calc(var(--art-b, 0%) - 8px);
  right: calc(var(--art-r, 0%) - 8px);
}

.photo-stage.fullscreen-mode .handle-turn {
  bottom: calc(var(--art-b, 0%) - 8px);
  left: calc(var(--art-l, 0%) - 8px);
}

.photo-stage.fullscreen-mode .handle-copy {
  top: calc(var(--art-t, 0%) - 8px);
  left: calc(var(--art-l, 0%) - 8px);
}

.photo-stage.fullscreen-mode .handle-delete {
  top: calc(var(--art-t, 0%) - 8px);
  right: calc(var(--art-r, 0%) - 8px);
}

.photo-stage.fullscreen-mode .handle-stretch {
  right: calc(var(--art-r, 0%) - 8px);
}

.photo-stage.fullscreen-mode .handle-group-lock {
  left: calc(var(--art-l, 0%) - 8px);
}

.photo-stage.fullscreen-mode .handle-bend {
  bottom: calc(var(--art-b, 0%) - 24px);
}

/* Only present at all when the product is sold by the foot (see
   renderPlacedItem in placement.js) — sits above the fixture, clear of the
   rotate handle, and only shows on selection like the other handles. */
/* The fixture-colour control in the Add/Edit Product window: the swatch is
   the "little circle" that opens the wheel, with what's currently picked
   spelled out beside it. */
.shape-color-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.shape-color-row[hidden] {
  display: none;
}

/* The little circle is a real <input type="color"> wearing a round skin,
   so clicking it opens the browser's own picker with no scripting — a
   scripted .click() on a hidden input is simply ignored, which is what made
   the first version do nothing. The vendor pseudo-elements below are how
   an <input type="color"> is restyled; both spellings are needed, and a
   browser that supports neither still shows its own square swatch, which
   works exactly the same. */
.shape-color-swatch {
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  cursor: pointer;
  background: none;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  -webkit-appearance: none;
  appearance: none;
}

.shape-color-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
}

.shape-color-swatch::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.shape-color-swatch::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

/* Nothing picked yet: the input's own swatch is hidden so the spectrum
   behind it shows through, which reads as "this is where colour lives"
   rather than as a fixture that happens to be one flat colour already. */
.shape-color-swatch-auto {
  background: conic-gradient(#ff4d4d, #ffd24d, #4dff88, #4dd2ff, #7a4dff, #ff4dcb, #ff4d4d);
}

.shape-color-swatch-auto::-webkit-color-swatch {
  opacity: 0;
}

.shape-color-swatch-auto::-moz-color-swatch {
  opacity: 0;
}

.shape-color-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shape-color-label {
  font-size: 0.85rem;
  color: var(--text);
}

.shape-color-value {
  font-size: 0.75rem;
  color: var(--muted);
}

.shape-color-reset {
  margin-left: auto;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
}

.item-footage-btn {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  background: rgba(14, 33, 60, 0.9);
  border: 1px solid var(--accent);
  color: var(--text);
  font-size: 0.65rem;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  z-index: 12;
  display: none;
}

.placed-item.selected .item-footage-btn {
  display: block;
}

.photo-stage.fullscreen-mode .item-footage-btn {
  font-size: 0.9rem;
  padding: 0.3rem 0.8rem;
  top: -62px;
}

/* Position only — kept separate from .item-label-text's own transform (see
   below) so the edge-clamp shift (JS: clampLabelToStage in
   label-position.js) and the small-fixture readability counter-scale don't
   fight over the same `transform` property. --label-shift-x/y default to
   0px until JS has actually measured this label against its stage. */
.item-label {
  position: absolute;
  bottom: -1.05rem;
  left: 50%;
  transform: translate(calc(-50% + var(--label-shift-x, 0px)), var(--label-shift-y, 0px));
  pointer-events: none;
  display: none;
}

.placed-item.selected .item-label,
body.show-fixture-names .item-label {
  display: block;
}

.item-label-text {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.8);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
  /* A name label is a caption, not part of the picture, so it holds one
     readable size on screen no matter how small the fixture is or how far
     the view is zoomed. Two things would otherwise shrink it:

     --item-scale, the fixture's own scale, which the label sits inside. On
     a big property photo a fixture sized true-to-life is a fraction of its
     default (a 1 ft flood across 200 ft of frontage lands near 0.06), and
     this used to be capped at 2.2x "so a very tiny fixture doesn't blow the
     label up too far" — but cancelling the scale exactly can't blow
     anything up, it lands the label at precisely its own font size. The cap
     just left the name 3px tall and unreadable. Only scales UP: a fixture
     placed larger than default keeps a proportionally larger name.

     --view-zoom, the fullscreen zoom (see applyFullscreenViewTransform in
     main.js), for the same reason a map's labels don't grow as you zoom in.
     Without it, cancelling --item-scale in full would make labels enormous
     at the deep zooms a large photo needs. */
  transform: scale(max(1, calc(1 / var(--item-scale, 1)))) scale(calc(1 / var(--view-zoom, 1)));
  /* Grown downward from where it's anchored, not outward from its middle.
     A label scaled up 17x around its own centre reaches back over the
     fixture it names and hides it — which is what made the enlarged labels
     worse than the tiny ones for a moment. */
  transform-origin: top center;
}

/* About half the size they were: a name now holds a constant size on screen
   (see .item-label-text above), and at the old 0.95rem a run of fixtures
   placed close together was a wall of overlapping pills. Small enough to sit
   between neighbours, still well clear of the ~4px they used to shrink to. */
.photo-stage.fullscreen-mode .item-label-text {
  font-size: 0.5rem;
  padding: 0.1rem 0.3rem;
}

/* A touch device (phone, tablet, or a desktop with a touchscreen) has much
   less precision than a mouse pointer — bump the tiny drag handles up to a
   size between their normal 13px and their fullscreen-mode 30px, so they're
   still grabbable before the user has zoomed/gone fullscreen at all.
   Keyed off input precision (pointer: coarse), not screen size, since a
   touchscreen laptop is just as imprecise as a phone at any window width. */
@media (pointer: coarse) {
  .handle {
    width: 22px;
    height: 22px;
    font-size: 12px;
    border-width: 2px;
  }

  .handle-rotate {
    top: -28px;
  }

  .handle-resize {
    bottom: -9px;
    right: -9px;
  }

  .handle-turn {
    bottom: -9px;
    left: -9px;
  }

  .handle-copy {
    top: -9px;
    left: -9px;
  }

  .handle-delete {
    top: -9px;
    right: -9px;
  }

  .handle-stretch {
    right: -9px;
  }

  .handle-bend {
    bottom: -28px;
  }
}

/* Narrow phone/tablet viewports: the header/toolbar and off-canvas sidebar
   are laid out assuming a desktop-width window — wrap and shrink them
   instead of letting the toolbar's five buttons overflow the screen. */
@media (max-width: 700px) {
  #app-root {
    padding: 1rem;
  }

  .app-header {
    flex-wrap: wrap;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
  }

  .app-header h1 {
    font-size: 1.05rem;
  }

  .quote-details-bar {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }

  .toolbar {
    flex-wrap: wrap;
    width: 100%;
    gap: 0.5rem;
  }

  .toolbar .btn {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.82rem;
    padding: 0.5rem 0.6rem;
  }

  /* Anchored to the header on wide screens (top: 5rem) so it clears a
     single-row toolbar — that assumption breaks once the toolbar wraps to
     two or three rows here, so pin it to the bottom of the screen instead,
     where it's clear of the header at any wrapped height. */
  .catalog-toggle-btn {
    top: auto;
    bottom: 1rem;
  }

  /* Same reasoning as .catalog-toggle-btn above, mirrored to the right
     edge — stacked slightly higher so the two don't overlap if a photo is
     somehow fullscreen while the product sidebar's toggle is also showing. */
  .fullscreen-tools-toggle-btn {
    top: auto;
    bottom: 4.5rem;
  }
}

/* Fullscreen is a focused workspace: the compact product catalog and tool
   strip stay pinned open, and the photo/scene fits in the space between
   them rather than being covered by either panel. */
body.fullscreen-panels-open .catalog-toggle-btn,
body.fullscreen-panels-open .fullscreen-tools-toggle-btn {
  display: none;
}

body.fullscreen-panels-open .product-sidebar {
  top: var(--site-nav-height);
  width: var(--fullscreen-products-width);
  padding: 0.85rem 0.65rem;
  transform: translateX(0);
}

body.fullscreen-panels-open .fullscreen-tools-panel {
  top: var(--site-nav-height);
  width: var(--fullscreen-tools-width);
  padding: 0.9rem 0.7rem;
  transform: translateX(0);
  justify-content: flex-start;
  gap: 0.55rem;
}

body.fullscreen-panels-open .fullscreen-tools-panel .btn {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  padding: 0.55rem 0.65rem;
  border-radius: 11px;
  font-size: 0.73rem;
  line-height: 1.2;
  text-align: left;
  white-space: normal;
}

.fullscreen-tools-header {
  margin: -0.05rem 0 0.25rem;
  padding: 0.15rem 0.2rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fullscreen-tools-header h2 {
  margin: 0.15rem 0 0;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.fullscreen-tools-kicker {
  color: var(--accent);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.fullscreen-panels-open #highlight-fixtures-btn::before,
body.fullscreen-panels-open #show-fixture-names-btn::before {
  width: 1.15rem;
  flex: 0 0 1.15rem;
  color: #fbe3b0;
  font-size: 0.9rem;
  text-align: center;
}

body.fullscreen-panels-open #highlight-fixtures-btn::before {
  content: "✦";
}

body.fullscreen-panels-open #show-fixture-names-btn::before {
  content: "Aa";
  font-size: 0.68rem;
  font-weight: 800;
}

body.fullscreen-panels-open .product-sidebar-header {
  margin-bottom: 0.65rem;
}

body.fullscreen-panels-open .product-sidebar h2 {
  font-size: 0.85rem;
}

body.fullscreen-panels-open .catalog-list,
body.fullscreen-panels-open .category-list {
  gap: 0.4rem;
}

body.fullscreen-panels-open .category-header {
  padding: 0.45rem 0.5rem;
  font-size: 0.78rem;
}

body.fullscreen-panels-open .category-items {
  gap: 0.35rem;
  padding-left: 0.35rem;
}

body.fullscreen-panels-open .catalog-item {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 0.35rem;
  padding: 0.35rem 1rem 0.35rem 0.35rem;
}

body.fullscreen-panels-open .catalog-item img {
  width: 34px;
  height: 34px;
}

body.fullscreen-panels-open .catalog-item-name,
body.fullscreen-panels-open .catalog-item-price {
  font-size: 0.7rem;
}

body.fullscreen-panels-open .photo-stage.fullscreen-mode {
  inset: var(--site-nav-height) var(--fullscreen-tools-width) 0 var(--fullscreen-products-width);
  width: auto;
  height: auto;
}

@media (max-width: 700px) {
  :root {
    --fullscreen-products-width: 24vw;
    --fullscreen-tools-width: 20vw;
  }

  body.fullscreen-panels-open .product-sidebar {
    padding-inline: 0.4rem;
  }

  body.fullscreen-panels-open .catalog-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.3rem;
    text-align: center;
  }

  body.fullscreen-panels-open .catalog-item-price,
  body.fullscreen-panels-open .catalog-item-menu-btn {
    display: none;
  }
}

/* --- 3D Scenes ---------------------------------------------------------
   A scene tile reuses the .photo-stage grid/fullscreen chrome (see main.js's
   renderScene) but is driven by a <canvas> + SceneViewer instead of a plain
   <img>, so it needs its own sizing (a canvas has no natural aspect ratio
   the way an uploaded photo does) and a few behavior tweaks. */

.scene-content {
  width: 100%;
  height: 100%;
}

.scene-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.scene-stage {
  cursor: pointer;
}

.scene-stage.fullscreen-mode {
  cursor: default;
}

/* .photo-delete-btn normally only shows once a photo is zoom-active (see
   initPhotoZoom in main.js) — a scene tile never enters that inline-zoom
   mode at all, so without this it could never be deleted from the grid. */
.scene-stage .photo-delete-btn {
  display: flex;
}

.scene-stage.fullscreen-mode .photo-delete-btn {
  display: none;
}

/* Only relevant to a scene stage, shown/hidden alongside fullscreen (see
   enterFullscreen/exitFullscreen in main.js) — sits opposite corner from
   .photo-fullscreen-close and .fullscreen-tools-toggle-btn so it never
   collides with either. Its click-to-measure hint HUD (#scene-measure-hud)
   reuses .rope-hud below rather than needing its own styling. */
.scene-measure-btn {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 560;
  padding: 0.5rem 0.85rem;
  border: 1px solid #26446f;
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

.scene-measure-btn[hidden] {
  display: none;
}

/* Floating toolbar that tracks whichever fixture is selected inside an
   open scene (see getScreenPositionForItem in scene-viewer.js and
   updateSceneHudPosition in main.js) — positioned via left/top set directly
   in JS every frame, not by CSS. */
.scene-fixture-hud {
  position: fixed;
  transform: translate(-50%, -120%);
  display: flex;
  gap: 0.35rem;
  background: rgba(14, 33, 60, 0.92);
  border: 1px solid #26446f;
  border-radius: 999px;
  padding: 0.35rem;
  z-index: 520;
  pointer-events: auto;
}

.scene-fixture-hud[hidden] {
  display: none;
}

.scene-fixture-hud-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #26446f;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Needed explicitly: at equal specificity a plain [hidden] (the browser's
   own default) loses to this class's own `display: flex` above, so setting
   .hidden on an individual button (see updateSceneHud in main.js, which
   hides spin/scale for a selected rope — they'd otherwise do nothing) would
   silently fail to actually hide it without this override. */
.scene-fixture-hud-btn[hidden] {
  display: none;
}

.scene-fixture-hud-btn:hover {
  background: var(--accent);
  color: #0c2445;
}

.scene-fixture-hud-delete {
  background: var(--danger);
}

.scene-fixture-hud-delete:hover {
  background: var(--danger);
  opacity: 0.85;
}

/* Mirrors body.show-fixture-names' effect on a flat photo's .item-label-text
   (see style.css below and syncSceneNameLabels in main.js) — same pill
   look, just positioned via left/top in JS every frame instead of CSS
   percentages, since there's no DOM element per 3D fixture to attach a
   percentage-based position to. */
.scene-fixture-name-label {
  position: fixed;
  transform: translate(-50%, 8px);
  display: inline-block;
  white-space: nowrap;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.8);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 510;
}

.scene-fixture-name-label[hidden] {
  display: none;
}

/* Shown instead of .scene-fixture-hud when the selected scene fixture is a
   real 3D model (see updateSceneHud in main.js) — a fixed panel on the
   right edge, same slide-in-from-the-edge treatment as
   .fullscreen-tools-panel, holding the Move/Rotate/Scale mode picker (see
   setInteractionMode in scene-viewer.js). */
.scene-modify-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(280px, 85vw);
  background: var(--panel);
  border-left: 1px solid #26446f;
  padding: 1.25rem 1rem;
  z-index: 560;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scene-modify-panel[hidden] {
  display: none;
}

.scene-modify-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.scene-modify-panel-header h3 {
  margin: 0;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-modify-close-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: none;
  background: #26446f;
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.scene-modify-close-btn:hover {
  background: var(--accent);
  color: #0c2445;
}

.scene-modify-modes {
  display: flex;
  gap: 0.4rem;
}

.scene-modify-mode-btn {
  flex: 1;
  padding: 0.55rem 0.3rem;
  border-radius: 8px;
  border: 1px solid #26446f;
  background: transparent;
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}

.scene-modify-mode-btn:hover {
  border-color: var(--accent);
}

.scene-modify-mode-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #0c2445;
}

.scene-modify-panel-actions {
  margin-top: auto;
  display: flex;
  gap: 0.5rem;
}

.scene-modify-panel-actions .btn {
  flex: 1;
}

/* --- Review screen: per-scene "include interactive 3D view" ------------ */

.review-scenes-section {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #26446f;
}

.review-scenes-section[hidden] {
  display: none;
}

.review-scenes-section h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.review-scenes-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.review-scene-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  font-size: 0.88rem;
}

/* --- Liquid glass visual system ---------------------------------------
   A shared, Apple-inspired glass treatment for every piece of application
   chrome. Photo and 3D canvases remain opaque so their color and contrast
   are not altered by the interface material around them. */
:root {
  color-scheme: dark;
  --bg: #0a1f3b;
  --panel: rgba(22, 46, 82, 0.58);
  --panel-strong: rgba(30, 58, 100, 0.76);
  --panel-soft: rgba(255, 255, 255, 0.065);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-border-bright: rgba(248, 194, 87, 0.35);
  --glass-highlight: rgba(255, 255, 255, 0.04);
  --text: #f5f7fb;
  --muted: #a9b7cf;
  --accent: #f8c257;
  --danger: #ff647c;
  --glass-blur: blur(14px);
  --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.3),
                  inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html {
  min-height: 100%;
  background: #0a1f3b;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(248, 194, 87, 0.12), transparent 38rem),
    linear-gradient(180deg, #0f2a4f 0%, #0a1f3b 100%);
  background-attachment: fixed;
}

/* Main glass surfaces */
.app-header,
.user-bar,
.login-card,
.quote-notes,
.quote-table,
.review-section,
.modal-content,
.users-sidebar,
.product-sidebar,
.fullscreen-tools-panel,
.scene-modify-panel,
.model-3d-view-measure-panel,
.rope-hud,
.scene-fixture-hud,
.toast {
  background: linear-gradient(145deg, var(--glass-highlight), rgba(255, 255, 255, 0.025)),
              var(--panel);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.app-header {
  border-width: 0 0 1px;
  background: rgba(17, 39, 72, 0.62);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2),
              inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

.user-bar {
  background: rgba(9, 27, 51, 0.68);
  border-width: 0 0 1px;
}

.login-card,
.quote-notes,
.quote-table,
.review-section,
.modal-content {
  border-radius: 20px;
}

.users-sidebar,
.product-sidebar {
  border-width: 0 1px 0 0;
  /* Kept well under half opacity so the page genuinely shows through the
     blur — the backdrop-filter (from the glass surfaces group above) is
     what keeps the drawer's own content readable over it. */
  background-color: rgba(12, 32, 60, 0.38);
}

.fullscreen-tools-panel,
.scene-modify-panel {
  border-width: 0 0 0 1px;
  background-color: rgba(17, 39, 72, 0.76);
}

/* Interactive glass */
.btn,
.users-toggle-btn,
.catalog-toggle-btn,
.fullscreen-tools-toggle-btn,
.category-header,
.add-product-btn,
.scene-measure-btn,
.scene-modify-mode-btn,
.scene-modify-close-btn,
.scene-fixture-hud-btn {
  border-color: var(--glass-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13),
              0 7px 18px rgba(0, 0, 0, 0.2);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  transition: transform 0.18s ease, border-color 0.18s ease,
              background 0.18s ease, box-shadow 0.18s ease;
}

.btn,
.category-header,
.scene-modify-mode-btn {
  border-radius: 12px;
}

.btn:hover,
.users-toggle-btn:hover,
.catalog-toggle-btn:hover,
.fullscreen-tools-toggle-btn:hover,
.category-header:hover,
.add-product-btn:hover,
.scene-measure-btn:hover,
.scene-modify-mode-btn:hover,
.scene-modify-close-btn:hover,
.scene-fixture-hud-btn:hover {
  border-color: var(--glass-border-bright);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.085));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2),
              0 10px 24px rgba(0, 0, 0, 0.26),
              0 0 0 1px rgba(248, 194, 87, 0.15);
  transform: translateY(-1px);
}

.btn:active,
.category-header:active,
.scene-modify-mode-btn:active {
  transform: translateY(0) scale(0.985);
}

.btn-primary,
.scene-modify-mode-btn.active,
.users-sidebar-item.active {
  border-color: rgba(248, 214, 140, 0.56);
  background: linear-gradient(180deg, rgba(250, 204, 110, 0.95), rgba(222, 164, 52, 0.86));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42),
              0 9px 24px rgba(0, 0, 0, 0.3);
}

.btn-danger,
.scene-fixture-hud-delete {
  border-color: rgba(255, 132, 151, 0.5);
  background: linear-gradient(180deg, rgba(255, 111, 133, 0.96), rgba(211, 52, 81, 0.9));
}

/* Inputs and grouped controls */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
textarea,
select,
.add-product-image-source,
.spec-fields,
.current-image-picker,
.review-scene-row {
  border-color: var(--glass-border);
  background-color: rgba(8, 25, 48, 0.44);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055),
              0 5px 16px rgba(0, 0, 0, 0.14);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  backdrop-filter: blur(14px) saturate(135%);
}

/* The colour swatch is excluded along with the checkbox/radio/file inputs:
   it's a round control, and this rule is !important. */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]),
textarea,
select {
  border-radius: 10px !important;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease,
              background-color 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(248, 194, 87, 0.72) !important;
  background-color: rgba(15, 36, 66, 0.68) !important;
  box-shadow: 0 0 0 3px rgba(75, 138, 255, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

input::placeholder,
textarea::placeholder {
  color: rgba(174, 183, 200, 0.7);
}

/* Tables, tiles, badges, and smaller layers */
.review-table th,
.review-table td,
.quote-table th,
.quote-table td,
.review-details,
.review-scenes-section {
  border-color: rgba(255, 255, 255, 0.09);
}

.review-table tbody tr,
.quote-table tbody tr {
  transition: background 0.18s ease;
}

.review-table tbody tr:hover,
.quote-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

.add-photo-tile,
.catalog-item,
.users-sidebar-item,
.photo-badge,
.quote-status-badge,
.dashboard-section-count {
  border: 1px solid var(--glass-border);
  background-color: var(--panel-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}

.add-photo-tile {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.23);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09),
              0 16px 38px rgba(0, 0, 0, 0.2);
}

.catalog-item,
.users-sidebar-item {
  border-radius: 12px;
}

.catalog-item:hover,
.users-sidebar-item:hover {
  border-color: var(--glass-border-bright);
  background-color: rgba(255, 255, 255, 0.1);
}

.photo-badge,
.scene-fixture-name-label,
.item-label-text,
.rope-name-label {
  background: rgba(11, 30, 56, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.25),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
}

.modal {
  background: rgba(2, 10, 22, 0.56);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
  backdrop-filter: blur(10px) saturate(115%);
}

.photo-stage {
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.42),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.model-3d-view-canvas {
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08),
              0 15px 36px rgba(0, 0, 0, 0.3);
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .category-header,
  .scene-modify-mode-btn,
  .catalog-item,
  .users-sidebar-item {
    transition: none;
  }
}

/* --- Final quote page: interactive 3D view block ------------------------ */

.quote-scenes {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quote-scene-block {
  border: 1px solid #26446f;
  border-radius: 10px;
  padding: 1rem;
}

.quote-scene-block h3 {
  margin: 0 0 0.6rem;
}

.quote-scene-canvas {
  display: block;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 900 / 560;
  border-radius: 8px;
  background: #000;
  margin-top: 0.75rem;
}

.quote-scene-canvas[hidden] {
  display: none;
}

/* --- Drag-and-drop file upload -------------------------------------------
   Highlight shown while dragging a file over a drop zone (see
   wireFileDropZone in drag-drop.js) — an outline rather than a border on
   each, so it doesn't shift any layout when it toggles on/off. */
#photo-stage-container.drag-over {
  outline: 3px dashed var(--accent);
  outline-offset: -3px;
  background: rgba(110, 168, 254, 0.08);
  border-radius: 12px;
}

.upload-picker.drag-over,
.model3d-picker.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 6px;
  border-radius: 8px;
}

/* --- Shared navigation and home --------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 600;
  min-height: var(--site-nav-height);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.55rem 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(9, 27, 51, 0.7);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
}

/* The product drawer header contains the Add Product button. Keep the
   entire drawer below the sticky shared navigation instead of letting its
   first row sit hidden underneath that bar. */
.product-sidebar {
  top: var(--site-nav-height);
}

/* These drawer handles originally sat below a single page header. The
   shared site navigation adds another bar above it, so include that height
   and keep the handles clear of the page title and toolbar. */
.users-toggle-btn {
  top: calc(var(--site-nav-height) + 5rem);
}

/* The builder page stacks the quote-details bar (name/address —
   see index.html) under its header, so its handle sits lower than
   .users-toggle-btn above to clear those inputs instead of covering them. */
.catalog-toggle-btn {
  top: calc(var(--site-nav-height) + 8.5rem);
}

.site-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  border-radius: 8px;
}

.brand-name {
  display: block;
  width: auto;
  height: 1.35rem;
}

.brand-sub {
  padding: 0.12rem 0.45rem;
  border: 1px solid rgba(248, 194, 87, 0.45);
  border-radius: 999px;
  color: #f8c257;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand-mark-large {
  display: flex;
  justify-content: center;
}

.brand-mark-large .brand-mark {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 14px;
}

.login-subtitle {
  margin: -0.5rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.site-nav-tab {
  padding: 0.45rem 0.8rem;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.site-nav-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
}

.site-nav-tab.active {
  color: #fff;
  background: rgba(248, 194, 87, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 5px 14px rgba(0, 0, 0, 0.15);
}

.site-nav .user-bar-info {
  margin-left: auto;
}

.home-hero {
  position: relative;
  min-height: calc(100vh - 58px);
  overflow: hidden;
  padding: clamp(5rem, 10vw, 9rem) clamp(1.25rem, 6vw, 6rem) 7rem;
}

.home-title-backdrop {
  position: absolute;
  top: clamp(1rem, 5vw, 4rem);
  left: 50%;
  width: 110%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.025);
  font-size: clamp(5rem, 15vw, 15rem);
  font-weight: 850;
  line-height: 0.78;
  letter-spacing: -0.085em;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}

.home-intro,
.home-pending,
.home-users,
.home-demo {
  position: relative;
  z-index: 1;
}

.home-intro {
  max-width: 880px;
  margin: 0 auto clamp(5rem, 10vw, 9rem);
  text-align: center;
}

.home-eyebrow {
  margin: 0 0 0.8rem;
  color: #fbe0a8;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.home-intro h1 {
  margin: 0;
  /* Room below the baseline so the gradient-clipped text keeps the
     descender of the "g" in Lighting. */
  padding-bottom: 0.12em;
  font-size: clamp(3.2rem, 8vw, 7.4rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
  background: linear-gradient(180deg, #fff 12%, #c8d3e6 86%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-lead {
  max-width: 680px;
  margin: 1.5rem auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.65;
}

.home-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.home-cta {
  min-height: 46px;
  padding-inline: 1.25rem;
  justify-content: center;
}

/* Accounts that registered and can't log in until approved. Sits above
   the Users card in the danger tint so it isn't mistaken for decoration —
   these people are locked out until somebody acts. */
.home-pending {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  width: min(1180px, 100%);
  margin: 0 auto 1.5rem;
  padding: 1rem clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--danger);
  border-radius: 16px;
  background: rgba(255, 84, 112, 0.12);
}

.home-pending h2 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  color: var(--danger);
}

.home-pending p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.home-pending .btn {
  text-decoration: none;
}

.home-users {
  width: min(1180px, 100%);
  margin: 0 auto clamp(5rem, 9vw, 8rem);
  padding: clamp(1.15rem, 3vw, 2rem);
  border: 1px solid var(--glass-border);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035));
  box-shadow: var(--glass-shadow), inset 0 1px rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.home-users-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.home-users-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.045em;
}

.home-users-heading p:last-child {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.home-user-total {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
}

.home-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.7rem;
}

.home-user-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 0.8rem;
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: rgba(8, 25, 48, 0.38);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.home-user-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-bright);
  background: rgba(248, 194, 87, 0.1);
}

.home-user-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(248, 194, 87, 0.42), rgba(204, 146, 38, 0.35));
  font-weight: 800;
}

.home-user-details {
  display: grid;
  min-width: 0;
}

.home-user-details strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-user-details span,
.home-user-quotes {
  color: var(--muted);
  font-size: 0.76rem;
}

.home-user-arrow {
  color: #fbe0a8;
  font-size: 1.5rem;
}

.home-demo {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.home-demo-copy {
  max-width: 600px;
  margin-bottom: 1.5rem;
}

.home-demo-copy h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.home-demo-copy > p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.home-demo-window {
  overflow: hidden;
  border: 1px solid var(--glass-border-bright);
  border-radius: 20px;
  background: rgba(8, 25, 48, 0.8);
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.home-demo-browser-bar {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.055);
}

.home-demo-browser-bar > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.23);
}

.home-demo-browser-bar div {
  min-width: 190px;
  margin: 0 auto;
  padding: 0.3rem 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-size: 0.7rem;
  text-align: center;
}

.home-demo-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a1f3b;
  object-fit: cover;
}

@media (max-width: 700px) {
  .site-nav {
    gap: 0.5rem;
    padding-inline: 0.75rem;
    flex-wrap: wrap;
  }

  .home-users-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-toggle-btn,
  .users-toggle-btn {
    top: auto;
    bottom: 1rem;
  }

  /* Just the EG mark: the name and "Staff" don't fit beside the tabs. */
  .site-nav-brand .brand-name,
  .site-nav-brand .brand-sub {
    display: none;
  }

  /* Every tab on one line, the row scrolling sideways when there are more
     than fit (the owner has six), instead of widening the page. */
  .site-nav-tabs {
    order: 1;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-nav-tab {
    flex: none;
    white-space: nowrap;
  }

  .site-nav .user-bar-info {
    margin-left: auto;
    font-size: 0.75rem;
  }

  .home-hero {
    padding-top: 4.5rem;
  }

  .home-intro h1 {
    font-size: clamp(3rem, 16vw, 5rem);
  }

  .home-demo-window {
    border-radius: 16px;
  }
}

/* --- Glass sweep ---------------------------------------------------------
   Chrome that was added after (or slipped past) the liquid-glass pass
   above, brought onto the same material so no surface on any page still
   reads as flat: the builder's quote-details bar, the Manage-user and Add
   Product fieldsets, the Add Product pickers and previews, the quote
   page's 3D-scene block, and the email preview frame. Lives at the end of
   the file so it wins the cascade over each component's original styles. */

/* The name/address bar under the builder header — same tone and
   blur as .app-header directly above it, reading as one continuous run
   of header glass. */
.quote-details-bar {
  border: 0;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(17, 39, 72, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16),
              inset 0 -1px 0 rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

/* Grouped sections: the same soft inset panel .fixture-sharing-fieldset
   and .product-price-tiers already use. */
.manage-user-section,
.add-product-specs,
.quote-scene-block,
.bend-config {
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Option tiles and preview canvases in the Add Product modal — dark
   translucent wells like the global glass input treatment. */
.shape-option,
.new-product-image-preview,
.new-product-model-preview,
.bend-preview-canvas {
  border-color: var(--glass-border);
  background-color: rgba(8, 25, 48, 0.44);
}

.shape-option:hover {
  border-color: var(--glass-border-bright);
  background-color: rgba(255, 255, 255, 0.08);
}

/* Bend-axis choices get the same interactive glass as .btn (their .active
   accent state, defined earlier, still wins on top of this base). */
.bend-axis-btn {
  border-color: var(--glass-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.055));
  color: var(--text);
  border-radius: 10px;
}

.bend-axis-btn:hover {
  border-color: var(--glass-border-bright);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.085));
}

.email-preview-frame {
  border-color: var(--glass-border);
}

.users-sidebar-divider {
  background: rgba(255, 255, 255, 0.12);
}

/* Airier interactive glass: the same button/tab material as before, with
   the white fill pulled down so the page reads through every control —
   requested after the drawer transparency pass. Hover states (defined
   earlier with higher specificity) still brighten on top of this. */
.btn,
.users-toggle-btn,
.catalog-toggle-btn,
.fullscreen-tools-toggle-btn,
.category-header,
.add-product-btn,
.scene-measure-btn,
.scene-modify-mode-btn,
.scene-modify-close-btn,
.scene-fixture-hud-btn,
.bend-axis-btn {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09),
              0 7px 18px rgba(0, 0, 0, 0.14);
}

/* Accent (primary/active) and danger fills go translucent too — the blur
   underneath keeps them readable while the page glows through. These
   re-assert after the airy base above so primaries stay blue. */
.btn-primary,
.scene-modify-mode-btn.active,
.users-sidebar-item.active {
  background: linear-gradient(180deg, rgba(250, 204, 110, 0.62), rgba(222, 164, 52, 0.48));
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}

.btn-danger,
.scene-fixture-hud-delete {
  background: linear-gradient(180deg, rgba(255, 111, 133, 0.6), rgba(211, 52, 81, 0.48));
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}

.product-asset-tab.active {
  background: linear-gradient(180deg, rgba(246, 190, 78, 0.55), rgba(204, 146, 38, 0.42));
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
}

.site-nav-tab.active {
  background: rgba(248, 194, 87, 0.17);
}

/* The catalog's collapsible category rows and product tiles follow the
   drawer: mostly blur, only a whisper of fill. */
.catalog-item {
  background-color: rgba(255, 255, 255, 0.045);
}

/* --- Admin dashboard (see admin_dashboard.html / build_admin_dashboard in
   app.py): stat tiles, server-rendered SVG column charts, labeled stage
   and fixture bars, per-user table, activity feed. --- */
.dashboard-admin-page {
  /* Same width as Saved Quotes (.quotes-dashboard) so every section of
     the site reads at one consistent, roomy width. */
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.dash-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.4rem;
}

.dash-tile {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--glass-highlight), rgba(255, 255, 255, 0.02)), var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.dash-tile-label {
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-tile-value {
  font-size: 1.65rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.dash-tile-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.dash-grid {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}

.dash-grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
}

.dash-card {
  padding: 1rem 1.15rem 1.1rem;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--glass-highlight), rgba(255, 255, 255, 0.02)), var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  overflow-x: auto;
}

.dash-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.dash-hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.dash-chart {
  display: block;
  width: 100%;
  height: auto;
}

.dash-bar {
  fill: var(--accent);
}

.dash-bar:hover {
  fill: #fbe0a8;
}

.dash-gridline {
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 1;
}

.dash-axis-text {
  fill: var(--muted);
  font-size: 11px;
}

.dash-cap-text {
  fill: var(--text);
  font-size: 11px;
  font-weight: 600;
}

.dash-bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 150px) 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.28rem 0;
  font-size: 0.82rem;
}

.dash-bar-row-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-swatch {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.dash-bar-track {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.dash-bar-fill {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--accent);
  min-width: 2px;
}

.dash-bar-row-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Pipeline stage rows are links through to that stage's quote list. */
.dash-bar-row-link {
  text-decoration: none;
  color: inherit;
  border-radius: 9px;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  margin: 0 -0.35rem;
  transition: background 0.15s ease;
}

.dash-bar-row-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.dash-table td,
.dash-table th {
  font-variant-numeric: tabular-nums;
}

.dash-role-note {
  font-size: 0.7rem;
  color: var(--muted);
}

/* The Recent activity heading links through to the full /admin/activity
   page — same look as a plain heading, with a quiet "View all" cue. */
.dash-activity-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
}

.dash-activity-more {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.dash-activity-link:hover .dash-activity-more {
  color: var(--accent);
}

.dash-activity {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.84rem;
}

.dash-activity-when {
  display: inline-block;
  min-width: 84px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* --- Public quote acceptance page (see public_quote.html) + the internal
   Accepted badge on the quote page. --- */
.public-quote-page {
  max-width: 800px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

.public-quote-header {
  margin-bottom: 1.5rem;
}

.public-quote-header h1 {
  margin: 0.1rem 0 0.3rem;
}

.public-quote-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.public-quote-note {
  margin: 0.8rem 0 0;
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--accent);
  background: rgba(248, 194, 87, 0.08);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.public-accept-card {
  margin: 1.5rem 0;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--glass-highlight), rgba(255, 255, 255, 0.02)), var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.public-accept-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.public-accept-card.public-accept-done {
  border-color: rgba(74, 222, 128, 0.4);
  background: rgba(74, 222, 128, 0.08);
}

.public-accept-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.public-accept-row input {
  flex: 1 1 240px;
  padding: 0.6rem 0.7rem;
}

.public-accept-status {
  min-height: 1em;
  margin: 0.5rem 0 0;
  color: var(--danger);
  font-size: 0.82rem;
}

.public-quote-footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.quote-status-badge.quote-accepted-badge {
  background: rgba(74, 222, 128, 0.18);
  color: #4ade80;
}

/* --- Admin dropdown in the site nav (see base.html) ----------------------
   The role badge doubles as the menu button for admins; the panel that
   drops from it holds Dashboard / Users. */
.admin-menu {
  position: relative;
  display: inline-flex;
}

.admin-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.6rem;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--accent);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 650;
  text-transform: capitalize;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.admin-menu-btn:hover,
.admin-menu-btn.open {
  background: rgba(248, 194, 87, 0.16);
  border-color: rgba(248, 194, 87, 0.45);
}

/* Lit while any admin page is open, so moving the tabs into the menu
   doesn't lose the "you are here" cue. */
.admin-menu-btn.active {
  background: rgba(248, 194, 87, 0.22);
  border-color: rgba(248, 194, 87, 0.55);
  color: #fff;
}

.admin-menu-caret {
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.admin-menu-btn.open .admin-menu-caret {
  transform: rotate(180deg);
}

.admin-menu-list {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 700;
  min-width: 170px;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: linear-gradient(145deg, var(--glass-highlight), rgba(255, 255, 255, 0.02)), rgba(17, 39, 72, 0.9);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.admin-menu-list[hidden] {
  display: none;
}

.admin-menu-item {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.admin-menu-item:hover,
.admin-menu-item:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  outline: none;
}

.admin-menu-item.active {
  color: #fff;
  background: rgba(248, 194, 87, 0.22);
}

/* --- Owner "View as" switcher + preview banner (see base.html) ---------- */
.owner-menu-btn {
  color: #ffc759;
  border-color: rgba(255, 199, 89, 0.35);
}

.owner-menu-btn:hover,
.owner-menu-btn.open {
  background: rgba(255, 199, 89, 0.14);
  border-color: rgba(255, 199, 89, 0.5);
}

/* Mid-preview the button itself says which level is active. */
.owner-menu-btn.previewing {
  background: rgba(255, 199, 89, 0.2);
  border-color: rgba(255, 199, 89, 0.6);
  color: #ffe1a3;
}

.owner-menu-list {
  /* Compact: level names only, no descriptions. */
  min-width: 200px;
  max-width: 280px;
}

.owner-menu-form {
  display: contents;
}

.owner-menu-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: normal;
}

.owner-menu-item-title {
  font-weight: 650;
  color: inherit;
}

.owner-menu-item.active .owner-menu-item-title::after {
  content: " · current";
  font-weight: 500;
  color: var(--muted);
}

.owner-menu-item-desc {
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.35;
  color: var(--muted);
}

/* Manage modal footer: Delete Account sits on the far left, away from
   Cancel/Save, so it can't be hit by reflex. */
.manage-user-actions .manage-user-delete-btn {
  margin-right: auto;
}

/* The count badge next to a big page title (Users, etc.) — spaced off
   the word and centered on the title's midline instead of sitting on its
   baseline where it crowded the last letter. */
.admin-users-header h1 .dashboard-section-count {
  margin-left: 0.6rem;
  top: -0.15em;
  min-width: 1.9rem;
  height: 1.9rem;
  font-size: 0.95rem;
}

/* "Highlight Fixtures" toggle above a quote's photos (quote page and the
   customer's online copy). */
.quote-photos-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 0.75rem;
}

.quote-photos-tools-hint {
  font-size: 0.82rem;
  color: var(--muted);
}

/* --- Settings page (see settings.html): the email signature form and its
   live preview. --- */
.settings-page {
  max-width: 1100px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.settings-field input {
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  color: var(--text);
}

.settings-static-value {
  color: var(--text);
  font-size: 0.95rem;
}

.settings-static-note {
  display: block;
  margin: 0.2rem 0 0;
}

.settings-status {
  margin: 0;
  font-size: 0.85rem;
}

.settings-status-error {
  color: var(--danger);
}

.settings-status-ok {
  color: #4ade80;
}

.settings-actions {
  justify-content: flex-end;
}

/* Rendered on white because that's where the signature actually lives —
   the customer's email client. */
.settings-signature-preview {
  padding: 0.25rem 1.1rem 1.1rem;
  border-radius: 12px;
  background: #ffffff;
  color: #13233d;
  font-family: Arial, sans-serif;
}

/* A thin rule above the Settings item in the admin dropdown, separating
   the "manage the site" pages from "your account". */
.admin-menu-item-divided {
  margin-top: 0.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 8px 8px;
  padding-top: 0.6rem;
}

/* Settings: the standalone Account email section — one input with its own
   Save button on the same row. */
.settings-email-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.settings-field-grow {
  flex: 1 1 320px;
}

.settings-email-save {
  flex: 0 0 auto;
}

/* Settings: the signature photo/logo — current image thumbnail with its
   remove checkbox, above the file picker. */
.settings-sig-image-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0.15rem 0 0.35rem;
}

.settings-sig-image-thumb {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.settings-sig-image-remove {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.settings-sig-image-field input[type="file"] {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Users page: the header's account badge + "Add Users" button pair, the
   invite modal's email box and per-address results, and the Pending
   invitations table. */
.admin-users-header-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.admin-invite-open-btn span {
  font-weight: 700;
  margin-right: 0.15rem;
}

#invite-emails {
  width: 100%;
  resize: vertical;
  padding: 0.6rem 0.7rem;
  font-size: 0.95rem;
  color: var(--text);
  background: rgba(9, 27, 51, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}

.admin-invite-results {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 200px;
  overflow-y: auto;
}

.admin-invite-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  font-size: 0.88rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.admin-invite-result-sent { color: #4ade80; }
.admin-invite-result-email-failed { color: #fbbf24; }
.admin-invite-result-already-account,
.admin-invite-result-invalid { color: var(--muted); }

.admin-invites-section {
  margin-top: 1.6rem;
}

.admin-invites-heading {
  padding: 0 0 0.7rem;
}

.admin-invites-heading h2 {
  margin: 0 0 0.2rem;
  font-size: 1.15rem;
}

.admin-invite-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Login: the forgot-credentials link under the button, and the forgot
   page's what-did-you-forget choice. */
/* "Remember me" (login.html): a checkbox row, not the stacked label above. */
.login-card label.login-remember {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  margin-top: -0.25rem;
  color: var(--text);
  cursor: pointer;
}

.login-card .login-remember input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.login-forgot-link {
  display: block;
  text-align: center;
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
}

.login-forgot-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.forgot-kind {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.7rem 0.9rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.forgot-kind .admin-user-tier-option {
  /* The login card lays labels out as columns; these are radio rows. */
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.forgot-kind legend {
  padding: 0 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Settings: the change-password row — three fields and the save button,
   wrapping on narrow screens like the email row does. */
.settings-password-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.settings-password-row .settings-field-grow {
  flex: 1 1 200px;
}

/* The Add Users modal, de-boxed: no fieldset frames — small uppercase
   labels over airy option lists, in two columns (who they are on the left,
   pricing on the right) separated by a soft divider instead of borders. */
.invite-settings-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1.8rem;
  padding: 0.35rem 0.2rem;
}

.invite-settings-col {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.invite-settings-grid > .invite-settings-col + .invite-settings-col,
.invite-settings-grid > fieldset.invite-settings-col {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding-left: 1.8rem;
}

#invite-users-modal .manage-user-section {
  border: none;
  border-radius: 0;
  padding: 0;
  gap: 0.6rem;
  width: 100%;
  /* Undo the shared glass-panel treatment — this modal is deliberately
     de-boxed. */
  background: none;
  box-shadow: none;
}

#invite-users-modal .manage-user-section legend {
  padding: 0;
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

#invite-users-modal .invite-settings-grid .manage-user-tier-options {
  flex-direction: column;
  gap: 0.55rem;
}

@media (max-width: 640px) {
  .invite-settings-grid {
    grid-template-columns: 1fr;
  }
  .invite-settings-grid > .invite-settings-col + .invite-settings-col,
  .invite-settings-grid > fieldset.invite-settings-col {
    border-left: none;
    padding-left: 0;
  }
}

/* Narrow left-aligned confirmation modal, shared by several pages. */
.addon-confirm-content {
  width: min(430px, calc(100vw - 2rem));
  text-align: left;
}

/* The photo's Measure Scale button — same glass pill as the fixture-count
   badge, anchored to the opposite corner. Hidden while fullscreen (the
   calibration flow itself runs fullscreen with its own HUD). */
.photo-measure-btn {
  position: absolute;
  left: 0.55rem;
  bottom: 0.55rem;
  z-index: 58;
  padding: 0.38rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(12, 32, 60, 0.68);
  color: var(--muted);
  font: 600 0.7rem/1 var(--font);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(12px) saturate(145%);
  backdrop-filter: blur(12px) saturate(145%);
}

.photo-measure-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.35);
}

.photo-stage.fullscreen-mode .photo-measure-btn {
  display: none;
}

/* Photo scale calibration — the full-screen intro, then the docked panel
   that takes over once the photo is fullscreen. */
.photo-scale-intro {
  width: min(560px, calc(100vw - 2rem));
  text-align: left;
}

.photo-scale-intro h2 {
  margin: 0.15rem 0 0.6rem;
  font-size: 1.6rem;
}

.photo-scale-intro > p {
  color: var(--muted);
  line-height: 1.5;
}

.photo-scale-steps {
  margin: 0.9rem 0;
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  line-height: 1.45;
}

.photo-scale-steps strong {
  color: var(--text);
}

.photo-scale-panel {
  position: fixed;
  top: 50%;
  right: 1.5rem;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 260px;
  padding: 1rem 1.05rem;
  background: rgba(14, 33, 60, 0.95);
  border: 1px solid #26446f;
  border-radius: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  /* Above the fullscreen photo (500) like the rope/measure HUDs. */
  z-index: 570;
}

.photo-scale-panel[hidden] {
  display: none;
}

.photo-scale-panel-step {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.photo-scale-panel-title {
  margin: 0;
  font-size: 1.05rem;
}

.photo-scale-panel-hint {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

.photo-scale-distance {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.2rem;
}

.photo-scale-distance[hidden] {
  display: none;
}

.photo-scale-distance label {
  font-size: 0.85rem;
  color: var(--muted);
}

.photo-scale-distance-input {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.photo-scale-distance-input input {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  font-size: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(7, 22, 42, 0.6);
  color: var(--text);
}

.photo-scale-distance-input span {
  color: var(--muted);
  font-weight: 600;
}

.photo-scale-panel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 0.2rem;
}

/* Fixture size lock (product.allow_manual_size, set in the Add/Edit Product
   window): placed fixtures are sized by the builder from the photo's
   measured scale, so the resize/stretch handles only exist for products
   that explicitly allow manual sizing. */
.placed-item.size-locked .handle-resize,
.placed-item.size-locked .handle-stretch {
  display: none;
}

/* A locked rope's footage badge is a read-out, not a button. */
.rope-footage-btn.rope-footage-locked {
  cursor: default;
  border-color: rgba(255, 255, 255, 0.25);
}

/* While points are being clicked out (rope placement, photo scale
   calibration — see setPointPlacementMode in placement.js), everything
   already on the photo is inert so clicks fall through to the photo. */
body.placing-points .placed-item,
body.placing-points .rope-layer,
body.placing-points .rope-delete-btn,
body.placing-points .rope-footage-btn,
body.placing-points .rope-edit-points-btn,
body.placing-points .rope-name-label,
body.placing-points .rope-edit-dot,
body.placing-points .item-footage-btn {
  pointer-events: none;
}

/* Layering on a photo: ropes are always the bottom layer, point fixtures
   above them, whatever order they were placed in (getRopeLayer in
   placement.js also inserts the rope SVG right after the photo, so this
   pins the same order even if the DOM sequence ever differs). The rope's
   own HTML controls (delete/footage/edit-points, z-index 12) still float
   above everything so they stay clickable. */
/* Night view: an evening-blue wash over the photo, under every fixture
   (rope layer z-index 1, fixtures 2), so the lights stay bright on top.
   main.js's applyNightLevel sets the strength for every photo at once. */
/* The Home Designer's time of day (design.js): the light's color,
   multiplied over the photo, under the darkening wash below. */
.photo-content > .photo-time-tint {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--time-tint-color, #fff);
  opacity: var(--time-tint-opacity, 0);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.photo-content > .photo-night-shade {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--night-shade-color, rgb(6, 10, 26));
  opacity: var(--night-shade-opacity, 0);
  pointer-events: none;
}

.photo-content > .rope-layer {
  z-index: 1;
}

/* Downlights relighting the photo (light-map.js): a copy of the untouched
   photo times the light map (a canvas, each bulb's light on black), added over
   the photo as darkened for the time of day. Just under the ropes (first
   in the DOM at the same z-index). Added with plus-lighter where the
   browser has it; screen is the near match where it doesn't, and either
   way black adds nothing. */
.photo-content > .rope-lit-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  isolation: isolate;
  mix-blend-mode: screen;
}

@supports (mix-blend-mode: plus-lighter) {
  .photo-content > .rope-lit-layer {
    mix-blend-mode: plus-lighter;
  }
}

/* The brightness slider (applyBrightness in look-picker.js) scales the
   photo copy, which scales the light added (copy times map) just the same.
   Never on .rope-lit-layer itself: Safari ignores an element's blend mode
   when it also has a filter, and the layer then covers the photo instead
   of adding light to it, blacking it out everywhere but under the bulbs. */
.rope-lit-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(var(--light-brightness, 1));
}

/* Painted at a fraction of the size and smoothed up: the light is soft.
   A pixel past the photo copy on every side, so where the browser rounds
   the copy's edge a pixel wider than the map, that edge isn't left
   unmultiplied and added on as a bright line. */
.rope-lit-layer > .rope-light-map {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  mix-blend-mode: multiply;
}

.photo-content > .placed-item {
  z-index: 2;
}

/* Tools panel: the Layers dropdown. */
.layers-section {
  margin-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.6rem;
}

.layers-section[hidden] {
  display: none;
}

.layers-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.layers-toggle-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
}

.layers-toggle-caret {
  transition: transform 0.15s ease;
}

.layers-toggle.open .layers-toggle-caret {
  transform: rotate(180deg);
}

.layers-list {
  list-style: none;
  margin: 0.45rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.layers-list[hidden] {
  display: none;
}

.layers-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name controls" "count controls";
  align-items: center;
  column-gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
}

.layers-row-name {
  grid-area: name;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.layers-row-count,
.layers-row-note {
  grid-area: count;
  font-size: 0.72rem;
  color: var(--muted);
}

.layers-row-rope .layers-row-count {
  grid-area: count;
}

.layers-row-rope .layers-row-note {
  grid-area: controls;
  font-style: italic;
}

.layers-row-controls {
  grid-area: controls;
  display: flex;
  gap: 0.25rem;
}

.layers-move-btn {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(7, 22, 42, 0.5);
  color: var(--text);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
}

.layers-move-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

/* Layer solo view (see setSoloLayer in main.js): everything outside the
   chosen layer is hidden; the chosen row lights up. */
.layer-hidden {
  display: none !important;
}

.layers-row {
  cursor: pointer;
}

.layers-row:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.layers-row.active {
  border-color: var(--accent);
  background: rgba(222, 164, 52, 0.16);
}

.layers-show-all {
  width: 100%;
  margin-top: 0.45rem;
}

.layers-show-all[hidden] {
  display: none;
}

/* Fixtures are only editable inside a fullscreen (double-clicked) photo.
   In the grid — zoomed or not — everything placed is inert, so a stray
   click while browsing can't select, drag, or resize anything. The photo
   itself still takes drops, clicks, and the double-click to open. */
.photo-stage:not(.fullscreen-mode) .placed-item,
.photo-stage:not(.fullscreen-mode) .rope-layer,
.photo-stage:not(.fullscreen-mode) .rope-delete-btn,
.photo-stage:not(.fullscreen-mode) .rope-footage-btn,
.photo-stage:not(.fullscreen-mode) .rope-edit-points-btn,
.photo-stage:not(.fullscreen-mode) .rope-name-label,
.photo-stage:not(.fullscreen-mode) .rope-edit-dot,
.photo-stage:not(.fullscreen-mode) .item-footage-btn {
  pointer-events: none;
}

/* .rope-hit declares its own pointer-events (stroke), which beats the
   inherited none from .rope-layer above — it needs switching off explicitly
   wherever ropes are meant to be inert. */
.photo-stage:not(.fullscreen-mode) .rope-hit,
body.placing-points .rope-hit {
  pointer-events: none;
}

/* Waiting for the click that says where a new row goes (see placeRowByClick
   in main.js) — a crosshair over the whole photo, including the zoomed-in
   state that otherwise shows the pan grab cursor. */
body.placing-row .photo-stage.fullscreen-mode,
body.placing-row .photo-stage.fullscreen-mode.zoomed-in,
body.placing-row .photo-stage.fullscreen-mode .photo-content {
  cursor: crosshair;
}

/* Light shows (body.light-show + body[data-light-show], picked in the Tools
   panel's Light Show section): ropes and tube fixtures animate in the
   builder instead of sitting as a static yellow. Every show is built from
   the same parts — the rope's core/glow color, and two phase-offset runs of
   dashed "bulbs" (.rope-show-a / .rope-show-b) chasing along the core —
   plus a matching filter animation on tube fixtures. Preview only; the
   baked quote images are unaffected.
   Every animation uses steps() timing on purpose: the browser repaints only
   when a step changes (~10-12 times a second) instead of every frame, which
   is what keeps a photo full of ropes smooth to work on — and chasing
   bulbs step in real life anyway. */
.rope-show {
  display: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

body.light-show .rope-item .rope-show {
  display: block;
}

/* While any show runs, the rope reads as a warm-white lit tube rather
   than the flat yellow line — the bulbs carry the color. */
body.light-show .rope-item .rope-core {
  stroke: #ffe9c2;
}

body.light-show .rope-item .rope-glow {
  stroke: #ffd6a0;
  opacity: 0.55;
}

@keyframes bulbs-run {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -48; }
}

@keyframes bulbs-run-slow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -48; }
}

@keyframes color-cycle {
  0%   { stroke: #ff3b3b; }
  20%  { stroke: #ffb300; }
  40%  { stroke: #3bff6a; }
  60%  { stroke: #2ec4ff; }
  80%  { stroke: #b06bff; }
  100% { stroke: #ff3b3b; }
}

@keyframes twinkle-a {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.15; }
}

@keyframes twinkle-b {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 1; }
}

/* --- Chase (default): warm pulses of light travelling along the rope —
   a bright amber head with a softer, blurred tail fading out behind it,
   over a dim ember core. No hard white segments; everything is warm and
   fades. */
body.light-show .rope-item[data-light-show="chase"] .rope-core {
  stroke: #8a5a2a;
}

body.light-show .rope-item[data-light-show="chase"] .rope-glow {
  stroke: #ff9a3c;
  opacity: 0.35;
}

@keyframes chase-fade {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

@keyframes chase-fade-tail {
  0%, 100% { opacity: 0.15; }
  50%      { opacity: 0.45; }
}

@keyframes chase-fade-glow {
  0%, 100% { opacity: 0.5; }
  50%      { opacity: 0.15; }
}

body.light-show .rope-item[data-light-show="chase"] .rope-glow {
  animation: chase-fade-glow 2.4s steps(24) infinite;
}

body.light-show .rope-item[data-light-show="chase"] .rope-show-a {
  stroke: #ffb757;
  stroke-width: 5;
  stroke-dasharray: 10 38;
  /* Runs along the rope while breathing bright-to-dim — the fade. */
  animation: bulbs-run 0.9s steps(12) infinite, chase-fade 2.4s steps(24) infinite;
}

body.light-show .rope-item[data-light-show="chase"] .rope-show-b {
  /* The tail: a longer, wider, blurred run just behind each head, at low
     opacity — reads as the light fading away as it moves on. */
  stroke: #ff9a3c;
  stroke-width: 8;
  stroke-dasharray: 22 26;
  stroke-dashoffset: -14;
  opacity: 0.3;
  /* No blur filter (see .rope-glow) — the wider, fainter stroke reads as
     the fade without a per-frame filter pass. */
  /* The tail swells as the head dims and vice versa, so the light seems
     to hand off along the rope rather than blink. */
  animation: bulbs-run 0.9s steps(12) infinite, chase-fade-tail 2.4s steps(24) infinite;
}

/* Segmented lights have no strand to run along: the alternate bulbs on the
   two runs breathe out of step instead, handing the light bulb to bulb. */
body.light-show .rope-segmented[data-light-show="chase"] .rope-show-b {
  stroke: #ffb757;
  stroke-width: 4.6;
  opacity: 1;
  animation: chase-fade 2.4s steps(24) -1.2s infinite;
}

/* --- Rainbow: the core and glow cycle through the spectrum while white
   bulbs run along the rope. */
body.light-show .rope-item[data-light-show="rainbow"] .rope-core,
body.light-show .rope-item[data-light-show="rainbow"] .rope-glow {
  animation: color-cycle 6s steps(60) infinite;
}

body.light-show .rope-item[data-light-show="rainbow"] .rope-show-a {
  stroke: #ffffff;
  stroke-dasharray: 4 20;
  animation: bulbs-run 1s steps(12) infinite;
}

body.light-show .rope-item[data-light-show="rainbow"] .rope-show-b {
  display: none;
}

/* --- Twinkle: two interleaved runs of bulbs fading in and out of step,
   no travel — the lights sparkle in place. */
body.light-show .rope-item[data-light-show="twinkle"] .rope-show-a {
  stroke: #ffffff;
  stroke-dasharray: 5 19;
  animation: twinkle-a 1.4s steps(14) infinite;
}

body.light-show .rope-item[data-light-show="twinkle"] .rope-show-b {
  stroke: #fff1b8;
  stroke-dasharray: 5 19;
  stroke-dashoffset: -12;
  animation: twinkle-b 1.4s steps(14) infinite;
}

/* --- Red & Green: alternating red and green bulbs chasing together. */
body.light-show .rope-item[data-light-show="redgreen"] .rope-show-a {
  stroke: #ff2e2e;
  stroke-dasharray: 8 16;
  animation: bulbs-run 1.2s steps(12) infinite;
}

body.light-show .rope-item[data-light-show="redgreen"] .rope-show-b {
  stroke: #2eff5e;
  stroke-dasharray: 8 16;
  stroke-dashoffset: -12;
  animation: bulbs-run 1.2s steps(12) infinite;
}

/* --- Home Designer shows (SHOWS in design.js): two alternating bulb
   colors each, and Custom: one color for every bulb, a white picked by
   color temperature or a color off the designer's wheel (--custom-light). Static: holiday sets are about the colors. */
body.light-show .rope-item[data-light-show="july"] .rope-show-a { stroke: #ff2e2e; }
body.light-show .rope-item[data-light-show="july"] .rope-show-b { stroke: #3b6bff; }
body.light-show .rope-item[data-light-show="halloween"] .rope-show-a { stroke: #ff7a1a; }
body.light-show .rope-item[data-light-show="halloween"] .rope-show-b { stroke: #9b4dff; }
body.light-show .rope-item[data-light-show="valentine"] .rope-show-a { stroke: #ff4d8d; }
body.light-show .rope-item[data-light-show="valentine"] .rope-show-b { stroke: #ff1f3d; }

body.light-show .rope-item[data-light-show="custom"] .rope-core,
body.light-show .rope-item[data-light-show="custom"] .rope-show-a,
body.light-show .rope-item[data-light-show="custom"] .rope-show-b {
  stroke: var(--custom-light, #ffc35c);
}

/* --- Steady Warm: no motion — a soft, evenly lit warm-white rope. */
body.light-show .rope-item[data-light-show="steady"] .rope-show-a {
  stroke: #fff4d6;
  stroke-dasharray: 5 9;
  opacity: 0.9;
}

body.light-show .rope-item[data-light-show="steady"] .rope-show-b {
  display: none;
}

body.light-show .rope-item[data-light-show="steady"] .rope-glow {
  opacity: 0.75;
}

/* --- Tube fixtures, per show. */
@keyframes fixture-hue-cycle {
  from { filter: hue-rotate(0deg) drop-shadow(0 0 6px rgba(255, 120, 60, 0.75)); }
  to   { filter: hue-rotate(360deg) drop-shadow(0 0 6px rgba(255, 120, 60, 0.75)); }
}

@keyframes fixture-chase {
  0%   { filter: brightness(0.9) drop-shadow(0 0 3px rgba(255, 200, 120, 0.5)); }
  50%  { filter: brightness(1.35) drop-shadow(0 0 10px rgba(255, 230, 170, 0.95)); }
  100% { filter: brightness(0.9) drop-shadow(0 0 3px rgba(255, 200, 120, 0.5)); }
}

@keyframes fixture-twinkle {
  0%, 100% { filter: brightness(1.3) drop-shadow(0 0 8px rgba(255, 255, 255, 0.9)); }
  50%      { filter: brightness(0.85) drop-shadow(0 0 2px rgba(255, 255, 255, 0.3)); }
}

@keyframes fixture-redgreen {
  0%, 45%   { filter: drop-shadow(0 0 8px rgba(255, 46, 46, 0.95)) saturate(1.3); }
  55%, 100% { filter: drop-shadow(0 0 8px rgba(46, 255, 94, 0.95)) saturate(1.3); }
}

body.light-show .placed-item.light-show-fixture[data-light-show="chase"] .item-img {
  animation: fixture-chase 0.8s steps(10) infinite;
}

body.light-show .placed-item.light-show-fixture[data-light-show="rainbow"] .item-img {
  animation: fixture-hue-cycle 6s steps(60) infinite;
}

body.light-show .placed-item.light-show-fixture[data-light-show="twinkle"] .item-img {
  animation: fixture-twinkle 1.4s steps(14) infinite;
}

body.light-show .placed-item.light-show-fixture[data-light-show="redgreen"] .item-img {
  animation: fixture-redgreen 1.2s steps(1, end) infinite;
}

body.light-show .placed-item.light-show-fixture[data-light-show="steady"] .item-img {
  filter: brightness(1.15) drop-shadow(0 0 7px rgba(255, 220, 160, 0.85));
}

/* Light Show off: an RGB fixture isn't running colors, it's just on — a
   plain white light with a soft halo, matching what the quote images bake
   (see recolorFixture / drawWithWhiteGlow in composite.js). Anything that
   isn't an RGB fixture is left exactly as its artwork looks. */
body:not(.light-show) .placed-item.light-show-fixture .item-img {
  filter: saturate(0.12) brightness(1.18) drop-shadow(0 0 6px rgba(255, 255, 255, 0.85));
}

/* Reduced-motion users get the calm, still look whichever show is picked. */
@media (prefers-reduced-motion: reduce) {
  body.light-show .rope-item .rope-core,
  body.light-show .rope-item .rope-glow,
  body.light-show .rope-item .rope-show,
  body.light-show .placed-item.light-show-fixture .item-img {
    animation: none;
  }
}

/* Tools panel: a titled section (Light Show) separated from the tool
   tiles above it, matching the Layers section's divider. */
/* ---- Row of Fixtures ---------------------------------------------------
   The tool's modal (see #fixture-row-modal): two columns of short fields,
   since every one of them is a single number or pick, with the direction
   radios and the live "will it fit" note spanning the full width. */
.fixture-row-content {
  max-width: 560px;
}

/* Opened from the Tools panel while a photo is fullscreen, and a fullscreen
   stage sits at z-index 500 — above the ordinary .modal layer (100), which
   would leave this one buried behind the photo it's about to place fixtures
   on. Above the selection bar (570) too, since the row it creates selects
   itself and pops that bar up underneath. */
#fixture-row-modal {
  z-index: 600;
}

.fixture-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
  margin: 1rem 0 0.75rem;
}

.fixture-row-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 0;
}

.fixture-row-field-wide {
  grid-column: 1 / -1;
}

/* .fixture-row-field's own `display: flex` beats the browser's
   [hidden] { display: none }, so the orientation panel needs this to
   actually stay away for a static fixture. */
.fixture-row-field[hidden] {
  display: none;
}

.fixture-row-field select,
.fixture-row-field input[type="number"] {
  width: 100%;
  box-sizing: border-box;
}

/* The fixture picker: the Products sidebar's own two tabs over a scrolling
   grid of tiles, so choosing a fixture here works the way choosing one to
   drag in does. */
.fixture-row-tabs,
body.fullscreen-panels-open .fixture-row-tabs {
  /* The narrow-sidebar rules above stack these tabs and shrink their text
     to fit beside a fullscreen photo; this modal has the room for the
     normal side-by-side pair, and it's always opened from fullscreen. */
  grid-template-columns: 1fr 1fr;
  margin: 0 0 0.5rem;
}

body.fullscreen-panels-open .fixture-row-tabs .product-asset-tab {
  padding: 0.5rem 0.4rem;
  font-size: 0.78rem;
}

.fixture-row-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 0.4rem;
  max-height: 188px;
  overflow-y: auto;
  padding: 0.15rem;
}

.fixture-row-tile {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  border: 1px solid #26446f;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  min-width: 0;
}

.fixture-row-tile img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.fixture-row-tile-name {
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fixture-row-tile:hover {
  border-color: #3e4342;
}

.fixture-row-tile.active {
  border-color: var(--accent);
  background: rgba(90, 141, 238, 0.16);
}

.fixture-row-picker-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.75rem 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Only shown for a 3D fixture (see syncFixtureRowOrientation in main.js) —
   the model beside the note explaining that the pose it's dragged to is the
   pose the whole row drops in at. */
.fixture-row-orient-body {
  display: grid;
  grid-template-columns: 132px 1fr;
  align-items: center;
  gap: 0.75rem;
}

.fixture-row-model-preview {
  /* Drag turns the model, same as the Add Product modal's preview —
     touch-action off so the gesture works on touch instead of scrolling. */
  cursor: grab;
  touch-action: none;
  width: 132px;
  height: 132px;
  border-radius: 8px;
  border: 1px solid #26446f;
  background: rgba(0, 0, 0, 0.25);
}

.fixture-row-model-preview:active {
  cursor: grabbing;
}

.fixture-row-orient-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}

.fixture-row-orient-side .model3d-hint {
  margin: 0;
}

.fixture-row-orientation {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 0.5rem 0.75rem 0.65rem;
  margin: 0;
  flex-direction: row;
  align-items: center;
  gap: 1.25rem;
}

.fixture-row-orientation legend {
  padding: 0 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.fixture-row-orientation label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  cursor: pointer;
}

.fixture-row-note {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

.fixture-row-note.warn {
  color: #f6c453;
}

/* Matches the padlock on the row itself, so the two read as the same
   control in two places. */
.selection-unlock-btn {
  background: #f6c453;
  border-color: #f6c453;
  color: #3a2b00;
}

.tools-section {
  margin-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tools-section-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.2rem;
}

.tools-section-body .btn {
  width: 100%;
}

/* ---- Performance guards for the light show ------------------------------
   Animations never fight a drag and never all run in the background:
   - in the grid every photo's show runs — until one photo is clicked
     (zoom-active) or opened fullscreen, at which point every OTHER
     photo's show pauses so the one being worked on gets the frames;
   - while any fixture/rope is being dragged, resized, or rotated
     (body.interacting — see placement.js), every show pauses and the glass
     panels drop their backdrop blur, so the drag gets the whole frame. */
body.photo-fullscreen .photo-stage:not(.fullscreen-mode) .rope-item *,
body.photo-fullscreen .photo-stage:not(.fullscreen-mode) .placed-item.light-show-fixture .item-img,
#photo-stage-container:has(.photo-stage.zoom-active) .photo-stage:not(.zoom-active) .rope-item *,
#photo-stage-container:has(.photo-stage.zoom-active) .photo-stage:not(.zoom-active) .placed-item.light-show-fixture .item-img,
body.interacting .rope-item *,
body.interacting .placed-item.light-show-fixture .item-img {
  animation-play-state: paused;
}

body.interacting .product-sidebar,
body.interacting .fullscreen-tools-panel {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* Dragged fixtures move on their own compositor layer. */
.placed-item {
  will-change: transform;
}

/* ---- Multi-selection ----------------------------------------------------
   The marquee box drawn while dragging across empty photo, the bar that
   appears once more than one fixture is selected, and a brighter outline
   on each member of a group so it's obvious what will move together. */
.selection-marquee {
  position: fixed;
  z-index: 560;
  border: 1px solid var(--accent);
  background: rgba(222, 164, 52, 0.16);
  border-radius: 4px;
  pointer-events: none;
}

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  z-index: 570;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  background: rgba(14, 33, 60, 0.95);
  border: 1px solid #26446f;
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.selection-bar[hidden] {
  display: none;
}

.selection-bar-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  padding: 0 0.3rem;
}

/* Every member of a multi-selection gets the accent outline, so the group
   is legible at a glance (the primary keeps its usual handles). */
body.multi-selected .placed-item.selected .item-frame {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* A locked row (see createFixtureRow) frames in amber instead, so "these
   move as one" is visible at a glance rather than only in the toolbar. */
body.multi-selected .placed-item.selected.grouped .item-frame {
  outline-color: #f6c453;
}

body.multi-selected .rope-item.selected .rope-hit {
  stroke: rgba(222, 164, 52, 0.5);
  stroke-width: 10;
}

/* The builder toolbar's Night slider (see index.html). Sized and toned
   like the toolbar's buttons so it reads as one of them. */
/* The Tools panel's look picker (look-picker.js, the same one as the public
   Home Designer): a white, a show, or a color off the wheel, then the time
   of day and brightness sliders. Sized for the narrow fullscreen panel. */
.light-show-pick {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.light-show-pick select {
  width: 100%;
  min-width: 0;
}

.look-wheel-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem 0.35rem 0.35rem;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: 600 0.78rem var(--font);
  cursor: pointer;
}

.look-wheel-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.look-wheel-toggle.is-active {
  border-color: var(--accent);
}

.look-wheel-toggle-dot {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: conic-gradient(#ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}

.look-wheel-toggle-caret {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.7rem;
  transition: transform 0.15s ease;
}

.look-wheel-toggle[aria-expanded="true"] .look-wheel-toggle-caret {
  transform: rotate(180deg);
}

/* The wheel lights up when it's the look in use. */
.look-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem;
  border: 2px solid transparent;
  border-radius: 12px;
}

.look-custom[hidden] {
  display: none;
}

.look-custom.is-active {
  border-color: var(--accent);
  background: rgba(248, 194, 87, 0.08);
}

.look-wheel {
  position: relative;
  flex: none;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0) 70%),
    conic-gradient(#ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
  cursor: crosshair;
  touch-action: none;
}

.look-wheel-marker {
  position: absolute;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.look-custom-side {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.look-swatch {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #3fa9ff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.look-custom-hint {
  color: var(--muted);
  font-size: 0.72rem;
}

.look-slider + .look-slider {
  margin-top: 0.5rem;
}

.look-slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.look-slider-head strong {
  color: var(--accent);
}

/* The day's own colors along the track (noon to sunset to night), and an
   unlit bulb up to a bright gold one for brightness. */
.look-slider input[type="range"] {
  width: 100%;
  height: 8px;
  margin: 0.35rem 0 0.15rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #8fd0ff 0%, #ffe2b8 22%, #ffb46a 38%, #ff8a5c 52%, #a878b8 68%, #4f6fd0 84%, #0b1530 100%);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.look-slider input.look-brightness-input {
  background: linear-gradient(90deg, #4a3d2a 0%, #b8843a 35%, #f8c257 65%, #fff3c8 100%);
}

.look-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

.look-slider input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--bg);
}

.look-slider-scale {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.65rem;
}

/* --- EverGem brand (logo navy #0c2646, gold #f8c257) ---------------------
   Gold is light, so anything filled with it takes navy text instead of
   white. Kept last so it wins over the glass layers above. */
.btn-primary,
.scene-modify-mode-btn.active,
.users-sidebar-item.active {
  border-color: #f8c257;
  background: linear-gradient(180deg, #fbd27a, #f0b545);
  color: #0c2646;
  font-weight: 700;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 22px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover,
.users-sidebar-item.active:hover {
  border-color: #fde2a4;
  background: linear-gradient(180deg, #fde09a, #f5c25e);
  color: #0c2646;
}

.site-nav-tab.active {
  color: #0c2646;
  background: #f8c257;
}

/* Home Designer requests from the public site: the Website badge in the
   quote tables and the contact card on the quote page (quote.html). */
.quote-website-badge {
  margin-left: 0.4rem;
  background: rgba(248, 194, 87, 0.18);
  color: #f8c257;
}

.website-request-card {
  margin: 0 0 1.25rem;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(248, 194, 87, 0.45);
  border-radius: 14px;
  background: rgba(248, 194, 87, 0.08);
}

.website-request-card h2 {
  margin: 0;
  color: #f8c257;
  font-size: 1.05rem;
}

.website-request-hint {
  margin: 0.25rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.website-request-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}

.website-request-details dt {
  color: var(--muted);
}

.website-request-details dd {
  margin: 0;
  font-weight: 600;
}

.website-request-details a {
  color: var(--accent);
}

.website-request-message {
  white-space: pre-wrap;
}

/* --- Segmented lights in a show: every bulb takes part (their light on
   the house follows them, see SHOW_LIGHT in light-map.js). The shows above
   were made for a continuous strand, where one dashed run could leave the
   strand itself showing; on separate bulbs that left every other bulb
   plain white. These give both alternating runs their colors. */

body.light-show .rope-segmented[data-light-show="rainbow"] .rope-show-a {
  stroke: #ff3b3b;
  animation: color-cycle 6s steps(60) infinite;
}

body.light-show .rope-segmented[data-light-show="rainbow"] .rope-show-b {
  display: block;
  stroke: #2ec4ff;
  animation: color-cycle 6s steps(60) -3s infinite;
}
body.light-show .rope-segmented[data-light-show="steady"] .rope-show-b {
  display: block;
  stroke: #fff4d6;
  opacity: 0.9;
}

/* --- Flowing shows (light-shows.js): one dot per bulb (.rope-flow-bulb),
   colored on its own about 20 times a second, so a show travels the full
   length of the lights. The two-set show bulbs step aside; the bulb under
   each dot is an unlit one, and each bulb's light on the house takes the
   same color on the light map (light-map.js). */
.rope-flow {
  display: none;
  pointer-events: none;
}

body.light-show.flow-show .rope-segmented .rope-flow {
  display: block;
}

.rope-flow-bulb {
  fill: none;
  stroke: #3d342a;
  stroke-width: 4.6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

body.light-show.flow-show .rope-item .rope-show {
  display: none;
}

body.light-show.flow-show .rope-segmented .rope-core {
  stroke: #3d342a;
  animation: none;
}

/* --- Phones and tablets ----------------------------------------------------
   A fullscreen photo on a phone held upright (body.fullscreen-compact, see
   showFullscreenToolsPanel in main.js): the photo fills the width under the
   top bar, and the catalog and Tools slide in over it from their tabs
   (pinned near the bottom on a phone, see .fullscreen-tools-toggle-btn). */
body.fullscreen-compact .photo-stage.fullscreen-mode {
  inset: var(--site-nav-height) 0 0 0;
  width: auto;
  height: auto;
}

body.fullscreen-compact .product-sidebar,
body.fullscreen-compact .fullscreen-tools-panel {
  top: var(--site-nav-height);
}

/* A quote's header on a tablet: the "$X paid of $Y" line drops under the
   title and buttons instead of being squeezed in beside them. */
@media (max-width: 1100px) {
  .app-header:has(> .quote-payment-summary) {
    flex-wrap: wrap;
  }

  .app-header > .quote-payment-summary {
    flex: 1 0 100%;
  }
}

@media (max-width: 700px) {
  .gmail-admin-card {
    flex-wrap: wrap;
  }

  .gmail-admin-card > div {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* Wide tables (a quote's line items, Saved Quotes, Users) scroll
     sideways inside their own box instead of widening the whole page. */
  .review-table,
  .quote-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-users-table-wrap {
    overflow-x: auto;
  }

  .quote-page {
    margin: 1rem auto;
    padding: 0 0.85rem;
  }

  .review-total.price-tier-totals {
    justify-content: flex-start;
    font-size: 1rem;
  }
}

/* 16px or more, or iPhones zoom the whole page in on a tapped field. */
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
  select,
  textarea {
    font-size: max(16px, 1em);
  }
}

/* --- Messages (messages.html): Contact page messages for admins ---------- */
.messages-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 820px;
}

.message-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.message-card-head h3 {
  margin: 0.2rem 0;
}

.message-card-head time,
.message-reason {
  color: var(--muted);
  font-size: 0.8rem;
}

.message-reason {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Warranty claims stand out from general messages. */
.message-reason.is-warranty {
  color: #ff8a65;
}

.message-status {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(248, 194, 87, 0.18);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.message-card.is-handled {
  opacity: 0.65;
}

.message-card.is-handled .message-status {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.message-contact {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.9rem;
  margin: 0.7rem 0;
  font-size: 0.9rem;
}

.message-contact dt {
  color: var(--muted);
}

.message-contact dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.message-text {
  margin: 0 0 0.8rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message-actions {
  display: flex;
  gap: 0.5rem;
}

/* --- Notifications (notifications.html, and the count on its tab) --------- */
.site-nav-tab .nav-notify-count {
  margin-left: 0.3rem;
}

.nav-notify-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #0c2646;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

/* On the gold active tab, the count flips to navy so it stays visible. */
.site-nav-tab.active .nav-notify-count {
  background: #0c2646;
  color: var(--accent);
}

.notifications-page {
  padding: 2rem 1.25rem 4rem;
}

.home-notify {
  width: min(1180px, 100%);
  margin: 0 auto 1.5rem;
  padding: 1.1rem clamp(1rem, 3vw, 1.5rem);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--glass-highlight), rgba(255, 255, 255, 0.02)), var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.home-notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.home-notify-head h2 {
  margin: 0.15rem 0 0;
}

.home-notify-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}

.home-notify-item a {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  color: var(--muted);
  text-decoration: none;
}

.home-notify-item a:hover {
  background: rgba(255, 255, 255, 0.06);
}

.home-notify-item.is-new a {
  background: rgba(248, 194, 87, 0.1);
  color: var(--text);
}

.home-notify-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-notify-item.is-new .home-notify-label {
  color: var(--accent);
}

.home-notify-text {
  overflow-wrap: anywhere;
}

.home-notify-item time {
  font-size: 0.8rem;
  white-space: nowrap;
}

.home-notify-empty {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

@media (max-width: 700px) {
  .home-notify-item a {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .home-notify-label {
    grid-column: 1 / -1;
  }
}

/* --- Jobs, Schedule, Customers, message notes, Website editor ------------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* The Job card on a quote's page (quote.html): assigned to, install date. */
.job-card {
  margin: 0 0 1.25rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: var(--panel);
}

.job-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.job-install-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 0.75rem;
  align-items: end;
}

.job-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.job-field input,
.job-field select,
.job-field textarea {
  padding: 0.55rem 0.65rem;
  font-size: 0.95rem;
  color: var(--text);
}

.job-assign {
  max-width: 280px;
  margin-bottom: 0.9rem;
}

.job-field-wide {
  grid-column: 1 / -1;
}

.job-actions,
.site-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.job-status,
.site-status {
  font-size: 0.85rem;
  color: #4ade80;
}

.job-status.is-error,
.site-status.is-error {
  color: var(--danger);
}

.job-assigned-text {
  margin: 0 0 0.75rem;
}

.job-warranty {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

/* Lists of jobs and messages (schedule.html, customer.html). */
.schedule-week h3,
.customer-section h3 {
  margin: 0 0 0.6rem;
}

.schedule-week,
.customer-section {
  margin-bottom: 0.9rem;
}

.job-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.job-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-top: 1px solid var(--glass-border);
}

.job-row:first-child {
  border-top: 0;
}

.job-when {
  flex: 0 0 3.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0;
  border-radius: 10px;
  background: rgba(248, 194, 87, 0.12);
  color: var(--accent);
  font-size: 0.8rem;
  line-height: 1.3;
}

.job-when strong {
  font-size: 0.95rem;
}

.job-main {
  flex: 1 1 auto;
  min-width: 0;
}

.job-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.job-title .quote-status-badge {
  margin-left: 0;
}

.job-sub {
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.job-notes {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  white-space: pre-line;
}

.job-meta {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
}

.job-installer {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: rgba(114, 167, 255, 0.16);
  color: #9ec1ff;
}

.job-installer.is-unassigned {
  background: rgba(255, 165, 59, 0.14);
  color: #ffa53b;
}

@media (max-width: 560px) {
  .job-row {
    flex-wrap: wrap;
  }

  .job-meta {
    flex-basis: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    text-align: left;
  }
}

.customer-warranty {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.customer-table td {
  vertical-align: top;
}

/* Messages: filters, assigning, notes (messages.html). */
.message-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.message-filter[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.message-actions {
  flex-wrap: wrap;
  align-items: flex-end;
}

.message-assign {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-right: auto;
  font-size: 0.8rem;
  color: var(--muted);
}

.message-assign select {
  padding: 0.45rem 0.6rem;
  color: var(--text);
}

.message-notes {
  margin: 0 0 0.9rem;
}

.message-note-list {
  list-style: none;
  margin: 0 0 0.6rem;
  padding: 0;
}

.message-note {
  margin-bottom: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.message-note p {
  margin: 0.2rem 0 0.25rem;
  white-space: pre-line;
}

.message-note-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.message-note-form {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.message-note-form textarea {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  color: var(--text);
  resize: vertical;
}

/* The Website page (admin_site.html). */
.site-section {
  margin-bottom: 0.9rem;
}

.site-section h3 {
  margin: 0 0 0.3rem;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.site-field input,
.site-field select,
.site-field textarea {
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  color: var(--text);
}

.site-field textarea {
  resize: vertical;
  line-height: 1.45;
}

.site-field-wide {
  grid-column: 1 / -1;
}

.site-hint {
  font-size: 0.76rem;
  color: var(--muted);
}

.site-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  align-self: center;
  cursor: pointer;
}

.site-check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}

.site-row {
  margin: 0 0 0.9rem;
  padding: 0.9rem 1rem 0.75rem;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

.site-row .site-grid {
  margin-bottom: 0.5rem;
}

.site-add-row {
  margin-bottom: 0.9rem;
}

.customer-claims {
  color: #ff8a65;
}

/* The tab bar holds up to nine tabs for the owner (Schedule, Customers and
   Website joined the rest). Tabs never wrap onto two lines; on mid-size
   screens they tighten up, and if they still don't fit, the bar scrolls
   sideways rather than squeezing the labels. */
.site-nav-tab {
  white-space: nowrap;
}

.site-nav-tabs {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

@media (min-width: 701px) and (max-width: 1440px) {
  .site-nav {
    gap: 0.75rem;
  }

  .site-nav-tab {
    padding: 0.45rem 0.55rem;
    font-size: 0.8rem;
  }

  /* Just the EG mark, leaving the room to the tabs. */
  .site-nav-brand .brand-name,
  .site-nav-brand .brand-sub {
    display: none;
  }
}

.site-nav .user-bar-role,
.site-nav .link-btn {
  white-space: nowrap;
}

/* A product's picture on the Website page: the menu, the upload button and
   a preview of the chosen picture (_site_product_row.html). */
.site-picture-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-picture-row select {
  flex: 1 1 180px;
  min-width: 0;
}

.site-upload-btn {
  flex: 0 0 auto;
  cursor: pointer;
}

.site-upload-btn:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-picture-preview {
  display: block;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 10;
  margin-top: 0.4rem;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}

.site-picture-preview[hidden] {
  display: none;
}

.site-upload-status.is-error {
  color: var(--danger);
}

/* "Public Site" beside Log out in the staff bar (base.html). */
.site-nav-public {
  flex: none;
  padding: 0.35rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.site-nav-public:hover,
.site-nav-public:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 700px) {
  .site-nav-public {
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
  }
}

@media (min-width: 701px) and (max-width: 1440px) {
  .site-nav .user-bar-info {
    gap: 0.5rem;
  }
}

/* On a phone the role menu already says who's signed in; dropping the name
   keeps Public Site and Log out on the first row. */
@media (max-width: 480px) {
  .user-bar-name {
    display: none;
  }

  .site-nav .user-bar-info {
    gap: 0.4rem;
  }
}
