/* ============================================================================================================
   Biodata Manager (owner 2026-10-24) — the design system (brand.css tokens, docs/DESIGN.md): ivory page, Paper cards with a
   Petal Line, Sindoor Wine as the only primary, Cormorant headings, Outfit text, status colours always with a word.
   Phones (≤767) get cards, tablets (768–1024) and desktops the table (it scrolls sideways inside its own frame, never the page).
   Every rule is scoped under #crmRoot (the page root id kept from the Biodata CRM) so nothing leaks into the shared header.
   ============================================================================================================ */
html, body { background: var(--sm-bg); }
body.bm-page { margin: 0; }
#crmRoot { position: relative; color: var(--sm-ink); font-family: var(--sm-sans); line-height: 1.5; }
#crmRoot h1, #crmRoot h2, #crmRoot h3 { font-family: var(--sm-serif); color: var(--sm-wine); font-weight: 600; margin: 0; }
#crmRoot h1 i, #crmRoot h2 i { font-weight: 500; }
#crmRoot button { font-family: inherit; }
#crmRoot :focus-visible { outline: 2px solid var(--sm-wine); outline-offset: 2px; }
#crmRoot input, #crmRoot textarea { font-family: inherit; font-size: 16px; color: var(--sm-ink); }
#crmRoot [hidden] { display: none !important; }

/* ── signed-out gate ── */
#crmRoot .gate { min-height: 62vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; }
#crmRoot .gate-card { background: var(--sm-surface); border: 1px solid var(--sm-line); border-radius: var(--sm-r-card); max-width: 480px; width: 100%;
  box-sizing: border-box; padding: 40px 34px 34px; text-align: center; box-shadow: var(--sm-shadow-hero); }
#crmRoot .gate .crest { width: 48px; height: 52px; margin: 0 auto 12px; background: url('/static/assets/brand/mark.svg') center/contain no-repeat; }
#crmRoot .gate h1 { font-size: 44px; line-height: 1.05; margin: 8px 0 0; }
#crmRoot .gate .tag { color: var(--sm-text); font-size: 16px; line-height: 1.55; margin: 10px 0 22px; }
#crmRoot .gate ul { list-style: none; padding: 0; margin: 0 0 24px; text-align: left; }
#crmRoot .gate li { display: flex; gap: 14px; align-items: center; font-size: 15px; line-height: 1.5; padding: 8px 0; color: var(--sm-ink); }
#crmRoot .gate li i { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--sm-icon-well); color: var(--sm-wine); display: grid; place-items: center; }
#crmRoot .gate li i svg { width: 19px; height: 19px; }
#crmRoot .gate .fine { font-size: 13px; color: var(--sm-muted); margin: 16px 0 0; line-height: 1.5; }

/* ── page ── */
#crmRoot .bm-app { max-width: var(--sm-maxw); margin: 0 auto; padding: 28px var(--sm-gutter) 72px; box-sizing: border-box; min-height: 70vh; }
#crmRoot .bm-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 4px 0 20px; }
#crmRoot .bm-title { font-size: clamp(38px, 4.2vw, 54px); line-height: 1.04; margin-top: 8px !important; }
#crmRoot .bm-sub { color: var(--sm-text); font-size: 16px; line-height: 1.6; margin: 8px 0 0; max-width: 40em; }
#crmRoot .bm-nf-inline { color: var(--sm-no); font-weight: 500; }
#crmRoot .bm-stats { display: flex; gap: 10px; margin: 0; }
#crmRoot .bm-stats > div { background: var(--sm-surface); border: 1px solid var(--sm-line); border-radius: var(--sm-r-tile); padding: 10px 18px;
  text-align: center; min-width: 92px; }
#crmRoot .bm-stats dd { font: 600 32px/1 var(--sm-serif); color: var(--sm-wine); margin: 0; }
#crmRoot .bm-stats dt { font-size: 12.5px; color: var(--sm-muted); margin: 0 0 4px; }

/* ── upload card ── */
#crmRoot .bm-card { background: var(--sm-surface); border: 1px solid var(--sm-line); border-radius: var(--sm-r-card); padding: 20px; margin-bottom: 18px; }
#crmRoot .bm-upload-main { display: flex; gap: 14px; align-items: stretch; }
#crmRoot .bm-drop { flex: 1; display: flex; gap: 16px; align-items: center; border: 1.5px dashed var(--sm-rose); border-radius: var(--sm-r-tile);
  background: var(--sm-bg); padding: 18px 20px; cursor: pointer; transition: background-color .2s var(--sm-ease), border-color .2s var(--sm-ease); min-height: 84px; box-sizing: border-box; }
#crmRoot .bm-drop:hover, #crmRoot .bm-drop.is-over { background: var(--sm-bg-alt); border-color: var(--sm-wine); }
#crmRoot .bm-drop h2 { font-size: 26px; line-height: 1.1; }
#crmRoot .bm-drop p { margin: 4px 0 0; color: var(--sm-text); font-size: 15px; }
#crmRoot .bm-drop u { color: var(--sm-wine); text-underline-offset: 3px; }
#crmRoot .bm-drop-ic { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--sm-icon-well); color: var(--sm-wine); display: grid; place-items: center; }
#crmRoot .bm-drop-ic svg { width: 24px; height: 24px; }
#crmRoot .bm-paste-toggle { align-self: center; white-space: nowrap; }
#crmRoot .bm-paste { margin-top: 14px; }
#crmRoot .bm-lab { display: block; font: 500 12px/1.2 var(--sm-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--sm-rose-text); margin: 0 0 6px; }
#crmRoot textarea { width: 100%; box-sizing: border-box; min-height: 140px; background: var(--sm-surface); border: 1px solid var(--sm-line);
  border-radius: var(--sm-r-field); padding: 12px 14px; line-height: 1.5; resize: vertical; }
#crmRoot textarea:focus, #crmRoot .bm-in:focus { outline: none; border-color: var(--sm-wine); box-shadow: 0 0 0 3px rgba(125, 46, 62, .12); }
#crmRoot .bm-row-end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
#crmRoot .bm-how { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; color: var(--sm-text); font-size: 14px; line-height: 1.5; }
#crmRoot .bm-how svg { flex: none; width: 18px; height: 18px; color: var(--sm-rose); margin-top: 1px; }
#crmRoot .bm-queue { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
#crmRoot .bm-queue:empty, #crmRoot .bm-queue:empty + .bm-queue-foot { display: none; }
#crmRoot .bm-queue-foot { display: flex; justify-content: flex-end; margin-top: 4px; }
#crmRoot .bm-q { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--sm-line);
  border-radius: 14px; background: var(--sm-bg); }
#crmRoot .bm-q-ic { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; background: var(--sm-icon-well); color: var(--sm-wine);
  display: grid; place-items: center; font: 600 10px/1 var(--sm-sans); letter-spacing: .04em; }
#crmRoot .bm-q-name { font-size: 15px; color: var(--sm-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
#crmRoot .bm-q-state { font-size: 13.5px; color: var(--sm-text); grid-column: 2 / 4; }
#crmRoot .bm-q-state b { font-weight: 500; }
#crmRoot .bm-q.is-ok .bm-q-state b { color: var(--sm-ok); }
#crmRoot .bm-q.is-err .bm-q-state { color: var(--sm-no); }
#crmRoot .bm-q.is-warn .bm-q-state b { color: var(--sm-wait); }
#crmRoot .bm-q-size { font-size: 13px; color: var(--sm-muted); }
#crmRoot .bm-bar-prog { grid-column: 2 / 4; height: 4px; border-radius: 4px; background: var(--sm-bg-alt); overflow: hidden; }
#crmRoot .bm-bar-prog > i { display: block; height: 100%; width: 0; background: var(--sm-wine); border-radius: 4px; transition: width .2s linear; }
#crmRoot .bm-q.is-reading .bm-bar-prog > i { width: 100% !important; animation: bmPulse 1.2s ease-in-out infinite; }
@keyframes bmPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ── toolbar ── */
#crmRoot .bm-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 10px; }
#crmRoot .bm-search { flex: 1 1 320px; position: relative; min-width: 0; }
#crmRoot .bm-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--sm-muted); pointer-events: none; }
#crmRoot .bm-search input { width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 14px 10px 42px; border: 1px solid var(--sm-line);
  border-radius: 999px; background: var(--sm-surface); }
#crmRoot .bm-search input:focus { outline: none; border-color: var(--sm-wine); box-shadow: 0 0 0 3px rgba(125, 46, 62, .12); }
#crmRoot .bm-tools { display: flex; gap: 8px; flex-wrap: wrap; }
#crmRoot .bm-tool { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--sm-line);
  background: var(--sm-surface); color: var(--sm-ink); font-size: 15px; font-weight: 500; cursor: pointer; transition: border-color .15s, color .15s, background-color .15s; }
#crmRoot .bm-tool svg { width: 18px; height: 18px; flex: none; }
#crmRoot .bm-tool:hover, #crmRoot .bm-tool[aria-expanded="true"] { border-color: var(--sm-wine); color: var(--sm-wine); }
#crmRoot .bm-tool em { font-style: normal; min-width: 20px; height: 20px; border-radius: 10px; background: var(--sm-wine); color: #fff; font-size: 12px;
  display: inline-grid; place-items: center; padding: 0 5px; box-sizing: border-box; }
#crmRoot .bm-tool-icon { padding: 8px 12px; }
#crmRoot .bm-tool-plain { border-color: transparent; background: transparent; }
#crmRoot .bm-danger { color: var(--sm-no); }
#crmRoot .bm-danger:hover { border-color: var(--sm-no); color: var(--sm-no); background: var(--sm-no-bg); }
#crmRoot .bm-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; align-items: center; }
#crmRoot .bm-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 6px 4px 12px; border-radius: 999px; background: var(--sm-bg-alt);
  border: 1px solid var(--sm-line); color: var(--sm-ink); font-size: 14px; }
#crmRoot .bm-chip button { border: 0; background: transparent; color: var(--sm-text); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 17px; line-height: 1; }
#crmRoot .bm-chip button:hover { background: var(--sm-surface); color: var(--sm-wine); }
#crmRoot .bm-linkbtn { border: 0; background: none; color: var(--sm-wine); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; padding: 6px 4px; min-height: 34px; }

/* ── selection bar ── */
#crmRoot .bm-sel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 16px; margin: 0 0 10px; border-radius: 16px;
  background: var(--sm-bg-alt); border: 1px solid var(--sm-line); }
#crmRoot .bm-sel b { font-weight: 600; color: var(--sm-wine); }
#crmRoot .bm-sel-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#crmRoot .bm-sel .bm-tool { min-height: 40px; padding: 6px 14px; font-size: 14.5px; }

/* ── the table ── */
#crmRoot .bm-table-wrap { border: 1px solid var(--sm-line); border-radius: 18px; background: var(--sm-surface); overflow: auto; max-height: calc(100vh - 150px);
  -webkit-overflow-scrolling: touch; }
#crmRoot .bm-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 15px; }
#crmRoot .bm-table th, #crmRoot .bm-table td { padding: 0; border-bottom: 1px solid var(--sm-line); text-align: left; vertical-align: middle; }
#crmRoot .bm-table thead th { position: sticky; top: 0; z-index: 2; background: var(--sm-bg-alt); font: 500 12px/1.2 var(--sm-sans); letter-spacing: .08em;
  text-transform: uppercase; color: var(--sm-ink); white-space: nowrap; }
#crmRoot .bm-table thead th button { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: transparent;
  font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; text-align: left; }
#crmRoot .bm-table thead th button:hover { color: var(--sm-wine); }
#crmRoot .bm-table thead th .bm-sort { width: 10px; color: var(--sm-wine); }
#crmRoot .bm-table thead th.bm-th-plain { padding: 8px 12px; }
#crmRoot .bm-table tbody tr:hover td { background: #FDF8F4; }
#crmRoot .bm-table tbody tr.is-sel td { background: #F9EDE8; }
#crmRoot .bm-table tbody tr.is-new td { animation: bmNew 2.4s ease-out 1; }
@keyframes bmNew { from { background: var(--sm-icon-well); } to { background: transparent; } }
#crmRoot .bm-table td.bm-cell { max-width: 210px; }
#crmRoot .bm-cv { display: block; width: 100%; min-height: 46px; padding: 10px 12px; box-sizing: border-box; border: 0; background: transparent; text-align: left;
  font: inherit; color: var(--sm-ink); cursor: text; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 0; }
#crmRoot .bm-cv:hover { box-shadow: inset 0 0 0 1px rgba(125, 46, 62, .28); }
#crmRoot .bm-cv.is-flash { animation: bmNew 2.4s ease-out 1; }
#crmRoot .bm-empty-v { color: var(--sm-muted); }
#crmRoot .bm-nf { color: var(--sm-no); font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
#crmRoot .bm-nf::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; box-sizing: border-box; }
#crmRoot .bm-guess { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--sm-wait); margin-left: 6px; vertical-align: middle; }
#crmRoot .bm-cell-input { width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 12px; border: 0; outline: 2px solid var(--sm-wine); outline-offset: -2px;
  background: #fff; font-size: 16px; border-radius: 0; }
#crmRoot .bm-td-sel { width: 46px; }
#crmRoot .bm-td-sel label, #crmRoot .bm-card-sel { display: grid; place-items: center; width: 46px; min-height: 46px; cursor: pointer; }
#crmRoot .bm-card-sel { align-self: start; margin-top: 6px; }
#crmRoot input[type=checkbox].bm-ck { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; border: 1.5px solid rgba(125, 46, 62, .45);
  border-radius: 6px; background: var(--sm-surface); cursor: pointer; display: grid; place-items: center; }
#crmRoot input[type=checkbox].bm-ck:checked { background: var(--sm-wine); border-color: var(--sm-wine); }
#crmRoot input[type=checkbox].bm-ck:checked::after { content: ""; width: 10px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
#crmRoot input[type=checkbox].bm-ck:indeterminate { background: var(--sm-wine); border-color: var(--sm-wine); }
#crmRoot input[type=checkbox].bm-ck:indeterminate::after { content: ""; width: 10px; height: 2px; background: #fff; }
#crmRoot .bm-col-name { position: sticky; left: 0; z-index: 1; background: var(--sm-surface); min-width: 200px; }
#crmRoot .bm-table thead th.bm-col-name { z-index: 3; background: var(--sm-bg-alt); }
#crmRoot .bm-name { display: flex; align-items: center; gap: 4px; }
#crmRoot .bm-name .bm-cv { font-weight: 500; color: var(--sm-wine); }
#crmRoot .bm-open { flex: none; width: 36px; height: 36px; margin-right: 6px; border-radius: 50%; border: 1px solid var(--sm-line); background: var(--sm-surface);
  color: var(--sm-wine); cursor: pointer; display: grid; place-items: center; }
#crmRoot .bm-open:hover { border-color: var(--sm-wine); background: var(--sm-bg-alt); }
#crmRoot .bm-open svg { width: 17px; height: 17px; }
#crmRoot .bm-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font: 500 13px/1.2 var(--sm-sans); white-space: nowrap; border: 0; cursor: pointer; }
#crmRoot .bm-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
#crmRoot .st-New { background: var(--sm-bg-alt); color: var(--sm-ink); }
#crmRoot .st-Interested { background: var(--sm-ok-bg); color: var(--sm-ok); }
#crmRoot .st-Talking { background: var(--sm-wait-bg); color: var(--sm-wait); }
#crmRoot .st-Shortlisted { background: var(--sm-icon-well); color: var(--sm-wine); }
#crmRoot .st-Rejected { background: var(--sm-no-bg); color: var(--sm-no); }
#crmRoot .st-Ghosted { background: #EFE7E4; color: var(--sm-text); }
#crmRoot .bm-td-pad { padding: 6px 12px !important; }
#crmRoot .bm-tags { display: flex; gap: 4px; flex-wrap: nowrap; align-items: center; min-height: 34px; cursor: pointer; border: 0; background: transparent; padding: 0; font: inherit; }
#crmRoot .bm-tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--sm-surface); border: 1px solid rgba(184, 115, 122, .55);
  color: var(--sm-ink); font-size: 13px; white-space: nowrap; }
#crmRoot .bm-tag-add { color: var(--sm-wine); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
#crmRoot .bm-src { font-size: 12.5px; color: var(--sm-text); white-space: nowrap; }
#crmRoot .bm-src b { font-weight: 500; color: var(--sm-ink); }
#crmRoot .bm-dup { display: inline-block; margin-left: 6px; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--sm-wait-bg); color: var(--sm-wait); white-space: nowrap; }

/* ── phone cards ── */
#crmRoot .bm-cards { display: none; }
#crmRoot .bm-pc { background: var(--sm-surface); border: 1px solid var(--sm-line); border-radius: 18px; padding: 4px 14px 12px 4px; display: grid;
  grid-template-columns: 46px 1fr; gap: 0 4px; }
#crmRoot .bm-pc.is-sel { border-color: var(--sm-wine); box-shadow: 0 0 0 1px var(--sm-wine) inset; }
#crmRoot .bm-pc-body { min-width: 0; padding-top: 10px; cursor: pointer; border: 0; background: transparent; text-align: left; font: inherit; color: inherit; }
#crmRoot .bm-pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
#crmRoot .bm-pc-name { font: 600 22px/1.15 var(--sm-serif); color: var(--sm-wine); overflow-wrap: anywhere; }
#crmRoot .bm-pc-meta { font-size: 14.5px; color: var(--sm-text); margin-top: 3px; }
#crmRoot .bm-pc-rows { margin: 8px 0 0; display: grid; gap: 3px; font-size: 14.5px; }
#crmRoot .bm-pc-rows div { display: flex; gap: 8px; }
#crmRoot .bm-pc-rows dt { color: var(--sm-muted); min-width: 84px; flex: none; }
#crmRoot .bm-pc-rows dd { margin: 0; color: var(--sm-ink); min-width: 0; overflow-wrap: anywhere; }
#crmRoot .bm-pc .bm-tags { flex-wrap: wrap; margin-top: 8px; min-height: 0; }
#crmRoot .bm-empty { text-align: center; padding: 48px 20px; color: var(--sm-text); background: var(--sm-surface); border: 1px dashed var(--sm-line); border-radius: 18px; }
#crmRoot .bm-empty h3 { font-size: 28px; margin-bottom: 6px; }
#crmRoot .bm-foot-note { font-size: 13.5px; color: var(--sm-muted); margin: 12px 2px 0; }

/* ── popovers (filters, columns, menus) ── */
#crmRoot .bm-pop { position: absolute; z-index: 640; background: var(--sm-surface); border: 1px solid var(--sm-line); border-radius: 18px; box-shadow: var(--sm-shadow-pop);
  padding: 14px; min-width: 240px; max-width: min(420px, calc(100vw - 24px)); box-sizing: border-box; animation: bmPop .18s var(--sm-ease); max-height: min(70vh, 560px); overflow: auto; }
@keyframes bmPop { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
#crmRoot .bm-pop h4 { font: 500 12px/1.2 var(--sm-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--sm-rose-text); margin: 4px 0 8px; }
#crmRoot .bm-pop h4 + * { margin-bottom: 12px; }
#crmRoot .bm-opts { display: flex; gap: 6px; flex-wrap: wrap; }
#crmRoot .bm-opt { min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--sm-line); background: var(--sm-surface); color: var(--sm-ink);
  font-size: 14.5px; cursor: pointer; }
#crmRoot .bm-opt:hover { border-color: var(--sm-wine); color: var(--sm-wine); }
#crmRoot .bm-opt[aria-pressed="true"] { background: var(--sm-wine); border-color: var(--sm-wine); color: #fff; }
#crmRoot .bm-menu { display: grid; gap: 2px; min-width: 230px; }
#crmRoot .bm-menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: 0; background: transparent; padding: 10px 12px;
  border-radius: 12px; cursor: pointer; color: var(--sm-ink); font-size: 15px; min-height: 44px; }
#crmRoot .bm-menu button small { color: var(--sm-text); font-size: 13px; }
#crmRoot .bm-menu button:hover, #crmRoot .bm-menu button:focus-visible { background: var(--sm-bg-alt); color: var(--sm-wine); }
#crmRoot .bm-menu .bm-danger:hover { color: var(--sm-no); background: var(--sm-no-bg); }
#crmRoot .bm-age { display: flex; gap: 8px; align-items: center; }
#crmRoot .bm-in { width: 100%; box-sizing: border-box; min-height: 44px; padding: 9px 12px; border: 1px solid var(--sm-line); border-radius: var(--sm-r-field); background: var(--sm-surface); }
#crmRoot .bm-age .bm-in { width: 88px; }
#crmRoot .bm-colgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
#crmRoot .bm-colgrid label { display: flex; gap: 8px; align-items: center; min-height: 36px; font-size: 14.5px; cursor: pointer; }
#crmRoot .bm-addcol { display: flex; gap: 8px; }
#crmRoot .bm-custom-list { display: grid; gap: 6px; margin-bottom: 10px; }
#crmRoot .bm-custom-list div { display: flex; gap: 6px; align-items: center; }
#crmRoot .bm-custom-list .bm-in { flex: 1; }
#crmRoot .bm-icon-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--sm-line); background: var(--sm-surface); color: var(--sm-text); cursor: pointer; font-size: 18px; }
#crmRoot .bm-icon-btn:hover { color: var(--sm-no); border-color: var(--sm-no); }

/* ── sheet + dialogs ── */
#crmRoot .ov { position: fixed; inset: 0; background: rgba(58, 42, 47, .42); display: none; z-index: 620; }   /* above the shared header (500) */
#crmRoot .ov.show { display: flex; }
#crmRoot #bmSheetOv { justify-content: flex-end; }
#crmRoot .bm-sheet { background: var(--sm-surface); width: min(620px, 100%); height: 100%; overflow-y: auto; box-shadow: var(--sm-shadow-pop); border-left: 1px solid var(--sm-line);
  animation: bmSlide .25s var(--sm-ease); box-sizing: border-box; overscroll-behavior: contain; }
@keyframes bmSlide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
#crmRoot .bm-sh-head { position: sticky; top: 0; z-index: 2; background: var(--sm-surface); border-bottom: 1px solid var(--sm-line); padding: 14px 16px 12px 22px;
  display: flex; gap: 10px; align-items: flex-start; }
#crmRoot .bm-sh-head h2 { flex: 1; font-size: 30px; line-height: 1.1; overflow-wrap: anywhere; padding-top: 4px; }
#crmRoot .bm-x { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; font-size: 26px; color: var(--sm-text); cursor: pointer; line-height: 1; }
#crmRoot .bm-x:hover { background: var(--sm-bg-alt); color: var(--sm-wine); }
#crmRoot .bm-sh-body { padding: 16px 22px 40px; }
#crmRoot .bm-sh-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
#crmRoot .bm-sh-note { font-size: 13.5px; color: var(--sm-text); margin: 4px 0 14px; }
#crmRoot .bm-banner { border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
#crmRoot .bm-banner.is-wait { background: var(--sm-wait-bg); color: var(--sm-wait); }
#crmRoot .bm-banner.is-ok { background: var(--sm-ok-bg); color: var(--sm-ok); }
#crmRoot .bm-banner .bm-linkbtn { color: inherit; padding: 0; min-height: 0; }
#crmRoot .bm-grp { margin: 18px 0 0; }
#crmRoot .bm-grp h3 { font-size: 22px; margin: 0 0 8px; }
#crmRoot .bm-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
#crmRoot .bm-f { min-width: 0; }
#crmRoot .bm-f.is-wide { grid-column: 1 / -1; }
#crmRoot .bm-f label { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--sm-text); margin: 0 0 4px; }
#crmRoot .bm-f label span:last-child { color: var(--sm-muted); font-size: 12px; white-space: nowrap; }
#crmRoot .bm-f label .is-guess { color: var(--sm-wait); }
#crmRoot .bm-f label .is-ai { color: var(--sm-wine); }
#crmRoot .bm-f .bm-in.is-missing { border-color: rgba(155, 44, 44, .45); background: #FFFBFA; }
#crmRoot .bm-f .bm-in.is-missing::placeholder { color: var(--sm-no); opacity: 1; }
#crmRoot .bm-f .bm-in.is-flash { animation: bmNew 2.4s ease-out 1; }
#crmRoot .bm-taged { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
#crmRoot .bm-taged .bm-tag { padding: 3px 4px 3px 10px; gap: 2px; }
#crmRoot .bm-taged .bm-tag button { border: 0; background: transparent; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; color: var(--sm-text); font-size: 16px; }
#crmRoot .bm-taged .bm-tag button:hover { color: var(--sm-no); background: var(--sm-bg-alt); }
#crmRoot .bm-taged input { flex: 1 1 140px; min-width: 120px; }
#crmRoot .bm-sugg { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
#crmRoot .bm-notes { display: grid; gap: 8px; margin: 0 0 10px; }
#crmRoot .bm-note { background: var(--sm-bg); border: 1px solid var(--sm-line); border-radius: 12px; padding: 9px 12px; font-size: 14.5px; }
#crmRoot .bm-note small { display: block; color: var(--sm-muted); font-size: 12.5px; margin-top: 2px; }
#crmRoot .bm-note-add { display: flex; gap: 8px; }
#crmRoot details.bm-more { margin-top: 18px; border-top: 1px solid var(--sm-line); padding-top: 10px; }
#crmRoot details.bm-more summary { cursor: pointer; color: var(--sm-wine); font-weight: 500; min-height: 40px; display: flex; align-items: center; }
#crmRoot .bm-raw { white-space: pre-wrap; font-size: 14px; line-height: 1.55; background: var(--sm-bg); border: 1px solid var(--sm-line); border-radius: 12px; padding: 12px;
  max-height: 340px; overflow: auto; color: var(--sm-ink); margin: 6px 0 0; }
#crmRoot .bm-preview { margin-top: 8px; border: 1px solid var(--sm-line); border-radius: 12px; overflow: hidden; background: var(--sm-bg); }
#crmRoot .bm-preview img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
#crmRoot .bm-preview iframe { display: block; width: 100%; height: 70vh; border: 0; }
#crmRoot #bmDlgOv { align-items: center; justify-content: center; padding: 16px; }
#crmRoot .bm-dlg { background: var(--sm-surface); border: 1px solid var(--sm-line); border-radius: var(--sm-r-card); box-shadow: var(--sm-shadow-pop); padding: 24px;
  width: min(460px, 100%); box-sizing: border-box; animation: bmPop .2s var(--sm-ease); }
#crmRoot .bm-dlg h2 { font-size: 30px; line-height: 1.1; margin-bottom: 8px; }
#crmRoot .bm-dlg p { color: var(--sm-text); font-size: 15.5px; line-height: 1.55; margin: 0 0 12px; }
#crmRoot .btn-danger { background: var(--sm-no) !important; box-shadow: none !important; }
#crmRoot .btn-danger:hover { background: #7F2222 !important; }
#crmRoot .sm-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
#crmRoot .bm-spin { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%;
  animation: bmSpin .7s linear infinite; }
#crmRoot .sm-btn-ghost .bm-spin { border-color: rgba(125, 46, 62, .25); border-top-color: var(--sm-wine); }
@keyframes bmSpin { to { transform: rotate(360deg); } }
#crmRoot .bm-paid { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--sm-icon-well); color: var(--sm-wine); margin-left: 4px; }

/* ── toast ── */
#crmRoot .toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--sm-surface); border: 1px solid var(--sm-line); color: var(--sm-ink);
  padding: 12px 22px; border-radius: 18px; font-size: 15px; z-index: 660; opacity: 0; transition: opacity .3s; pointer-events: none; box-shadow: var(--sm-shadow-pop);
  max-width: calc(100vw - 32px); box-sizing: border-box; text-align: center; }
#crmRoot .toast.show { opacity: 1; }

/* ── the sign-in modal's layout (its LOOK is css/auth-modal.css) ── */
.mov { display: none; position: fixed; inset: 0; z-index: 900; align-items: center; justify-content: center; padding: 16px; }
.mov.show { display: flex; }
#authModal { z-index: 900; --font-serif: var(--sm-serif); --font-body: var(--sm-sans); }
#authModal .va-mdl { padding: 30px 32px; max-width: 380px; width: 100%; max-height: 85vh; overflow-y: auto; text-align: center; box-sizing: border-box; }
#authModal .va-modal-sub { margin-bottom: 8px; }
#authModal .va-close { float: right; cursor: pointer; font-size: 24px; line-height: 20px; background: none; border: none; padding: 0; border-radius: 50%; }
#authModal .spinner-lg { width: 32px; height: 32px; border: 3px solid; border-radius: 50%; animation: bmSpin 1s linear infinite; margin: 0 auto; }
#authModal .va-wrap { position: relative; text-align: left; margin-top: 14px; }
#authModal .va-bar { position: absolute; top: -10px; left: 0; right: 0; height: 3px; border-radius: 3px; overflow: hidden; }
#authModal .va-bar.active::after { content: ''; position: absolute; left: -40%; top: 0; height: 100%; width: 40%; border-radius: 3px; animation: bmIndet 1.1s ease-in-out infinite; }
@keyframes bmIndet { 0% { left: -40%; } 100% { left: 100%; } }
#authModal .va-field { margin-bottom: 12px; }
#authModal .va-label { display: block; text-transform: uppercase; margin-bottom: 6px; }
#authModal .va-phone { display: flex; align-items: stretch; }
#authModal .va-cc { display: inline-flex; align-items: center; padding: 0 12px; font-size: 15px; border: 1px solid; border-right: none; white-space: nowrap; }
#authModal .va-input { flex: 1; width: 100%; padding: 11px 13px; outline: none; box-sizing: border-box; }
#authModal .va-code { text-align: center; letter-spacing: .4em; font-size: 20px; font-weight: 600; margin: 6px 0 10px; }
#authModal .va-btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 12px 16px; cursor: pointer; border: none; margin-top: 4px; }
#authModal .va-btn.is-disabled, #authModal .va-btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
#authModal .va-otp { margin-top: 6px; }
#authModal .va-or { display: flex; align-items: center; gap: 12px; margin: 16px 0 10px; font-size: 12px; }
#authModal .va-or::before, #authModal .va-or::after { content: ''; flex: 1; height: 1px; }
#authModal .va-status { min-height: 1.1em; margin-top: 12px; font-size: 13px; text-align: center; }
#authModal .va-trust { margin-top: 12px; text-align: center; line-height: 1.5; }
#authModal .va-skeleton { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
#authModal .va-skeleton > div { border-radius: 9px; }
#authModal .va-sk-line { height: 14px; } #authModal .va-sk-box, #authModal .va-sk-btn { height: 46px; } #authModal .va-sk-or { height: 12px; width: 30%; margin: 2px auto; }
#authModal .hidden { display: none !important; }

/* ── tablets: the table stays; the toolbar wraps ── */
@media (max-width: 1024px) {
  #crmRoot .bm-table-wrap { max-height: none; }
}
/* ── phones: cards, a stacked toolbar, a full-screen sheet ── */
@media (max-width: 767px) {
  #crmRoot .bm-app { padding-top: 18px; }
  #crmRoot .bm-head { flex-direction: column; align-items: stretch; gap: 14px; }
  #crmRoot .bm-stats > div { flex: 1; min-width: 0; padding: 10px 6px; }
  #crmRoot .bm-stats dd { font-size: 28px; }
  #crmRoot .bm-upload-main { flex-direction: column; }
  #crmRoot .bm-drop { padding: 16px; }
  #crmRoot .bm-drop-ic { width: 44px; height: 44px; }
  #crmRoot .bm-paste-toggle { align-self: stretch; }
  #crmRoot .bm-card { padding: 14px; }
  #crmRoot .bm-search { flex-basis: 100%; }
  #crmRoot .bm-tools { width: 100%; flex-wrap: nowrap; gap: 6px; }
  #crmRoot .bm-tools .bm-tool { flex: 1 1 0; justify-content: center; padding: 8px 8px; min-width: 0; }
  #crmRoot .bm-tools .bm-tool:not(.bm-tool-icon) svg { display: none; }
  #crmRoot .bm-tools .bm-tool-icon { flex: 0 0 auto; }
  #crmRoot .bm-table-wrap { display: none; }
  #crmRoot .bm-cards { display: grid; gap: 10px; }
  #crmRoot .bm-sel { position: sticky; bottom: 10px; z-index: 30; box-shadow: var(--sm-shadow-pop); background: var(--sm-surface); }
  #crmRoot .bm-sheet { width: 100%; border-left: 0; }
  #crmRoot .bm-sh-body { padding: 14px 16px 40px; }
  #crmRoot .bm-sh-head { padding-left: 16px; }
  #crmRoot .bm-fields { grid-template-columns: 1fr; }
  #crmRoot .bm-pop { left: 12px !important; right: 12px; max-width: none; position: fixed; top: auto !important; bottom: 12px; max-height: 75vh; }
  #crmRoot .bm-colgrid { grid-template-columns: 1fr 1fr; }
  #crmRoot input, #crmRoot textarea, #authModal input { font-size: 16px !important; }
}
@media (prefers-reduced-motion: reduce) {
  #crmRoot *, #crmRoot *::before, #crmRoot *::after { animation: none !important; transition: none !important; }
}
/* the cookie banner (prod, z 490, body.vivah-consent-on + --vivah-consent-h from server._inject_consent) must not cover the phone's bottom bars */
@media (max-width: 767px) {
  body.vivah-consent-on #crmRoot .bm-sel { bottom: calc(var(--vivah-consent-h, 150px) + 10px); }
  body.vivah-consent-on #crmRoot .bm-pop { bottom: calc(var(--vivah-consent-h, 150px) + 12px); max-height: 55vh; }
}
