:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #d1d5db;
  --primary: #111827;
  --primary-contrast: #fff;
  --danger: #b91c1c;
  --warning-bg: #fffbeb;
  --warning-border: #f59e0b;
  --info-bg: #eff6ff;
  --info-border: #3b82f6;
  --success-bg: #ecfdf5;
  --success: #065f46;
  --radius: 14px;
  --shadow: 0 12px 35px rgba(17,24,39,.08);
}
* { box-sizing: border-box; }
html { min-height:100%; background:var(--bg); }
body { margin:0; min-height:100%; font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; color:var(--text); background:var(--bg); }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
button:disabled { cursor:not-allowed; opacity:.5; }
a { color:inherit; }
.hidden { display:none !important; }
.app-header { position:sticky; top:0; z-index:30; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:18px max(20px,calc((100vw - 1500px)/2)); background:rgba(255,255,255,.96); border-bottom:1px solid var(--border); backdrop-filter:blur(12px); }
.app-header h1 { margin:0; font-size:clamp(1.35rem,2vw,1.9rem); }
.eyebrow { margin:0 0 4px; color:var(--muted); font-size:.7rem; font-weight:850; letter-spacing:.14em; }
.header-actions,.toolbar-buttons,.view-actions,.suggestion-actions,.drive-settings-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
main { width:min(1500px,calc(100% - 32px)); margin:24px auto 60px; }
.panel,.metric { background:var(--panel); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); }
.toolbar { display:grid; grid-template-columns:minmax(240px,2fr) repeat(4,minmax(130px,1fr)) auto; gap:12px; align-items:end; padding:16px; }
label { display:grid; gap:7px; color:#374151; font-size:.84rem; font-weight:750; }
input,select,textarea { width:100%; border:1px solid var(--border); border-radius:9px; background:#fff; color:var(--text); padding:10px 11px; outline:none; transition:border-color .15s, box-shadow .15s; }
input:focus,select:focus,textarea:focus { border-color:#6b7280; box-shadow:0 0 0 3px rgba(107,114,128,.14); }
textarea { resize:vertical; }
button { border:1px solid transparent; border-radius:9px; padding:9px 13px; font-weight:760; transition:transform .12s,opacity .12s,background .12s; }
button:active { transform:translateY(1px); }
.primary { background:var(--primary); color:var(--primary-contrast); }
.secondary { background:#fff; border-color:var(--border); color:var(--text); }
.ghost { background:transparent; border-color:transparent; color:#374151; }
.danger { color:var(--danger); }
.full { width:100%; }
.badge { display:inline-flex; align-items:center; min-height:32px; padding:6px 10px; border-radius:999px; background:#f3f4f6; color:#374151; font-size:.78rem; font-weight:850; }
.summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin:16px 0; }
.metric { padding:18px; }
.metric span { display:block; color:var(--muted); font-size:.82rem; font-weight:700; }
.metric strong { display:block; margin-top:7px; font-size:1.75rem; min-height:1.2em; }
.table-panel { overflow:hidden; }
.table-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:18px; border-bottom:1px solid var(--border); }
.table-heading h2,.table-heading p { margin:0; }
.table-heading p { margin-top:4px; color:var(--muted); font-size:.84rem; }
.compact-control { display:inline-flex; grid-auto-flow:column; align-items:center; gap:6px; font-size:.75rem; white-space:nowrap; }
.compact-control select { width:auto; min-width:70px; padding:6px 8px; }
.page-info { min-width:58px; text-align:center; color:var(--muted); font-size:.8rem; font-weight:850; }
.desktop-table-wrap { overflow:auto; }
table { width:100%; min-width:1200px; border-collapse:collapse; }
th,td { padding:12px 13px; border-bottom:1px solid #e5e7eb; text-align:left; vertical-align:top; font-size:.84rem; }
th { position:sticky; top:0; z-index:4; background:#f9fafb; color:#4b5563; font-size:.75rem; letter-spacing:.035em; text-transform:uppercase; cursor:pointer; }
tbody tr:hover { background:#f9fafb; }
.company-cell strong,.contact-cell strong { display:block; }
.cell-sub { display:block; margin-top:3px; color:var(--muted); font-size:.75rem; }
.status-pill { display:inline-flex; align-items:center; padding:5px 8px; border-radius:999px; background:#eef2f7; color:#374151; font-size:.73rem; font-weight:850; white-space:nowrap; }
.row-actions { display:flex; justify-content:center; gap:4px; white-space:nowrap; }
.row-actions button { padding:6px 8px; border:1px solid var(--border); background:#fff; }
#leadTable th:last-child,#leadTable td:last-child { position:sticky; right:0; width:124px; min-width:124px; background:#fff; box-shadow:-8px 0 12px -12px rgba(17,24,39,.55); }
#leadTable th:last-child { z-index:8; background:#f9fafb; cursor:default; }
#leadTable td:last-child { z-index:3; }
#leadTable tbody tr:hover td:last-child { background:#f9fafb; }
.mobile-cards { display:none; padding:12px; gap:10px; }
.lead-card { padding:15px; border:1px solid var(--border); border-radius:12px; background:#fff; }
.card-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.card-top h3 { margin:0; font-size:1rem; }
.card-top p { margin:4px 0 0; color:var(--muted); font-size:.82rem; }
.card-meta { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin:14px 0; font-size:.8rem; }
.card-meta span { color:var(--muted); display:block; margin-bottom:2px; }
.card-actions { display:flex; gap:8px; flex-wrap:wrap; }
.card-actions a,.card-actions button { padding:7px 10px; border:1px solid var(--border); border-radius:8px; background:#fff; text-decoration:none; font-size:.78rem; font-weight:760; }
.empty-state { padding:58px 20px; text-align:center; }
.empty-state h3 { margin:0; }
.empty-state p { color:var(--muted); }
.modal { width:min(620px,calc(100% - 24px)); max-height:min(92vh,1000px); padding:0; overflow:auto; border:1px solid var(--border); border-radius:16px; box-shadow:0 25px 80px rgba(0,0,0,.24); }
.modal-wide { width:min(940px,calc(100% - 24px)); }
.modal::backdrop { background:rgba(17,24,39,.58); backdrop-filter:blur(2px); }
.modal-header,.modal-footer { position:sticky; z-index:10; display:flex; align-items:center; gap:12px; padding:16px 18px; background:#fff; }
.modal-header { top:0; justify-content:space-between; border-bottom:1px solid var(--border); }
.modal-footer { bottom:0; border-top:1px solid var(--border); }
.modal-header h2 { margin:0; font-size:1.25rem; }
.footer-spacer { flex:1; }
.icon-button { padding:2px 9px; background:transparent; font-size:1.65rem; line-height:1; color:var(--muted); }
.form-section { padding:18px; border-bottom:1px solid #e5e7eb; }
.form-section h3 { margin:0 0 14px; font-size:.95rem; }
.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.span-2 { grid-column:span 2; }
.input-action { display:grid; grid-template-columns:1fr auto; gap:7px; }
.input-action button { white-space:nowrap; }
.alert { margin:16px 18px 0; padding:11px 12px; border:1px solid; border-radius:10px; font-size:.83rem; line-height:1.45; }
.warning { background:var(--warning-bg); border-color:var(--warning-border); }
.info { background:var(--info-bg); border-color:var(--info-border); }
.success { background:var(--success-bg); border-color:#10b981; color:var(--success); }
.maps-preview { margin-top:14px; padding:12px; background:#f9fafb; border:1px solid var(--border); border-radius:10px; font-size:.83rem; }
.maps-preview a { font-weight:800; }
.field-suggestions { display:flex; flex-wrap:wrap; gap:6px; margin:1px 0 4px; }
.suggestion-chip { display:inline-flex; align-items:center; gap:5px; padding:5px 8px; border:1px solid #cbd5e1; border-radius:999px; background:#f8fafc; color:#334155; font-size:.72rem; font-weight:800; cursor:pointer; }
.profile-grid { display:grid; grid-template-columns:1fr 1fr; gap:18px; padding:18px; }
.profile-section { border:1px solid var(--border); border-radius:12px; padding:15px; }
.profile-section h3 { margin:0 0 12px; font-size:.93rem; }
.profile-list { display:grid; gap:10px; }
.profile-item span { display:block; color:var(--muted); font-size:.73rem; font-weight:750; text-transform:uppercase; }
.profile-item div { margin-top:3px; overflow-wrap:anywhere; }
.profile-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:13px; }
.profile-actions a { display:inline-flex; padding:8px 10px; border-radius:8px; background:#f3f4f6; text-decoration:none; font-size:.78rem; font-weight:800; }
.profile-nav { display:inline-flex; align-items:center; gap:8px; }
.profile-position { min-width:64px; text-align:center; color:var(--muted); font-size:.8rem; font-weight:850; }
.analysis-tabs { display:flex; gap:8px; flex-wrap:wrap; padding:14px 18px 0; }
.analysis-tab { padding:7px 10px; border:1px solid #d1d5db; border-radius:999px; background:#f9fafb; color:#4b5563; font-size:.76rem; font-weight:850; }
.analysis-tab.active { background:#111827; color:#fff; border-color:#111827; }
.analysis-tab.completed:not(.active) { background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }
.analysis-section { padding:18px; border-bottom:1px solid var(--border); }
.analysis-section h3 { margin:0 0 10px; }
.analysis-section > p { color:var(--muted); font-size:.84rem; line-height:1.5; }
.suggestion-card { display:grid; gap:8px; padding:13px; margin:9px 0; border:1px solid var(--border); border-radius:10px; }
.suggestion-card p { margin:0; color:#374151; font-size:.84rem; line-height:1.45; }
.suggestion-evidence { color:var(--muted) !important; font-size:.76rem !important; }
.manual-entry { display:grid; grid-template-columns:1fr auto; gap:8px; margin:10px 0; }
.search-links { display:flex; gap:8px; flex-wrap:wrap; margin:10px 0; }
.search-links a { display:inline-flex; padding:8px 10px; border:1px solid var(--border); border-radius:8px; text-decoration:none; font-size:.78rem; font-weight:800; background:#fff; }
.settings-section { padding:18px; border-bottom:1px solid var(--border); }
.settings-section h3 { margin:0 0 8px; font-size:.95rem; }
.settings-copy { margin:0 0 12px; }
.settings-key-row { display:grid; grid-template-columns:1fr auto auto; gap:8px; }
.drive-settings-actions { margin:10px 0; }
.sync-diagnostics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin:10px 0; }
.sync-diagnostic { padding:9px; border:1px solid var(--border); border-radius:9px; background:#f9fafb; }
.sync-diagnostic span { display:block; color:var(--muted); font-size:.69rem; font-weight:800; text-transform:uppercase; }
.sync-diagnostic strong { display:block; margin-top:3px; font-size:.85rem; overflow-wrap:anywhere; }
.setup-details { margin-top:10px; padding:10px 12px; border:1px solid var(--border); border-radius:9px; background:#f9fafb; color:#4b5563; font-size:.82rem; }
.setup-details summary { cursor:pointer; font-weight:800; color:var(--text); }
.status-list { display:grid; gap:8px; margin:12px 0; }
.status-row { display:grid; grid-template-columns:1fr auto auto auto; align-items:center; gap:7px; }
.inline-form { display:grid; grid-template-columns:1fr auto; gap:8px; }
.stack { display:grid; gap:10px; padding:20px; }
.import-drop { padding:20px; border-bottom:1px solid var(--border); }
.import-drop p { color:var(--muted); font-size:.82rem; }
.import-summary { padding:14px 18px 0; }
.import-table-wrap { overflow:auto; padding:14px 18px 18px; }
.import-table-wrap table { min-width:900px; }
.mapping-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; padding:14px 18px; }
.muted { color:var(--muted); font-size:.84rem; }
.toast { position:fixed; right:20px; bottom:20px; z-index:100; max-width:min(440px,calc(100% - 40px)); padding:12px 15px; border-radius:10px; background:#111827; color:#fff; box-shadow:var(--shadow); font-size:.84rem; }
@media (max-width:1050px) { .toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); } .toolbar-buttons { grid-column:1/-1; } }
@media (max-width:760px) {
  .app-header { align-items:flex-start; padding:14px 16px; }
  .header-actions .badge { display:none; }
  main { width:min(100% - 20px,1500px); margin-top:12px; }
  .toolbar { grid-template-columns:1fr 1fr; padding:12px; }
  .search-field { grid-column:1/-1; }
  .summary-grid { grid-template-columns:1fr 1fr; gap:9px; }
  .metric { padding:13px; }
  .metric strong { font-size:1.45rem; }
  .desktop-table-wrap { display:none; }
  .mobile-cards { display:grid; }
  .table-heading { padding:14px; align-items:flex-start; }
  .table-heading .view-actions #backupBtn,.table-heading .view-actions #restoreBtn { display:none; }
  .form-grid,.profile-grid { grid-template-columns:1fr; }
  .span-2 { grid-column:auto; }
  .mapping-grid { grid-template-columns:1fr; }
  .modal { width:100%; max-height:96vh; margin:auto 0 0; border-radius:16px 16px 0 0; }
  .profile-footer { flex-wrap:wrap; }
  .profile-nav { order:-1; width:100%; justify-content:center; }
  .profile-nav button { flex:1; }
  .sync-diagnostics { grid-template-columns:1fr 1fr; }
}
@media (max-width:600px) { .settings-key-row,.manual-entry { grid-template-columns:1fr; } }
@media (max-width:500px) {
  .app-header { flex-direction:column; }
  .header-actions { width:100%; }
  .header-actions .primary { flex:1; }
  .toolbar { grid-template-columns:1fr; }
  .search-field,.toolbar-buttons { grid-column:auto; }
  .toolbar-buttons button { flex:1; }
  .card-meta { grid-template-columns:1fr; }
  .sync-diagnostics { grid-template-columns:1fr; }
}


/* MIM 1.4 */
.advanced-filters{grid-column:1/-1;display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:12px;padding-top:12px;border-top:1px solid var(--border)}
.saved-view-actions{display:flex;gap:8px;align-items:end}.saved-view-control{min-width:190px}
.bulk-bar{display:flex;align-items:end;gap:9px;flex-wrap:wrap;padding:12px 14px;margin:0 0 14px}.bulk-bar label{min-width:110px}.bulk-bar select,.bulk-bar input{padding:7px 8px}.bulk-tag{display:flex;gap:6px;align-items:end}.bulk-tag input{width:120px}
.select-column{width:42px;min-width:42px;text-align:center}.select-column input{width:auto}.selected-row{background:#f3f4f6!important}
.editable-cell{cursor:cell}.editable-cell:hover{outline:1px dashed #9ca3af;outline-offset:-3px}.inline-editor{min-width:100px;padding:5px 6px!important;border-radius:6px!important}
.priority-pill{display:inline-flex;min-width:26px;justify-content:center;padding:4px 7px;border-radius:999px;background:#eef2f7;font-size:.74rem;font-weight:900}.priority-A{background:#fee2e2}.priority-B{background:#fef3c7}.priority-C{background:#e0f2fe}
.tag-preview{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}.tag-chip,.tag-link{display:inline-flex;padding:4px 7px;border-radius:999px;background:#eef2f7;border:0;font-size:.75rem;font-weight:800}.tag-link{cursor:pointer;color:inherit}
.duplicate-review{padding:16px 18px;display:grid;gap:10px}.duplicate-card{display:flex;justify-content:space-between;gap:16px;padding:13px;border:1px solid var(--border);border-radius:10px}.duplicate-card p{margin:6px 0 0;color:#4b5563;font-size:.82rem;line-height:1.55}
.sync-log{display:grid;gap:5px;margin-top:10px;max-height:240px;overflow:auto}.sync-log-row{display:grid;grid-template-columns:150px 1fr;gap:10px;padding:7px 8px;border-radius:7px;background:#f9fafb;font-size:.77rem}.sync-log-row span{color:var(--muted)}.sync-log-row.success{border-left:3px solid #16a34a}.sync-log-row.error{border-left:3px solid #dc2626}.sync-log-row.warn{border-left:3px solid #d97706}
@media(max-width:1050px){.advanced-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.advanced-filters{grid-template-columns:1fr}.bulk-bar{align-items:stretch}.bulk-bar>*{flex:1 1 45%}.duplicate-card{display:grid}.sync-log-row{grid-template-columns:1fr}.toolbar{grid-template-columns:1fr 1fr}.search-field{grid-column:1/-1}}

.card-badges{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}


/* MIM 1.4.1 */
.field-help { display:block; margin-top:6px; color:var(--muted); font-size:.74rem; font-weight:500; line-height:1.35; }
.coordinate-note { margin-top:8px; color:var(--muted); font-size:.76rem; line-height:1.4; }
.suggestion-card.exact-coordinate { border-width:2px; }


/* ======================== 1.4.2 UI CLEANUP ======================== */
:root {
  --surface-2:#f9fafb;
  --surface-3:#f3f4f6;
  --field-bg:#ffffff;
  --label:#374151;
  --table-line:#e5e7eb;
  --link:#1d4ed8;
}
html[data-theme="dark"] {
  color-scheme:dark;
  --bg:#0b0f14;
  --panel:#111827;
  --text:#f3f4f6;
  --muted:#9ca3af;
  --border:#374151;
  --primary:#f9fafb;
  --primary-contrast:#111827;
  --danger:#fca5a5;
  --warning-bg:#2a2110;
  --warning-border:#b7791f;
  --info-bg:#102038;
  --info-border:#3b82f6;
  --success-bg:#0d2b24;
  --success:#6ee7b7;
  --surface-2:#172033;
  --surface-3:#1f2937;
  --field-bg:#0f172a;
  --label:#d1d5db;
  --table-line:#273449;
  --link:#93c5fd;
  --shadow:0 12px 35px rgba(0,0,0,.32);
}
html[data-theme="dark"] .app-header,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer { background:rgba(17,24,39,.97); }
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .secondary,
html[data-theme="dark"] .row-actions button,
html[data-theme="dark"] .search-links a,
html[data-theme="dark"] .card-actions a,
html[data-theme="dark"] .card-actions button { background:var(--field-bg); color:var(--text); border-color:var(--border); }
html[data-theme="dark"] label,
html[data-theme="dark"] .ghost { color:var(--label); }
html[data-theme="dark"] th,
html[data-theme="dark"] #leadTable th:last-child { background:var(--surface-2); color:#cbd5e1; }
html[data-theme="dark"] td { border-color:var(--table-line); }
html[data-theme="dark"] #leadTable td:last-child { background:var(--panel); }
html[data-theme="dark"] #leadTable tbody tr:hover,
html[data-theme="dark"] #leadTable tbody tr:hover td:last-child { background:var(--surface-2); }
html[data-theme="dark"] .lead-card,
html[data-theme="dark"] .suggestion-card,
html[data-theme="dark"] .profile-section { background:var(--panel); }
html[data-theme="dark"] .maps-preview,
html[data-theme="dark"] .sync-diagnostic,
html[data-theme="dark"] .setup-details,
html[data-theme="dark"] .analysis-tab,
html[data-theme="dark"] .suggestion-chip { background:var(--surface-2); color:var(--text); border-color:var(--border); }
html[data-theme="dark"] .analysis-tab.active { background:#f9fafb; color:#111827; border-color:#f9fafb; }
html[data-theme="dark"] .analysis-tab.completed:not(.active) { background:#0d2b24; color:#6ee7b7; border-color:#166534; }
html[data-theme="dark"] .status-pill,.badge { background:var(--surface-3); color:var(--text); }
html[data-theme="dark"] .suggestion-card p { color:#d1d5db; }
html[data-theme="dark"] a { color:inherit; }

.section-heading-row { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:15px; }
.section-heading-row h3 { margin:0 0 3px; }
.section-heading-row p { margin:0; color:var(--muted); font-size:.78rem; font-weight:500; line-height:1.4; }
.analyze-button { min-width:150px; }
.company-primary input { font-weight:700; }
.coordinate-details { margin-top:14px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); overflow:hidden; }
.coordinate-details summary { display:flex; justify-content:space-between; gap:12px; cursor:pointer; padding:10px 12px; color:var(--text); font-size:.79rem; font-weight:800; }
.coordinate-details summary span:last-child { color:var(--muted); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.coordinate-details-body { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:0 12px 12px; }
.appearance-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.appearance-options label { display:flex; align-items:center; gap:8px; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--surface-2); cursor:pointer; }
.appearance-options input { width:auto; margin:0; }
.appearance-options label:has(input:checked) { border-color:var(--text); box-shadow:0 0 0 1px var(--text) inset; }
.field-help { color:var(--muted); }

@media (max-width:760px) {
  .section-heading-row { align-items:stretch; flex-direction:column; gap:10px; }
  .analyze-button { width:100%; }
  .coordinate-details-body { grid-template-columns:1fr; }
  .appearance-options { grid-template-columns:1fr; }
}
/* ====================== END 1.4.2 CLEANUP ======================= */


/* ==========================================================================\n   1.4.3 Exhibition workspace\n   ========================================================================== */
.modal-exhibition{width:min(1180px,96vw);max-height:94vh}
.exhibition-toolbar{display:flex;gap:.65rem;align-items:end;flex-wrap:wrap;padding:.9rem 0 1rem;border-bottom:1px solid var(--border)}
.exhibition-toolbar .exhibition-picker{min-width:260px;flex:1}
.exhibition-setup,.exhibition-import-panel{margin:1rem 0;padding:1rem;border:1px solid var(--border);border-radius:14px;background:var(--surface-2)}
.exhibition-setup .inline-actions,.exhibition-import-actions{display:flex;gap:.6rem;align-items:end;flex-wrap:wrap;margin-top:.9rem}
.exhibition-import-actions label{min-width:220px}
.exhibition-empty{padding:3rem 1rem}
.exhibition-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin:1.1rem 0 .8rem}
.exhibition-heading h3{margin:0 0 .25rem;font-size:1.35rem}
.exhibition-legend{display:flex;gap:.4rem;flex-wrap:wrap;justify-content:flex-end}
.match-badge{display:inline-flex;align-items:center;border-radius:999px;padding:.2rem .55rem;font-size:.72rem;font-weight:750;letter-spacing:.02em;border:1px solid var(--border)}
.match-known{background:color-mix(in srgb,#16a34a 14%,var(--panel));border-color:color-mix(in srgb,#16a34a 45%,var(--border))}
.match-related{background:color-mix(in srgb,#ca8a04 14%,var(--panel));border-color:color-mix(in srgb,#ca8a04 45%,var(--border))}
.match-review{background:color-mix(in srgb,#ea580c 14%,var(--panel));border-color:color-mix(in srgb,#ea580c 45%,var(--border))}
.match-new{background:var(--surface-2)}
.exhibition-summary-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.65rem;margin-bottom:.9rem}
.exhibition-stat{appearance:none;text-align:left;border:1px solid var(--border);border-radius:14px;background:var(--panel);padding:.8rem .9rem;color:var(--text);cursor:pointer}
.exhibition-stat:hover{border-color:var(--primary)}
.exhibition-stat span{display:block;font-size:.76rem;color:var(--muted);margin-bottom:.15rem}
.exhibition-stat strong{font-size:1.35rem}
.exhibition-stat.visit-stat{border-color:color-mix(in srgb,var(--primary) 55%,var(--border))}
.exhibition-controls{display:grid;grid-template-columns:minmax(240px,1fr) 190px 95px auto;gap:.65rem;align-items:end;margin-bottom:.8rem}
.exhibition-page-controls{display:flex;align-items:center;gap:.35rem;white-space:nowrap;padding-bottom:.02rem}
.exhibition-table-wrap{overflow:auto;border:1px solid var(--border);border-radius:14px;background:var(--panel)}
.exhibition-table{width:100%;border-collapse:collapse;min-width:900px}
.exhibition-table th,.exhibition-table td{padding:.72rem .65rem;border-bottom:1px solid var(--border);text-align:left;vertical-align:top}
.exhibition-table th{position:sticky;top:0;background:var(--panel);z-index:1;font-size:.76rem;color:var(--muted)}
.exhibition-table tr:last-child td{border-bottom:0}
.exhibition-company strong{display:block;margin-bottom:.15rem}
.exhibition-sub{display:block;color:var(--muted);font-size:.78rem;line-height:1.35;margin-top:.12rem}
.exhibition-match-copy{min-width:220px}
.exhibition-row-actions{display:flex;gap:.35rem;flex-wrap:wrap}
.exhibition-check{width:1.15rem;height:1.15rem;margin-top:.1rem}
.exhibition-mobile-cards{display:none}
.exhibition-mapping-grid{margin-bottom:.8rem}
.exhibition-import-panel .import-table-wrap{max-height:220px}
.exhibition-visit-highlight td:first-child{box-shadow:inset 3px 0 0 var(--primary)}

@media (max-width:760px){
  .modal-exhibition{width:100vw;max-width:100vw;max-height:100dvh;height:100dvh;border-radius:0;margin:0}
  .exhibition-toolbar{align-items:stretch}
  .exhibition-toolbar>*{flex:1 1 45%}
  .exhibition-toolbar .exhibition-picker{flex-basis:100%;min-width:0}
  .exhibition-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .exhibition-summary-grid .visit-stat{grid-column:span 2}
  .exhibition-controls{grid-template-columns:1fr 1fr}
  .exhibition-controls .search-field{grid-column:1/-1}
  .exhibition-page-controls{justify-content:flex-end}
  .exhibition-table-wrap{display:none}
  .exhibition-mobile-cards{display:grid;gap:.65rem}
  .exhibition-card{border:1px solid var(--border);border-radius:14px;background:var(--panel);padding:.85rem}
  .exhibition-card-top{display:flex;justify-content:space-between;gap:.6rem;align-items:flex-start}
  .exhibition-card h4{margin:0 0 .2rem;font-size:1rem}
  .exhibition-card-meta{display:grid;grid-template-columns:1fr 1fr;gap:.55rem;margin:.75rem 0}
  .exhibition-card-meta span{display:block;color:var(--muted);font-size:.72rem;margin-bottom:.08rem}
  .exhibition-card-flags{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;margin:.65rem 0}
  .exhibition-card-flags label{display:flex;align-items:center;gap:.35rem;font-size:.82rem}
}


/* 1.4.8 — Settings / backup restore feedback */
.button-count{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 7px;margin-left:4px;border-radius:999px;background:var(--surface-2,#f3f4f6);border:1px solid var(--border);font-size:.72rem;font-weight:900;line-height:1}
.duplicate-settings-button{display:inline-flex;align-items:center;gap:4px}
.maintenance-summary{margin-top:2px!important}
.restore-body{padding:18px}
.restore-body .alert{margin:0 0 14px}
.restore-warning{margin:0 0 14px;padding:11px 12px;border:1px solid var(--warning-border);border-radius:10px;background:var(--warning-bg);font-size:.83rem;line-height:1.45}
.backup-summary-grid{display:grid;grid-template-columns:minmax(120px,.8fr) minmax(0,1.4fr);margin:0;border-top:1px solid var(--border)}
.backup-summary-grid dt,.backup-summary-grid dd{margin:0;padding:9px 0;border-bottom:1px solid var(--border);font-size:.82rem}
.backup-summary-grid dt{color:var(--muted);font-weight:700}
.backup-summary-grid dd{font-weight:800;overflow-wrap:anywhere}
html[data-theme="dark"] .button-count{background:var(--surface-3)}
@media(max-width:560px){.backup-summary-grid{grid-template-columns:1fr}.backup-summary-grid dt{padding-bottom:2px;border-bottom:0}.backup-summary-grid dd{padding-top:0}.header-actions #settingsBtn{flex:1}}


/* ==========================================================================\n   MIM 1.4.10 — fast map panel\n   ========================================================================== */
.map-side-tab{position:fixed;right:0;top:42%;z-index:1090;border:1px solid var(--border,#d7dce2);border-right:0;border-radius:10px 0 0 10px;padding:10px 12px;background:var(--panel,#fff);color:var(--text,#1f2937);font-weight:700;box-shadow:0 2px 12px rgba(15,23,42,.08);cursor:pointer}
.map-panel{position:fixed;z-index:1100;top:0;right:0;bottom:0;width:clamp(420px,46vw,760px);display:flex;flex-direction:column;background:var(--panel,#fff);border-left:1px solid var(--border,#d7dce2);box-shadow:-10px 0 30px rgba(15,23,42,.14);transform:translateX(102%);transition:transform .15s ease-out}
.map-panel.is-open{transform:translateX(0)}
.map-panel-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border,#e5e7eb)}
.map-panel-header h2{margin:2px 0 0}.map-panel-header .eyebrow{margin:0}.map-panel-header-actions,.map-selection-actions,.map-legend{display:flex;align-items:center;gap:8px}
#mapSelectAreaBtn.is-active{border-color:#2563eb;background:#eff6ff;color:#1d4ed8}
.map-selection-toolbar{padding:10px 16px;border-bottom:1px solid var(--border,#e5e7eb);background:var(--surface-muted,#f8fafc);display:flex;align-items:center;justify-content:space-between;gap:12px}
.map-canvas-wrap{position:relative;flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;padding:14px;overflow:hidden;background:var(--surface-muted,#fbfcfe)}
.map-svg{display:block;width:100%;height:auto;max-height:100%;aspect-ratio:2/1;user-select:none;touch-action:none;cursor:grab}.map-svg.is-panning{cursor:grabbing}
.map-svg.is-selecting{cursor:crosshair}.map-ocean{fill:#f8fafc}.map-world{fill:#f1f5f9;fill-rule:evenodd;stroke:#aeb9c6;stroke-width:.75;vector-effect:non-scaling-stroke}.map-country-highlight{fill:rgba(37,99,235,.13);fill-rule:evenodd;stroke:#2563eb;stroke-width:2;vector-effect:non-scaling-stroke;pointer-events:none}
.map-dot{stroke:#fff;stroke-width:1.4;vector-effect:non-scaling-stroke;cursor:pointer;transition:opacity .08s linear;outline:none;transform:none}.map-dot:focus,.map-dot:focus-visible,.map-dot:active{outline:none;transform:none}.map-dot.is-outside{opacity:.12}.map-dot.is-inside{opacity:1}
.map-priority-a{fill:#dc2626;background:#dc2626}.map-priority-b{fill:#f59e0b;background:#f59e0b}.map-priority-c{fill:#16a34a;background:#16a34a}.map-priority-none{fill:#94a3b8;background:#94a3b8}
.map-selection-rect{fill:rgba(37,99,235,.10);stroke:#2563eb;stroke-width:1.6;stroke-dasharray:7 4;vector-effect:non-scaling-stroke;cursor:move}
.map-empty{position:absolute;left:16px;right:16px;bottom:16px;padding:10px 12px;text-align:center;border:1px solid var(--border,#e5e7eb);border-radius:8px;background:rgba(255,255,255,.94);color:#64748b;font-size:12px}
.map-panel-footer{padding:10px 16px 12px;border-top:1px solid var(--border,#e5e7eb);color:#64748b;font-size:11px}.map-coverage{margin-bottom:8px}.map-legend{flex-wrap:wrap;gap:12px}.map-legend span{display:inline-flex;align-items:center;gap:5px}.map-legend-dot{display:inline-block;width:8px;height:8px;border-radius:50%}
.map-coverage-link{appearance:none;border:0;background:transparent;color:var(--accent,#b42332);font:inherit;font-weight:700;padding:0;text-decoration:underline;text-underline-offset:2px;cursor:pointer}.map-coverage-link:hover{opacity:.78}.map-coverage-link:focus-visible{outline:2px solid var(--accent,#b42332);outline-offset:2px;border-radius:3px}.map-missing-list{margin:2px 0 10px;border:1px solid var(--border,#e5e7eb);border-radius:10px;background:var(--surface,#fff);max-height:220px;overflow:auto}.map-missing-list-head{padding:9px 10px;border-bottom:1px solid var(--border,#e5e7eb);display:flex;gap:5px;flex-direction:column}.map-missing-list-head span{color:var(--muted,#64748b)}.map-missing-item{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 10px;border-bottom:1px solid var(--border,#e5e7eb)}.map-missing-item:last-child{border-bottom:0}.map-missing-item>div{min-width:0;display:grid;gap:2px}.map-missing-item strong,.map-missing-item span,.map-missing-item small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.map-missing-item span,.map-missing-item small{color:var(--muted,#64748b)}.map-missing-item button{flex:0 0 auto;padding:6px 9px;font-size:.72rem}
.map-zoom-controls{position:absolute;right:22px;top:22px;z-index:2;display:grid;grid-template-columns:38px;gap:6px}.map-zoom-button,.map-reset-button{min-width:38px;height:38px;padding:0;border:1px solid var(--border,#d7dce2);border-radius:8px;background:var(--panel,#fff);color:var(--text,#1f2937);font:700 19px/1 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;box-shadow:0 2px 8px rgba(15,23,42,.08);cursor:pointer}.map-reset-button{height:auto;min-height:32px;padding:6px 7px;font-size:10px;text-transform:uppercase;letter-spacing:.04em}.map-zoom-button:hover,.map-reset-button:hover{background:var(--surface-muted,#f8fafc)}.map-focus-label{position:absolute;left:22px;top:22px;z-index:2;max-width:calc(100% - 120px);padding:6px 9px;border:1px solid rgba(37,99,235,.25);border-radius:999px;background:rgba(239,246,255,.94);color:#1d4ed8;font-size:11px;font-weight:750;pointer-events:none}
.map-popover{position:absolute;z-index:4;max-width:180px;padding:4px 7px;border:1px solid var(--border,#dbe2ea);border-radius:6px;background:rgba(255,255,255,.97);box-shadow:0 4px 14px rgba(15,23,42,.14);color:var(--text,#1f2937);font-size:10.5px;font-weight:750;line-height:1.15;pointer-events:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:720px){.map-panel{width:100vw}.map-side-tab{top:auto;bottom:72px}.map-selection-toolbar{align-items:flex-start;flex-direction:column}.map-selection-actions{width:100%;flex-wrap:wrap}.map-selection-actions button{flex:1 1 auto}.map-zoom-controls{right:18px;top:18px}.map-focus-label{left:18px;top:18px}}
@media (prefers-reduced-motion:reduce){.map-panel,.map-dot{transition:none}}
body[data-theme="dark"] .map-ocean{fill:#0f172a}body[data-theme="dark"] .map-world{fill:#1e293b;stroke:#475569}body[data-theme="dark"] .map-country-highlight{fill:rgba(59,130,246,.18);stroke:#60a5fa}body[data-theme="dark"] .map-focus-label{background:rgba(30,58,138,.92);color:#bfdbfe;border-color:#3b82f6}body[data-theme="dark"] .map-empty{background:rgba(15,23,42,.94)}


/* ==========================================================================\n   MIM 1.4.14 — Sales cockpit redesign\n   ========================================================================== */
:root{
  --cockpit-blue:#2563eb;
  --cockpit-blue-soft:#eff6ff;
  --cockpit-line:#e2e8f0;
  --cockpit-soft:#f8fafc;
  --cockpit-red:#ef4444;
  --cockpit-red-soft:#fff1f2;
  --cockpit-green:#16a34a;
}
body{background:#f5f7fb}
main{width:min(1680px,calc(100% - 36px));margin:16px auto 48px}
.cockpit-header{min-height:78px;padding:12px max(18px,calc((100vw - 1680px)/2));gap:24px;background:rgba(255,255,255,.98)}
.brand-block{min-width:260px}.brand-block h1{font-size:1.35rem;letter-spacing:-.025em}.brand-block .eyebrow{margin:3px 0 0;font-size:.63rem;letter-spacing:.13em}
.primary-nav{display:flex;align-items:stretch;align-self:stretch;gap:8px;margin-right:auto}
.nav-button{position:relative;display:inline-flex;align-items:center;justify-content:center;min-width:76px;padding:10px 13px;border:0;border-radius:9px;background:transparent;color:#334155;text-decoration:none;font-size:.82rem;font-weight:800;box-shadow:none}
.nav-button:hover{background:#f8fafc}.nav-button.active{background:var(--cockpit-blue-soft);color:#1d4ed8}.nav-button.active:after{content:"";position:absolute;left:12px;right:12px;bottom:-13px;height:2px;border-radius:2px;background:#93c5fd}
.cockpit-actions{flex-wrap:nowrap}.drive-status-button,.version-badge,.install-compact{white-space:nowrap}
.drive-status-button{display:inline-flex;align-items:center;gap:8px;border:0;border-radius:999px;padding:9px 12px;background:#f8fafc;color:#475569;font-size:.78rem;font-weight:800}.drive-status-button:before{content:"";width:9px;height:9px;border-radius:50%;background:#94a3b8;box-shadow:0 0 0 3px rgba(148,163,184,.12)}.drive-status-button.is-connected:before{background:#22a35a;box-shadow:0 0 0 3px rgba(34,163,90,.12)}
.version-badge{display:inline-flex;align-items:center;padding:7px 2px;background:transparent;color:#64748b;font-size:.73rem;font-weight:700}.install-compact{border:0;background:transparent;color:#475569;padding:8px;font-size:.76rem}.new-lead-cta{padding:10px 17px;box-shadow:0 5px 14px rgba(15,23,42,.12)}
.cockpit-filters{grid-template-columns:minmax(300px,1.75fr) repeat(4,minmax(145px,.82fr)) auto;gap:10px;padding:13px 14px;border-color:var(--cockpit-line);box-shadow:0 4px 18px rgba(15,23,42,.04)}
.cockpit-filters label{gap:5px;font-size:.72rem;color:#334155}.cockpit-filters input,.cockpit-filters select{height:40px;padding:8px 11px;border-color:#d7dee8;background:#fff}.toolbar-buttons{align-items:end;flex-wrap:nowrap;height:40px}.more-filters-btn{height:40px}.clear-filter-btn{height:40px;color:#2563eb;font-weight:800}
.summary-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:12px 0;padding:0;overflow:hidden;border-color:var(--cockpit-line);box-shadow:0 4px 18px rgba(15,23,42,.035)}
.summary-strip .metric{position:relative;padding:14px 18px;border:0;border-radius:0;box-shadow:none;background:transparent}.summary-strip .metric:not(:last-child):after{content:"";position:absolute;right:0;top:14px;bottom:14px;width:1px;background:#e8edf3}.summary-strip .metric span{font-size:.74rem}.summary-strip .metric strong{margin-top:2px;font-size:1.45rem}.summary-strip .metric-alert{cursor:pointer;background:linear-gradient(90deg,#fff7f7,#fff)}.summary-strip .metric-alert span,.summary-strip .metric-alert strong{color:#dc2626}.summary-strip .metric-alert:hover{background:#fff1f2}
.dashboard-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(390px,29vw);gap:14px;align-items:start}
.dashboard-workspace .table-panel{min-width:0;border-color:var(--cockpit-line);box-shadow:0 4px 18px rgba(15,23,42,.04)}
.table-heading{padding:14px 18px}.table-heading h2{font-size:1.18rem}.table-heading p{font-size:.77rem}.view-actions{gap:5px}.view-actions .ghost{padding:6px 8px;color:#475569}
#leadTable{min-width:850px;table-layout:auto}#leadTable th,#leadTable td{padding:10px 12px;border-bottom-color:#e8edf3;font-size:.77rem}#leadTable th{background:#fbfcfe;color:#64748b;font-size:.68rem;letter-spacing:.04em}#leadTable tbody tr{transition:background .08s}#leadTable tbody tr:hover{background:#f8fbff}
#leadTable th:nth-child(2),#leadTable td:nth-child(2){min-width:145px}#leadTable th:nth-child(3),#leadTable td:nth-child(3){min-width:210px}#leadTable th:nth-child(4),#leadTable td:nth-child(4){min-width:90px}#leadTable th:nth-child(5),#leadTable td:nth-child(5){min-width:105px}.company-cell strong,.contact-cell strong{font-size:.79rem}.cell-sub{margin-top:2px;font-size:.68rem;color:#718096;white-space:nowrap;max-width:230px;overflow:hidden;text-overflow:ellipsis}
.priority-pill{min-width:22px;padding:3px 6px;border-radius:6px;color:#fff;font-size:.68rem}.priority-A{background:#ef4444}.priority-B{background:#f59e0b}.priority-C{background:#22a35a}
.status-pill{min-width:68px;justify-content:center;padding:4px 8px;font-size:.68rem}.status-positive{background:#eaf8ef;color:#15803d}.status-new{background:#eaf2ff;color:#1d4ed8}.status-warm{background:#fff7e6;color:#a16207}.status-muted{background:#eef2f7;color:#64748b}
.updated-cell{white-space:nowrap;color:#475569}.row-open-column{width:38px!important;min-width:38px!important;text-align:center;position:static!important;box-shadow:none!important;background:inherit!important}.row-open-button{width:30px;height:30px;padding:0;border:0;border-radius:7px;background:transparent;color:#475569;font-size:1.25rem;line-height:1}.row-open-button:hover{background:#eef4ff;color:#1d4ed8}
#leadTable th:last-child,#leadTable td:last-child{position:static;width:38px;min-width:38px;background:inherit;box-shadow:none}#leadTable th:last-child{background:#fbfcfe}#leadTable tbody tr:hover td:last-child{background:inherit}
.cockpit-map-panel{position:sticky;top:94px;right:auto;bottom:auto;z-index:10;width:auto;height:calc(100vh - 112px);min-height:570px;max-height:900px;display:none;transform:none;border:1px solid var(--cockpit-line);border-radius:14px;box-shadow:0 4px 18px rgba(15,23,42,.05);overflow:hidden}.cockpit-map-panel.is-open{display:flex;transform:none}.cockpit-map-panel .map-panel-header{padding:12px 14px}.cockpit-map-panel .map-panel-header h2{font-size:1rem}.cockpit-map-panel .map-panel-header .eyebrow{display:none}.cockpit-map-panel #mapCloseBtn{display:none}.map-canvas-wrap{padding:0;background:#dff1fb}.map-ocean{fill:#dff1fb}.map-world{fill:#f2f7f7;stroke:#b8c8d1;stroke-width:.65}.map-country-highlight{fill:rgba(37,99,235,.13);stroke:#2563eb}.map-panel-footer{background:#fff}.map-zoom-controls{left:14px;right:auto;top:14px}.map-focus-label{left:66px;top:14px}.map-zoom-button,.map-reset-button{background:rgba(255,255,255,.96)}
.map-selection-toolbar{font-size:.72rem}.map-selection-actions button{padding:6px 8px;font-size:.7rem}
.map-popover{font-size:10px}.map-popover strong{font-size:10px}
.mobile-cards .lead-card{box-shadow:0 3px 12px rgba(15,23,42,.04)}
html[data-theme="dark"] body{background:var(--bg)}html[data-theme="dark"] .cockpit-header{background:rgba(17,24,39,.98)}html[data-theme="dark"] .nav-button{color:#cbd5e1}html[data-theme="dark"] .nav-button:hover{background:var(--surface-2)}html[data-theme="dark"] .nav-button.active{background:#172554;color:#bfdbfe}html[data-theme="dark"] .drive-status-button{background:var(--surface-2);color:#cbd5e1}html[data-theme="dark"] .summary-strip .metric-alert{background:#2a1719}html[data-theme="dark"] .summary-strip .metric:not(:last-child):after{background:#273449}html[data-theme="dark"] #leadTable th:last-child{background:var(--surface-2)}html[data-theme="dark"] .map-canvas-wrap{background:#122537}
@media(max-width:1320px){.cockpit-header{gap:14px}.brand-block{min-width:220px}.nav-button{min-width:66px;padding-inline:10px}.cockpit-filters{grid-template-columns:minmax(260px,1.4fr) repeat(4,minmax(125px,.8fr)) auto}.dashboard-workspace{grid-template-columns:minmax(0,1fr) 380px}}
@media(max-width:1179px){.dashboard-workspace{display:block}.cockpit-map-panel{position:fixed;z-index:1100;top:0;right:0;bottom:0;width:min(720px,100vw);height:100vh;max-height:none;min-height:0;border-radius:0;border-width:0 0 0 1px;transform:translateX(102%);display:flex}.cockpit-map-panel.is-open{transform:translateX(0)}.cockpit-map-panel #mapCloseBtn{display:inline-flex}.primary-nav{order:3;flex:1 1 100%;height:44px}.cockpit-header{flex-wrap:wrap}.brand-block{margin-right:auto}.cockpit-actions{margin-left:auto}.nav-button.active:after{bottom:-8px}.cockpit-filters{grid-template-columns:minmax(240px,2fr) repeat(2,minmax(130px,1fr));}.toolbar-buttons{grid-column:span 1}.summary-strip{grid-template-columns:repeat(4,1fr)}}
@media(max-width:760px){main{width:min(100% - 18px,1680px);margin-top:10px}.cockpit-header{padding:10px 12px;gap:8px}.brand-block{min-width:0}.brand-block h1{font-size:1.12rem}.brand-block .eyebrow{font-size:.55rem}.cockpit-actions{gap:6px}.version-badge{display:none}.drive-status-button{padding:8px 9px;font-size:0}.drive-status-button:after{content:"Drive";font-size:.72rem}.new-lead-cta{padding:9px 12px}.primary-nav{overflow-x:auto;justify-content:flex-start;gap:3px}.nav-button{min-width:auto;padding:8px 10px;font-size:.74rem}.nav-button.active:after{display:none}.cockpit-filters{grid-template-columns:1fr 1fr;padding:10px}.cockpit-filters .search-field{grid-column:1/-1}.toolbar-buttons{grid-column:1/-1}.summary-strip{grid-template-columns:1fr 1fr}.summary-strip .metric:nth-child(2):after{display:none}.summary-strip .metric{padding:11px 13px}.summary-strip .metric strong{font-size:1.25rem}.table-heading{padding:12px 13px}.cockpit-map-panel{width:100vw}.map-panel-footer{padding-bottom:max(12px,env(safe-area-inset-bottom))}}
@media(max-width:460px){.summary-strip .metric{padding:10px}.summary-strip .metric span{font-size:.66rem}.summary-strip .metric strong{font-size:1.15rem}.cockpit-actions #installBtn{display:none!important}}
@media(min-width:1180px){.dashboard-workspace:not(:has(.cockpit-map-panel.is-open)){grid-template-columns:minmax(0,1fr)}}
@media(max-width:500px){.cockpit-header{flex-direction:row;flex-wrap:wrap;align-items:center}.cockpit-actions{width:auto}.cockpit-actions .primary{flex:0 0 auto}}

/* ==========================================================================\n   MIM 1.4.16 — Workspace dialogs + location verification polish\n   ========================================================================== */
:root{
  --ui-font:"Segoe UI Variable Text","SF Pro Text","Aptos",Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --display-font:"Segoe UI Variable Display","SF Pro Display","Aptos Display",Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --dialog-bg:#f5f7fb;
  --dialog-card:#ffffff;
  --dialog-border:#e3e8f0;
  --dialog-shadow:0 28px 85px rgba(15,23,42,.22);
}
body,button,input,select,textarea{font-family:var(--ui-font)}
h1,h2,h3,h4,.brand-block h1{font-family:var(--display-font);font-variation-settings:"wght" 700;letter-spacing:-.02em}

/* Coordinate verification is intentionally visible. It is a review action,
   not an automatic geocoder that silently overwrites location data. */
.coordinate-details-body{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.coordinate-verify-button{grid-column:1/-1;justify-self:start;display:inline-flex;align-items:center;gap:7px;border-color:#bfdbfe;background:#eff6ff;color:#1d4ed8;font-weight:800}
.coordinate-verify-button:before{content:"⌖";font-size:1rem;line-height:1}
.coordinate-verify-button:hover{border-color:#93c5fd;background:#dbeafe;color:#1e40af}
.coordinate-verify-help{grid-column:1/-1;margin-top:-4px;color:#64748b;font-size:.74rem;line-height:1.45}

/* Modern workspace dialogs */
.modern-workspace-dialog{
  color:#172033;
  background:var(--dialog-bg);
  border:1px solid rgba(203,213,225,.92);
  border-radius:22px;
  box-shadow:var(--dialog-shadow);
  font-family:var(--ui-font);
}
.modern-workspace-dialog::backdrop{background:rgba(15,23,42,.48);backdrop-filter:blur(5px)}
.modern-workspace-dialog .modal-header{
  padding:20px 22px 18px;
  background:rgba(255,255,255,.98);
  border-bottom:1px solid var(--dialog-border);
  box-shadow:0 1px 0 rgba(255,255,255,.7);
}
.modern-workspace-dialog .modal-header>div{min-width:0}
.modern-workspace-dialog .modal-header .eyebrow{margin:0 0 4px;color:#2563eb;font-size:.62rem;font-weight:850;letter-spacing:.14em}
.modern-workspace-dialog .modal-header h2{margin:0;color:#111827;font-size:1.38rem;font-weight:780;letter-spacing:-.035em}
.modern-workspace-dialog .modal-subtitle{max-width:650px;margin:5px 0 0;color:#64748b;font-size:.78rem;line-height:1.45}
.modern-workspace-dialog .icon-button{width:36px;height:36px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;color:#475569;font-size:1.25rem;box-shadow:0 1px 2px rgba(15,23,42,.04)}
.modern-workspace-dialog .icon-button:hover{background:#f8fafc;color:#0f172a;border-color:#cbd5e1}
.modern-workspace-dialog .modal-footer{padding:13px 20px;background:rgba(255,255,255,.98);border-top:1px solid var(--dialog-border)}
.modern-workspace-dialog button,.modern-workspace-dialog input,.modern-workspace-dialog select,.modern-workspace-dialog textarea{border-radius:10px}
.modern-workspace-dialog button{font-weight:750}
.modern-workspace-dialog input,.modern-workspace-dialog select,.modern-workspace-dialog textarea{border-color:#d7dee8;background:#fff;color:#172033}
.modern-workspace-dialog input:focus,.modern-workspace-dialog select:focus,.modern-workspace-dialog textarea:focus{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(37,99,235,.10);outline:none}

/* Settings */
#settingsDialog{width:min(880px,calc(100% - 28px));background:var(--dialog-bg)}
#settingsDialog .settings-section{
  margin:14px 16px 0;
  padding:18px;
  border:1px solid var(--dialog-border);
  border-radius:16px;
  background:var(--dialog-card);
  box-shadow:0 4px 14px rgba(15,23,42,.035);
}
#settingsDialog .settings-section:last-of-type{margin-bottom:16px}
#settingsDialog .settings-section h3{margin:0 0 4px;color:#172033;font-size:.98rem;font-weight:780;letter-spacing:-.018em}
#settingsDialog .settings-copy{margin:0 0 13px;color:#64748b;font-size:.76rem;line-height:1.5}
#settingsDialog .appearance-options{gap:10px}
#settingsDialog .appearance-options label{
  min-height:58px;
  padding:11px 13px;
  border-color:#e2e8f0;
  border-radius:12px;
  background:#f8fafc;
  color:#334155;
  font-weight:700;
  transition:border-color .12s,background .12s,box-shadow .12s;
}
#settingsDialog .appearance-options label:hover{border-color:#bfdbfe;background:#f8fbff}
#settingsDialog .appearance-options label:has(input:checked){border-color:#93c5fd;background:#eff6ff;color:#1d4ed8;box-shadow:0 0 0 1px #bfdbfe inset}
#settingsDialog .drive-settings-actions{gap:8px;margin:11px 0 5px}
#settingsDialog .drive-settings-actions button{min-height:38px;padding:8px 11px}
#settingsDialog .duplicate-settings-button{background:#fff7ed;border-color:#fed7aa;color:#9a3412}
#settingsDialog .button-count{display:inline-flex;min-width:23px;height:22px;align-items:center;justify-content:center;margin-left:3px;padding:0 6px;border-radius:999px;background:#ffedd5;color:#9a3412;font-size:.7rem;font-weight:850}
#settingsDialog .settings-key-row{gap:9px;padding:12px;border:1px solid #e7edf4;border-radius:12px;background:#f8fafc}
#settingsDialog #googleDriveStatus{display:inline-flex;align-items:center;gap:7px;margin:7px 0 3px;padding:6px 9px;border-radius:999px;background:#f1f5f9;color:#475569;font-weight:700}
#settingsDialog #googleDriveStatus:before{content:"";width:7px;height:7px;border-radius:50%;background:#94a3b8}
#settingsDialog .sync-diagnostics{gap:9px}
#settingsDialog .sync-diagnostics>*{border-radius:11px}
#settingsDialog .setup-details{border-color:#e2e8f0;border-radius:12px;background:#f8fafc;color:#64748b}
#settingsDialog .setup-details summary{color:#334155;font-weight:750}
#settingsDialog .sync-log-row{border-radius:9px;background:#f8fafc}

/* Exhibitions */
#exhibitionDialog{width:min(1220px,96vw);background:var(--dialog-bg)}
#exhibitionDialog .exhibition-toolbar{
  margin:16px 18px 0;
  padding:14px;
  border:1px solid var(--dialog-border);
  border-radius:16px;
  background:#fff;
  box-shadow:0 4px 14px rgba(15,23,42,.035);
}
#exhibitionDialog .exhibition-toolbar label>span,#exhibitionDialog .exhibition-controls label>span{display:block;margin-bottom:5px;color:#64748b;font-size:.68rem;font-weight:800;letter-spacing:.035em;text-transform:uppercase}
#exhibitionDialog .exhibition-toolbar button{min-height:38px}
#exhibitionDialog .exhibition-setup,#exhibitionDialog .exhibition-import-panel{
  margin:14px 18px 0;
  padding:17px;
  border-color:var(--dialog-border);
  border-radius:16px;
  background:#fff;
  box-shadow:0 4px 14px rgba(15,23,42,.035);
}
#exhibitionDialog .section-heading-row h3{margin:0 0 3px;font-size:1rem;color:#172033}
#exhibitionDialog .section-heading-row p{margin:0;color:#64748b;font-size:.76rem;line-height:1.45}
#exhibitionDialog .exhibition-empty{
  margin:16px 18px;
  padding:52px 22px;
  border:1px dashed #cbd5e1;
  border-radius:18px;
  background:rgba(255,255,255,.72);
}
#exhibitionDialog .exhibition-empty h3{margin:0 0 6px;font-size:1.12rem;color:#172033}
#exhibitionDialog .exhibition-empty p{max-width:560px;margin:0 auto 16px;color:#64748b;font-size:.8rem;line-height:1.55}
#exhibitionWorkspace{padding:0 18px 18px}
#exhibitionDialog .exhibition-heading{margin:18px 0 10px;padding:0 2px}
#exhibitionDialog .exhibition-heading h3{font-size:1.22rem;letter-spacing:-.025em;color:#172033}
#exhibitionDialog .exhibition-legend{align-items:center}
#exhibitionDialog .match-badge{border-radius:999px;padding:5px 8px;font-size:.66rem;font-weight:800}
#exhibitionDialog .exhibition-summary-grid{gap:9px;margin-bottom:11px}
#exhibitionDialog .exhibition-stat{
  min-height:72px;
  padding:11px 13px;
  border-color:#e2e8f0;
  border-radius:14px;
  background:#fff;
  box-shadow:0 2px 7px rgba(15,23,42,.025);
  transition:transform .12s,border-color .12s,box-shadow .12s;
}
#exhibitionDialog .exhibition-stat:hover{transform:translateY(-1px);border-color:#bfdbfe;box-shadow:0 7px 18px rgba(15,23,42,.06)}
#exhibitionDialog .exhibition-stat span{color:#64748b;font-size:.68rem;font-weight:750}
#exhibitionDialog .exhibition-stat strong{color:#172033;font-size:1.45rem;letter-spacing:-.03em}
#exhibitionDialog .exhibition-stat:nth-child(1){background:linear-gradient(135deg,#f0fdf4,#fff);border-color:#dcfce7}
#exhibitionDialog .exhibition-stat:nth-child(2){background:linear-gradient(135deg,#eff6ff,#fff);border-color:#dbeafe}
#exhibitionDialog .exhibition-stat:nth-child(3){background:linear-gradient(135deg,#fffbeb,#fff);border-color:#fef3c7}
#exhibitionDialog .exhibition-stat:nth-child(4){background:linear-gradient(135deg,#f8fafc,#fff);border-color:#e2e8f0}
#exhibitionDialog .exhibition-stat.visit-stat{background:linear-gradient(135deg,#faf5ff,#fff);border-color:#e9d5ff}
#exhibitionDialog .exhibition-controls{
  gap:9px;
  padding:12px;
  border:1px solid var(--dialog-border);
  border-radius:14px;
  background:#fff;
}
#exhibitionDialog .exhibition-table-wrap{border-color:var(--dialog-border);border-radius:15px;box-shadow:0 3px 12px rgba(15,23,42,.035)}
#exhibitionDialog .exhibition-table th{padding:10px 9px;background:#f8fafc;color:#64748b;font-size:.67rem;font-weight:850;letter-spacing:.04em;text-transform:uppercase}
#exhibitionDialog .exhibition-table td{padding:11px 9px;border-bottom-color:#edf1f5;font-size:.76rem}
#exhibitionDialog .exhibition-table tbody tr:hover{background:#f8fbff}
#exhibitionDialog .exhibition-mobile-cards .exhibition-card{border-color:#e2e8f0;background:#fff;box-shadow:0 3px 12px rgba(15,23,42,.035)}

html[data-theme="dark"]{
  --dialog-bg:#0f172a;
  --dialog-card:#111827;
  --dialog-border:#263244;
}
html[data-theme="dark"] .modern-workspace-dialog{color:#e5e7eb;background:var(--dialog-bg);border-color:#334155}
html[data-theme="dark"] .modern-workspace-dialog .modal-header,html[data-theme="dark"] .modern-workspace-dialog .modal-footer{background:rgba(17,24,39,.98);border-color:#263244}
html[data-theme="dark"] .modern-workspace-dialog .modal-header h2,html[data-theme="dark"] #settingsDialog .settings-section h3,html[data-theme="dark"] #exhibitionDialog .section-heading-row h3,html[data-theme="dark"] #exhibitionDialog .exhibition-heading h3,html[data-theme="dark"] #exhibitionDialog .exhibition-empty h3{color:#f8fafc}
html[data-theme="dark"] .modern-workspace-dialog .modal-subtitle,html[data-theme="dark"] #settingsDialog .settings-copy,html[data-theme="dark"] #exhibitionDialog .section-heading-row p,html[data-theme="dark"] #exhibitionDialog .exhibition-empty p{color:#94a3b8}
html[data-theme="dark"] .modern-workspace-dialog .icon-button,html[data-theme="dark"] #settingsDialog .settings-section,html[data-theme="dark"] #exhibitionDialog .exhibition-toolbar,html[data-theme="dark"] #exhibitionDialog .exhibition-setup,html[data-theme="dark"] #exhibitionDialog .exhibition-import-panel,html[data-theme="dark"] #exhibitionDialog .exhibition-controls,html[data-theme="dark"] #exhibitionDialog .exhibition-stat,html[data-theme="dark"] #exhibitionDialog .exhibition-mobile-cards .exhibition-card{background:#111827;border-color:#263244;color:#e5e7eb}
html[data-theme="dark"] .modern-workspace-dialog input,html[data-theme="dark"] .modern-workspace-dialog select,html[data-theme="dark"] .modern-workspace-dialog textarea{background:#0b1220;border-color:#334155;color:#e5e7eb}
html[data-theme="dark"] #settingsDialog .appearance-options label,html[data-theme="dark"] #settingsDialog .settings-key-row,html[data-theme="dark"] #settingsDialog .setup-details{background:#0f172a;border-color:#334155;color:#cbd5e1}
html[data-theme="dark"] #settingsDialog .appearance-options label:has(input:checked){background:#172554;border-color:#3b82f6;color:#bfdbfe}
html[data-theme="dark"] #exhibitionDialog .exhibition-empty{background:rgba(17,24,39,.7);border-color:#334155}
html[data-theme="dark"] #exhibitionDialog .exhibition-stat:nth-child(n){background:#111827;border-color:#263244}
html[data-theme="dark"] #exhibitionDialog .exhibition-stat strong{color:#f8fafc}
html[data-theme="dark"] #exhibitionDialog .exhibition-table th{background:#0f172a;color:#94a3b8}
html[data-theme="dark"] #exhibitionDialog .exhibition-table td{border-bottom-color:#263244}
html[data-theme="dark"] #exhibitionDialog .exhibition-table tbody tr:hover{background:#131d2c}
html[data-theme="dark"] .coordinate-verify-button{background:#172554;border-color:#1d4ed8;color:#bfdbfe}
html[data-theme="dark"] .coordinate-verify-help{color:#94a3b8}

@media(max-width:760px){
  .modern-workspace-dialog{border-radius:20px 20px 0 0}
  #settingsDialog{width:100%}
  #settingsDialog .settings-section{margin:10px 10px 0;padding:14px}
  #settingsDialog .settings-section:last-of-type{margin-bottom:10px}
  #exhibitionDialog .modal-header{padding:16px 15px 14px}
  #exhibitionDialog .exhibition-toolbar,#exhibitionDialog .exhibition-setup,#exhibitionDialog .exhibition-import-panel{margin:10px 10px 0;padding:12px}
  #exhibitionWorkspace{padding:0 10px 12px}
  #exhibitionDialog .exhibition-heading{margin-top:13px}
  #exhibitionDialog .exhibition-controls{padding:10px}
  .coordinate-details-body{grid-template-columns:1fr}
  .coordinate-verify-button,.coordinate-verify-help{grid-column:1}
}
.location-verify-row{display:flex;align-items:flex-start;gap:10px;margin-top:12px;padding:11px 12px;border:1px solid #dbeafe;border-radius:12px;background:#f8fbff}
.location-verify-row .coordinate-verify-button{flex:0 0 auto;margin:0}
.location-verify-row .coordinate-verify-help{margin:2px 0 0;max-width:680px}
html[data-theme="dark"] .location-verify-row{background:#111d35;border-color:#1e3a5f}
@media(max-width:760px){
  .location-verify-row{align-items:stretch;flex-direction:column}
  .location-verify-row .coordinate-verify-button{width:100%;justify-content:center}
  #exhibitionDialog{width:100vw;max-width:100vw;max-height:100dvh;height:100dvh;margin:0;border-radius:0}
}


/* MIM 1.4.17 — exact address coordinate verification */
.address-lookup-entered{display:grid;gap:5px;padding:12px 14px;margin:0 0 14px;border:1px solid var(--border,#dbe2ea);border-radius:12px;background:var(--surface-soft,#f8fafc)}
.address-lookup-entered span{font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--muted,#64748b)}
.address-lookup-entered strong{font-size:13px;line-height:1.45}
.address-lookup-entered a{font-size:12px;font-weight:700;text-decoration:none}
.suggestion-card-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.coordinate-match-badge{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;border-radius:999px;padding:3px 8px;background:#eef2f7;color:#475569;font-size:10px;font-weight:800;letter-spacing:.02em}
.coordinate-match-badge.is-strong{background:#eff6ff;color:#1d4ed8}
.coordinate-match-badge.is-exact{background:#ecfdf5;color:#047857}

/* ========================================================================== */
/* MIM 1.5.1 — brand system, cockpit polish, map fit and consistency          */
/* ========================================================================== */
:root{
  --brand:#6b0f1a;
  --brand-strong:#4d0b13;
  --brand-red:#e11d2e;
  --brand-soft:#fbf1f2;
  --brand-line:#ead7da;
  --primary:var(--brand);
  --primary-contrast:#fff;
  --focus:rgba(177,31,48,.18);
  --cockpit-line:#e7dde0;
}
body{background:linear-gradient(180deg,#f8f6f6 0,#f3f4f6 260px);}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[tabindex]:focus-visible{outline:3px solid rgba(177,31,48,.22);outline-offset:2px}
input:focus,select:focus,textarea:focus{border-color:#b42332;box-shadow:0 0 0 3px var(--focus)}
.primary{background:linear-gradient(180deg,#781522,#5f0d18);box-shadow:0 1px 1px rgba(49,7,13,.14)}
.primary:hover:not(:disabled){background:linear-gradient(180deg,#851a28,#6b0f1a)}

.brand-block{display:flex;align-items:center;gap:11px;min-width:250px}
.brand-mark{display:block;width:64px;height:28px;object-fit:contain;flex:0 0 auto}
.brand-copy{min-width:0}.brand-copy h1{line-height:1.05}.brand-copy .eyebrow{margin-top:5px;color:#8b6670;letter-spacing:.16em}
.cockpit-header{border-bottom-color:var(--brand-line);box-shadow:0 1px 0 rgba(107,15,26,.03)}
.nav-button.active{background:var(--brand-soft);color:var(--brand)}
.nav-button.active:after{background:var(--brand-red)}
.new-lead-cta{box-shadow:0 5px 14px rgba(107,15,26,.15)}
.drive-status-button.is-connected:before{background:#16a34a}
.summary-strip .metric-alert{background:#fff7f7;border-color:#f1d5d9}
.summary-strip .metric-alert strong{color:#b42332}

/* Give the lead list a desktop-app scrolling surface rather than a page that
   grows indefinitely. Mobile retains natural document scrolling. */
@media(min-width:761px){
  .desktop-table-wrap{max-height:calc(100vh - 292px);min-height:360px;overflow:auto;overscroll-behavior:contain}
  .desktop-table-wrap th{top:0}
}

/* MIM map: warm, branded geography while preserving A/B/C lead semantics. */
.cockpit-map-panel{height:auto;min-height:0;max-height:calc(100vh - 112px);background:#fff}
.cockpit-map-panel .map-canvas-wrap{flex:0 0 auto;width:100%;aspect-ratio:2/1;min-height:0;background:#fbf5f5;border-top:1px solid #f3e7e9;border-bottom:1px solid #f0e1e4}
.cockpit-map-panel .map-svg{display:block;width:100%;height:100%;max-height:none;aspect-ratio:auto;background:#fbf5f5}
.map-ocean{fill:#fbf5f5}
.map-world{fill:#f0dfe2;stroke:#d4adb4;stroke-width:.72}
.map-country-highlight{fill:rgba(225,29,46,.18);stroke:#b42332;stroke-width:1.8}
.map-focus-label{background:rgba(107,15,26,.94);border-color:#8d2532;color:#fff}
.map-zoom-button,.map-reset-button{border-color:#e4cdd1;color:#5b111a}
.map-selection-rect{fill:rgba(177,31,48,.10);stroke:#b42332}
.map-panel-footer{background:#fffdfd;border-top-color:#eadadd;color:#7c6870}
.map-popover{border-color:#d9bbc0;box-shadow:0 6px 22px rgba(83,20,31,.16)}

/* Keep priority markers informational rather than turning every lead red. */
.map-priority-a{fill:#dc2626}.map-priority-b{fill:#f59e0b}.map-priority-c{fill:#16a34a}.map-priority-none{fill:#94a3b8}

/* Shared modal/workspace treatment. */
dialog.modal{border-color:#e4d8db;box-shadow:0 28px 90px rgba(49,20,26,.24)}
.modal-header{border-bottom-color:#eadfe1}.modal-footer{border-top-color:#eadfe1}
.modal-header .eyebrow{color:#9b5661}
.settings-section,.exhibition-panel,.profile-section,.suggestion-card{border-color:#e7dde0}
.settings-card-feature{background:linear-gradient(180deg,#fff,#fffbfb)}
.settings-status-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:#16a34a;box-shadow:0 0 0 4px rgba(22,163,74,.08)}
.advanced-settings-details{border-top:1px solid #eee1e3;margin-top:14px;padding-top:10px}
.advanced-settings-body{padding-top:12px}
.settings-version-badge{display:inline-flex}

html[data-theme="dark"]{
  --brand-soft:#2b1519;--brand-line:#4a2b31;--cockpit-line:#3a2a2e;
}
html[data-theme="dark"] body{background:#111318}
html[data-theme="dark"] .brand-copy .eyebrow{color:#b99da4}
html[data-theme="dark"] .nav-button.active{background:#32171d;color:#fecdd3}
html[data-theme="dark"] .cockpit-map-panel{background:#171417}
html[data-theme="dark"] .cockpit-map-panel .map-canvas-wrap,html[data-theme="dark"] .cockpit-map-panel .map-svg{background:#24171a}
html[data-theme="dark"] .map-ocean{fill:#24171a}
html[data-theme="dark"] .map-world{fill:#39252a;stroke:#6b474f}
html[data-theme="dark"] .map-country-highlight{fill:rgba(244,63,94,.20);stroke:#fb7185}
html[data-theme="dark"] .map-panel-footer{background:#181518;border-top-color:#452d32;color:#bda8ad}
html[data-theme="dark"] .map-zoom-button,html[data-theme="dark"] .map-reset-button{background:rgba(35,24,27,.96);border-color:#67454c;color:#f5d9de}

@media(max-width:1179px){
  .cockpit-map-panel{height:100vh;max-height:none}
  .cockpit-map-panel .map-canvas-wrap{flex:1 1 auto;aspect-ratio:auto;min-height:0}
  .cockpit-map-panel .map-svg{width:100%;height:100%;object-fit:contain}
}
@media(max-width:760px){
  .brand-mark{width:48px;height:22px}.brand-block{gap:7px}.brand-copy h1{font-size:1rem}.brand-copy .eyebrow{font-size:.5rem}
}


/* MIM 1.5.1 — settings alignment + precision header mark */
.brand-mark{width:70px;height:24px;object-fit:contain;object-position:left center}
.maintenance-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}
.maintenance-card{display:flex;flex-direction:column;justify-content:space-between;gap:13px;min-width:0;padding:14px;border:1px solid #e7dde0;border-radius:13px;background:#fff}
.maintenance-card-quality{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center}
.maintenance-card-copy{display:grid;gap:4px;min-width:0}
.maintenance-card-copy strong{color:#172033;font-size:.82rem;font-weight:800;letter-spacing:-.01em}
.maintenance-card-copy span{color:#64748b;font-size:.73rem;line-height:1.45}
.maintenance-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.maintenance-actions button{min-height:38px}
.maintenance-card-quality .maintenance-actions{justify-content:flex-end}

#settingsDialog .status-list{gap:7px;margin-top:14px}
#settingsDialog .status-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(44px,auto) auto minmax(86px,auto);align-items:center;gap:8px;padding:7px;border:1px solid #e7edf4;border-radius:12px;background:#fff}
#settingsDialog .status-row>input{min-width:0;width:100%;height:40px}
#settingsDialog .status-count{display:inline-flex;align-items:center;justify-content:center;min-width:38px;height:30px;padding:0 8px;border-radius:999px;background:#f1f5f9;color:#475569;font-size:.72rem;font-weight:850;font-variant-numeric:tabular-nums}
#settingsDialog .status-order-actions{display:flex;align-items:center;gap:4px}
#settingsDialog .status-order-button{width:34px;min-width:34px;height:34px;padding:0;font-size:.88rem}
#settingsDialog .status-remove-button{min-width:82px;height:36px;padding:7px 10px;justify-self:end}
#settingsDialog .status-row button:disabled{opacity:.38;cursor:not-allowed;box-shadow:none}

html[data-theme="dark"] .maintenance-card,html[data-theme="dark"] #settingsDialog .status-row{background:#0f172a;border-color:#334155}
html[data-theme="dark"] .maintenance-card-copy strong{color:#f8fafc}
html[data-theme="dark"] .maintenance-card-copy span{color:#94a3b8}
html[data-theme="dark"] #settingsDialog .status-count{background:#1e293b;color:#cbd5e1}

@media(max-width:680px){
  .brand-mark{width:54px;height:21px}
  .maintenance-grid{grid-template-columns:1fr}
  .maintenance-card-quality{grid-column:auto;display:flex;align-items:stretch}
  .maintenance-card-quality .maintenance-actions{justify-content:flex-start}
  #settingsDialog .status-row{grid-template-columns:minmax(0,1fr) auto;gap:7px}
  #settingsDialog .status-count{grid-column:2;grid-row:1}
  #settingsDialog .status-order-actions{grid-column:1;grid-row:2;justify-self:start}
  #settingsDialog .status-remove-button{grid-column:2;grid-row:2;justify-self:end}
}

/* MIM 1.5.2 — local-first Drive backup + mobile polish */
.settings-status-dot{background:#94a3b8;box-shadow:0 0 0 4px rgba(148,163,184,.10)}
.settings-status-dot.is-connected{background:#16a34a;box-shadow:0 0 0 4px rgba(22,163,74,.08)}
#settingsDialog .drive-primary-actions{align-items:center;gap:8px}
#settingsDialog .drive-primary-actions #syncGoogleDriveBtn{border-color:#d8b4ba;background:#fff7f8;color:#7a1722}
#settingsDialog .drive-primary-actions #downloadCloudBtn{border-color:#d7dee8;background:#fff;color:#334155}
#settingsDialog .sync-diagnostics{grid-template-columns:repeat(5,minmax(0,1fr))}
.map-reset-button{min-width:64px;height:34px;min-height:34px;padding:0 10px;font-size:11px;line-height:1;text-transform:none;letter-spacing:0;border-radius:9px;white-space:nowrap}

@media(max-width:900px){
  #settingsDialog .sync-diagnostics{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
  #settingsDialog{
    width:100%;
    max-width:none;
    max-height:calc(100dvh - max(8px,env(safe-area-inset-top)));
    margin:max(8px,env(safe-area-inset-top)) auto 0;
    border-radius:20px 20px 0 0;
  }
  #settingsDialog .modal-header{
    top:0;
    align-items:flex-start;
    padding:14px 16px 13px;
    padding-top:max(14px,calc(env(safe-area-inset-top) + 8px));
  }
  #settingsDialog .modal-header .eyebrow{display:none}
  #settingsDialog .modal-header h2{font-size:1.32rem;line-height:1.15}
  #settingsDialog .modal-subtitle{max-width:29rem;margin-top:4px;font-size:.76rem;line-height:1.4}
  #settingsDialog .modal-header .icon-button{flex:0 0 38px;width:38px;height:38px;margin-top:0}
  #settingsDialog .drive-primary-actions{display:grid;grid-template-columns:1fr 1fr}
  #settingsDialog .drive-primary-actions #connectGoogleDriveBtn,
  #settingsDialog .drive-primary-actions #disconnectGoogleDriveBtn{grid-column:span 2}
  #settingsDialog .drive-primary-actions button{width:100%;min-height:42px}
  #settingsDialog .sync-diagnostics{grid-template-columns:1fr 1fr}
}
@media(max-width:430px){
  #settingsDialog .sync-diagnostics{grid-template-columns:1fr}
}
