:root { --primary:#1a365d; --accent:#2b6cb0; --bg:#f7fafc; --card:#fff; --border:#e2e8f0; --text:#2d3748; --muted:#718096; --danger:#e53e3e; --success:#38a169; }
  * { box-sizing:border-box; }
  body { font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif; background:var(--bg); color:var(--text); margin:0; padding:20px; line-height:1.5; }
  .container { max-width:1100px; margin:0 auto; }
  header { background:#000000; color:white; padding:24px 28px; border-radius:12px; margin-bottom:24px; }
  header h1 { margin:0 0 6px 0; font-size:24px; }
  header p { margin:0; opacity:0.9; font-size:14px; }
  .section { background:var(--card); border:1px solid var(--border); border-radius:10px; padding:22px 26px; margin-bottom:20px; box-shadow:0 1px 3px rgba(0,0,0,0.04); }
  .section h2 { margin:0 0 16px 0; font-size:18px; color:var(--primary); border-bottom:2px solid var(--border); padding-bottom:8px; }
  .section h3 { margin:18px 0 10px 0; font-size:15px; color:var(--accent); }
  label { display:block; font-weight:600; margin:12px 0 4px 0; font-size:14px; }
  input[type="text"],input[type="number"],input[type="date"],input[type="password"],input[type="email"],input[type="tel"],textarea,select { width:100%; padding:9px 12px; border:1px solid var(--border); border-radius:6px; font-size:14px; background:white; }
  textarea { min-height:70px; resize:vertical; }
  .row { display:flex; gap:16px; flex-wrap:wrap; }
  .row > * { flex:1; min-width:200px; }
  .options { display:flex; flex-wrap:wrap; gap:12px; margin:8px 0; }
  .option { border:2.5px solid #a0aec0; border-radius:8px; padding:12px 16px; cursor:pointer; background:white; transition:all 0.15s; font-size:14.5px; font-weight:500; text-align:center; }
  .option:hover { border-color:var(--accent); background:#f7fafc; }
  .option.selected { border-color:var(--accent); background:#ebf4ff; font-weight:700; box-shadow:0 0 0 2px rgba(43,108,176,0.25); }
  .option img { display:block; margin:8px auto 0; border-radius:4px; }
  .sig-row { display:flex; align-items:center; gap:16px; border:2.5px solid #a0aec0; border-radius:8px; padding:12px; margin-bottom:10px; cursor:pointer; background:white; }
  .sig-row:hover { border-color:var(--accent); }
  .sig-row.selected { border-color:var(--accent); background:#ebf4ff; }
  .sig-row img { width:180px; height:auto; border-radius:4px; }
  .sig-sub { margin:8px 0 16px 24px; padding:10px; background:#f8fafc; border-radius:6px; display:none; }
  .sig-sub.show { display:block; }
  .btn { background:var(--accent); color:white; border:none; padding:10px 18px; border-radius:6px; font-size:14px; font-weight:600; cursor:pointer; margin-right:8px; }
  .btn:hover { background:#2c5282; }
  .btn.secondary { background:#718096; }
  .btn:disabled, .btn:disabled:hover { opacity:0.5; cursor:not-allowed; }
  .btn.danger { background:var(--danger); }
  .btn.success { background:var(--success); }
  .warning { background:#fffaf0; border-left:4px solid #dd6b20; padding:10px 14px; margin:10px 0; font-size:13px; }
  .example { background:#f0fff4; border-left:4px solid #38a169; padding:10px 14px; margin:10px 0; font-size:13px; font-style:italic; }
  .hidden { display:none !important; }
  .modal { position:fixed; inset:0; background:rgba(0,0,0,0.5); display:flex; align-items:center; justify-content:center; z-index:1000; }
  .modal.hidden { display:none !important; }
  .modal-content { background:white; padding:24px; border-radius:10px; max-width:420px; width:90%; }
  .required { color:#e53e3e; }
  .footer-note { font-size:12px; color:var(--muted); margin-top:20px; text-align:center; }

  .error { border-color: #e53e3e !important; background: #fff5f5 !important; }
  .error-text { color: #e53e3e; font-size: 12px; margin-top: 4px; }
  /* A required tick box with its wording beside it (special colour sample). */
  .confirm-check { display:flex; gap:10px; align-items:flex-start; margin:14px 0 4px; padding:10px 12px; border:1px solid var(--border); border-radius:6px; background:#fffaf0; font-weight:normal; cursor:pointer; }
  .confirm-check input { flex:none; width:18px; height:18px; margin:1px 0 0; accent-color:var(--accent); cursor:pointer; }
  .view { display: none; }
  .view.active { display: block; }

  .panel-select { margin: 10px 0; }
  .selected-count { font-weight: 600; margin: 8px 0; color: var(--accent); }

  .login-box { max-width: 480px; margin: 60px auto; background: white; padding: 32px; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
  .login-box h2 { margin-top: 0; color: var(--primary); }
  /* Logos balanced like the form header (Focus a third taller: its image has a
     blank margin and thin lowercase letters). Widths scale together on phones. */
  .login-logos { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; }
  .login-logos img { display:block; height:auto; }
  .login-logos img.lutron { width:54%; max-width:226px; }
  .login-logos img.focussb { width:36%; max-width:150px; }
  .tab-btn { padding: 8px 16px; border: none; background: #e2e8f0; border-radius: 6px; cursor: pointer; margin-right: 8px; }
  .tab-btn.active { background: var(--accent); color: white; }
  .enquiry-card { border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 10px; background: white; cursor: pointer; }
  .enquiry-card:hover { border-color: var(--accent); }
  .badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; }
  .badge.pending { background: #fef3c7; color: #92400e; }
  .badge.replied { background: #d1fae5; color: #065f46; }
  .detail-panel { background: #f8fafc; border-radius: 8px; padding: 16px; margin-top: 12px; }

  .logo-bar { display:flex; align-items:center; justify-content:space-between; background:white; padding:12px 20px; border-radius:12px; margin-bottom:16px; box-shadow:0 1px 3px rgba(0,0,0,0.08); }
  .logo-bar img.lutron { height:36px; } .logo-bar img.focussb { height:48px; background:transparent; }
  .series-card { display:flex; flex-direction:column; align-items:center; justify-content:flex-end; padding:10px; min-width:140px; width:160px; height:160px; }
  .series-card img { max-width:130px; max-height:100px; object-fit:contain; margin-bottom:8px; }

/* Phones: nothing wider than the screen. Desktop is unchanged. */
@media (max-width: 600px) {
  .logo-bar { gap:12px; padding:10px 14px; }
  .logo-bar img.lutron { height:auto; width:56%; max-width:254px; }
  .logo-bar img.focussb { height:auto; width:37%; max-width:168px; }
}

/* Line cards (enquiry page and build page). */
.line-card { border:1px solid var(--border); border-radius:10px; background:#fff; margin:10px 0; overflow:hidden; break-inside:avoid; }
.lc-head { display:flex; flex-wrap:wrap; align-items:center; gap:10px 18px; padding:10px 16px; background:#f7fafc; border-bottom:1px solid var(--border); }
.lc-title { flex:1; min-width:200px; font-size:15px; }
.lc-num { font-weight:700; color:var(--accent); margin-right:10px; }
.lc-series { font-weight:700; color:var(--primary); }
.lc-sub { color:var(--muted); margin-left:8px; }
.lc-qty { display:flex; gap:20px; }
.lc-qty div { display:flex; flex-direction:column; align-items:flex-end; line-height:1.15; }
.lc-qty span { font-size:11px; text-transform:uppercase; letter-spacing:0.04em; color:var(--muted); }
.lc-qty strong { font-size:20px; }
.lc-actions { display:flex; gap:6px; }
.lc-actions .btn { margin:0; padding:6px 14px; }
.lc-body { display:flex; align-items:flex-start; gap:20px; padding:12px 16px; }
.lc-list { flex:1; display:grid; grid-template-columns:170px 1fr; gap:7px 20px; margin:0; font-size:14px; }
.lc-list dt { color:var(--muted); font-weight:600; }
.lc-list dd { margin:0; min-width:0; overflow-wrap:anywhere; }
.lc-list dd.attn .lc-main { font-weight:700; }
.lc-tag { display:inline-block; margin-left:8px; padding:0 8px; border-radius:999px; background:#fef3c7; color:#92400e; font-size:11.5px; font-weight:700; vertical-align:1px; }
.lc-note { white-space:pre-line; margin-top:2px; }
.lc-files { display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
.lc-file { background:#ebf4ff; border:1px solid #bee3f8; border-radius:999px; padding:1px 10px; font-size:12.5px; }
.lc-swatch { display:inline-block; margin-left:10px; padding:3px 10px; background:#000; border-radius:4px; vertical-align:middle; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.lc-swatch img { display:block; height:18px; }
.lc-stalk { height:40px; margin-left:10px; vertical-align:middle; }
.lc-preview { flex:0 0 auto; }
@media (max-width: 600px) {
  .lc-body { flex-direction:column; }
  .lc-list { grid-template-columns:1fr; gap:2px; }
  .lc-list dt { margin-top:8px; }
  .lc-qty strong { font-size:17px; }
}

/* Messages (instead of browser pop-ups): bottom-right, stacked. */
.toasts { position:fixed; right:16px; bottom:16px; z-index:2000; display:flex; flex-direction:column; gap:8px; max-width:min(420px, calc(100vw - 32px)); }
.toast { display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border-radius:8px; background:#fff; border:1px solid var(--border); border-left:5px solid var(--accent); box-shadow:0 6px 18px rgba(0,0,0,0.12); font-size:14px; animation:toast-in 0.18s ease-out; }
.toast-success { border-left-color:var(--success); }
.toast-error { border-left-color:var(--danger); background:#fff5f5; }
.toast-text { flex:1; white-space:pre-line; overflow-wrap:anywhere; }
.toast-close { background:none; border:none; font-size:20px; line-height:1; color:var(--muted); cursor:pointer; padding:0 2px; }
@keyframes toast-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
@media print { .toasts { display:none; } }

/* List tabs: a count on each; Needs action stands out when it isn't empty. */
.tab-count { display:inline-block; min-width:20px; margin-left:6px; padding:0 6px; border-radius:999px; background:rgba(0,0,0,0.08); font-size:12px; font-weight:700; text-align:center; }
.tab-btn.active .tab-count { background:rgba(255,255,255,0.25); }
.tab-count.urgent { background:var(--danger); color:#fff; }
/* How long an enquiry has waited for Focus SB. */
.waiting { display:inline-block; margin-left:6px; font-size:12px; color:var(--muted); }
.waiting.late { padding:1px 8px; border-radius:999px; background:#fef3c7; color:#92400e; font-weight:700; }
/* Brief highlight on a line or enquiry that was just added. */
.flash { animation:flash 1.8s ease-out; }
@keyframes flash { 0%, 30% { box-shadow:0 0 0 3px rgba(56,161,105,0.55); } 100% { box-shadow:none; } }

/* Small helper notes under a label; the useful-links box; the page footer. */
.hint { margin:2px 0 6px; font-size:12.5px; color:var(--muted); }
.useful-links { margin:6px 0 14px; font-size:14px; }
.useful-links summary { cursor:pointer; color:var(--accent); font-weight:600; }
.useful-links ul { margin:6px 0 0; padding-left:20px; columns:2 260px; }
.useful-links li { margin:2px 0; }
.site-footer { margin:24px 0 8px; text-align:center; font-size:12.5px; }
.site-footer a { color:var(--muted); }

/* File boxes: themed like the rest of the form; chosen files listed underneath. */
input[type="file"] { display:block; width:100%; padding:8px; border:1.5px dashed #a0aec0; border-radius:6px; background:#fff; font-family:inherit; font-size:13px; color:var(--muted); cursor:pointer; }
input[type="file"]:hover, input[type="file"]:focus-visible { border-color:var(--accent); background:#f7fafc; outline:none; }
input[type="file"]::file-selector-button { margin-right:12px; padding:7px 14px; border:none; border-radius:6px; background:var(--accent); color:#fff; font-family:inherit; font-size:13px; font-weight:600; cursor:pointer; }
input[type="file"]::file-selector-button:hover { background:#2c5282; }
.file-picked { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:6px 0 4px; }
.file-chip { background:#ebf4ff; border:1px solid #bee3f8; color:var(--primary); border-radius:999px; padding:2px 10px; font-size:12.5px; max-width:100%; overflow-wrap:anywhere; }
.file-chip small { color:var(--muted); margin-left:6px; }
.file-chip.bad { background:#fff5f5; border-color:#feb2b2; color:#c53030; }
.file-chip.bad em { font-style:normal; font-weight:700; margin-left:6px; }
.file-replaces { font-size:12px; color:#b7791f; }
.file-clear { background:none; border:none; padding:2px 6px; color:var(--danger); font-family:inherit; font-size:12.5px; text-decoration:underline; cursor:pointer; }

/* Print / Save as PDF: just the enquiry, on white, without buttons or forms. */
.print-only { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; padding: 0; font-size: 12px; }
  .no-print, .btn, button, input, textarea, select { display: none !important; }
  .print-only { display: block; }
  .print-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 8px; }
  .section { border: none; box-shadow: none; padding: 0; margin: 0; }
  .detail-panel { background: #fff; border: 1px solid #ccc; break-inside: avoid; }
  .line-card { border: 1px solid #ccc; }
  .lc-head { background: #f3f3f3; }
  a { color: inherit; text-decoration: none; }
}

/* ---- Admin page (/admin) ---- */
.admin-muted { color:var(--muted); font-size:13px; }
.admin-head { display:flex; align-items:center; gap:12px; flex-wrap:wrap; border-bottom:2px solid var(--border); padding-bottom:8px; margin-bottom:12px; }
.section .admin-head h2 { margin:0; border:none; padding:0; flex:1; }
.admin-tabs { margin:4px 0 12px; }
.audit-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; margin:8px 0 10px; }
.audit-filters label { margin:0; font-size:13px; min-width:140px; }
.audit-filters label.grow { flex:1; min-width:200px; }
.audit-filters input, .audit-filters select { margin-top:4px; }
.audit-filters .btn { margin-right:0; }
.table-wrap { overflow-x:auto; border:1px solid var(--border); border-radius:8px; background:#fff; margin-top:8px; }
.audit-table { width:100%; border-collapse:collapse; font-size:13px; }
.audit-table th, .audit-table td { text-align:left; padding:7px 10px; border-bottom:1px solid var(--border); vertical-align:top; }
.audit-table th { background:#f7fafc; font-weight:600; white-space:nowrap; }
.audit-table td.nowrap { white-space:nowrap; }
.audit-table td.detail { overflow-wrap:anywhere; min-width:220px; }
.audit-table .ev-warn { color:var(--danger); font-weight:600; }
.pager { display:flex; align-items:center; gap:12px; margin-top:10px; }
.pager .btn { margin-right:0; }
.btn:disabled { opacity:0.5; cursor:default; }
.setting { padding:10px 0 14px; border-bottom:1px solid var(--border); }
.setting .help, .setting .source { font-size:12px; color:var(--muted); margin-top:4px; }
.setting .test-email { margin-top:8px; font-size:13px; padding:7px 12px; }
.switch-row { display:flex; align-items:center; gap:10px; cursor:pointer; }
.switch-row input { flex:none; width:18px; height:18px; margin:0; accent-color:var(--accent); cursor:pointer; }
.link-btn { background:none; border:none; color:var(--accent); cursor:pointer; padding:0; font-size:12px; text-decoration:underline; }
input[type="url"] { width:100%; padding:9px 12px; border:1px solid var(--border); border-radius:6px; font-size:14px; background:white; }
@media (max-width: 600px) {
  .audit-filters label { min-width:0; flex:1 1 45%; }
}
.setting .source-warn { color:#c05621; }
