@import url('/shared/visuals.css');
@import url('/shared/tokens.css');
/* Our styles for KPM's CRM page (public/index.html), beside public/local-crm.js, which draws what they style.
   Loaded by one LOCAL: line right after KPM's <style>, so a rule here wins over KPM's at equal specificity
   (UI/UX plan 1.1, decision 2); rules injected by local-crm.js, which loads before KPM's styles, would lose.
   KPM's own colours and radii are its variables (--green, --border, --r…), used as they are. */

/* Staff colours, density, focus and tones come from tokens.css. KPM's upstream page
   deliberately retains its 6 px small radius, shadow and higher overlay stack; only these
   legacy aliases differ from the added pages. There is no second copy of the shared values. */
html:root{--rs:var(--crm-radius-small);--sh:var(--crm-shadow);}
:root{--z-dialog:var(--crm-layer-dialog);--z-toast:var(--crm-layer-toast);--z-cell:var(--crm-layer-cell);
  --z-head:var(--crm-layer-head);--z-bar:var(--crm-layer-bar);--z-filters:var(--crm-layer-filters);}

/* ── crmDialog: a question or a small form in the page, above KPM's windows (UI/UX plan 1.1) ─────────────────── */
.crm-dlg-ov{position:fixed;inset:0;z-index:var(--z-dialog);display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.32);}
.crm-dlg{background:var(--white);border-radius:14px;width:460px;max-width:100%;max-height:calc(100vh - 32px);overflow-y:auto;box-shadow:0 8px 40px rgba(0,0,0,.16);}
.crm-dlg-title{font-family:'DM Serif Display',serif;font-size:20px;font-weight:400;line-height:1.3;padding:20px 24px 0;overflow-wrap:anywhere;}
.crm-dlg-body{padding:10px 24px 0;font-size:13.5px;color:var(--text2);overflow-wrap:anywhere;}
.crm-dlg-body p{margin:0 0 6px;}
.crm-question{white-space:pre-wrap;overflow-wrap:anywhere;}
.crm-dlg-field{display:flex;flex-direction:column;gap:4px;margin:12px 0 0;font-size:12px;font-weight:600;color:var(--text2);}
.crm-dlg-ft{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;padding:18px 24px 20px;}

/* ── crmToast: one status region made at load, centred across the screen; the idle region takes no clicks (1.1). It sits
      in the messages' place at the bottom of the screen, under a message that stays (crmAlert, 1.5) ────────────── */
.crm-msgs{position:fixed;left:0;right:0;bottom:24px;z-index:var(--z-toast);display:flex;flex-direction:column;align-items:center;gap:8px;padding:0 16px;pointer-events:none;}
.crm-toast-region{display:flex;justify-content:center;max-width:100%;pointer-events:none;}
.crm-toast{pointer-events:auto;display:flex;align-items:center;gap:14px;max-width:560px;background:var(--text);color:#fff;padding:10px 16px;border-radius:8px;font-size:13px;line-height:1.45;box-shadow:0 6px 20px rgba(0,0,0,.2);}
.crm-toast:focus{outline:none;}
.crm-toast:focus-visible{outline:var(--focus-ring);outline-offset:var(--focus-offset);}
.crm-toast-act{flex:none;background:none;border:1px solid rgba(255,255,255,.7);border-radius:6px;color:#fff;font:inherit;font-weight:600;padding:4px 12px;cursor:pointer;}
.crm-toast-act:hover{background:rgba(255,255,255,.14);}
.crm-toast-act:focus-visible{outline:2px solid #fff;outline-offset:2px;} /* (the ring in white on the dark message) */
/* The note once Gmail opened (gmailNotice), in the same place, over the toast */
.crm-note{pointer-events:auto;display:flex;gap:12px;align-items:center;max-width:min(520px,100%);background:var(--text);color:var(--white);padding:12px 16px;border-radius:10px;font-size:13px;box-shadow:0 6px 24px rgba(0,0,0,.2);}

/* ── A brand's Delete (1.4): out of the Campaigns header, where it sat beside Edit; 'Delete client' at the foot of
      the brand's Edit form instead, away from Update. The header's button is KPM's (renderClientPage). ─────────── */
#content .card-hd button[onclick^="deleteClient("]{display:none;}
#client-modal-ft{flex-wrap:wrap;}
#client-modal-ft .crm-delete-client{margin-right:auto;}
#client-modal-ft .btn-primary{white-space:normal;max-width:100%;} /* "Update {a long brand name}" wraps */

/* ── "✓ Saved" on a Save button of the record view once its fields saved themselves (1.3) ───────────────────── */
.crm-saved{color:var(--green);}

/* ── A viewer (read-only, 1.5, U23, U67): the top bar's buttons that change something are hidden (Check Posts, Import,
      + Add, Restore Backup) and the sidebar's + Add; the notice is a strip at the top of the main column, in the
      page flow, not a box over the top bar. The record's fields and buttons are disabled by local-crm.js, and its
      fields read as plain values. ────────────────────────────────────────────────────────────────────────────── */
body.read-only .topbar button[onclick="checkAllPosts()"],
body.read-only .topbar button[onclick="openModal('import-modal')"],
body.read-only .topbar button[onclick="openModal('add-inf-modal')"],
body.read-only .topbar button[onclick="document.getElementById('import-file-input').click()"],
body.read-only .sb-label button[onclick="openModal('add-client-modal')"]{display:none;}
#read-only-banner{flex:none;background:var(--amber-l);color:var(--amber);border-bottom:1px solid var(--border);padding:7px 22px;font-size:12.5px;line-height:1.45;}
#read-only-banner a{color:inherit;font-weight:600;}
body.read-only #det-body .btn:disabled{opacity:.45;cursor:not-allowed;}
body.read-only #det-body button[hidden]{display:none!important;}
body.read-only #det-body .finp:disabled,body.read-only #det-body .finp[readonly]{background:transparent;border-color:transparent;color:var(--text);opacity:1;cursor:default;}
body.read-only #det-body select.finp:disabled{appearance:none;}
body.read-only #det-body .finp[readonly]::placeholder{color:transparent;}
body.read-only #det-body textarea.finp[readonly]{resize:none;}
body.read-only #det-body input[readonly][value=""]::-webkit-datetime-edit{color:transparent;} /* an empty date or time: no mm/dd/yyyy */
body.read-only #det-body .finp[readonly]:focus{border-color:var(--green);}

/* U4.1: Now precedes the editable record; the two form columns can shrink under WCAG text spacing. */
.crm-record-now{margin:0 0 18px;border:1px solid var(--border);border-radius:var(--rs);padding:14px;background:var(--green-l);overflow-wrap:anywhere;}
.crm-record-now h3{font-size:16px;margin:0 0 10px;line-height:1.4;}
.crm-record-now .crm-now-step{font-size:14px;font-weight:600;margin:10px 0 6px;line-height:1.5;}
.crm-now-meta{display:flex;flex-wrap:wrap;gap:6px 18px;font-size:12px;color:var(--text2);}
.crm-record-now .crm-now-request{font-size:13px;margin:8px 0;}
.crm-record-now .crm-now-action{margin:10px 0;white-space:normal;max-width:100%;}
#det-body .crm-record-heading{font-size:14px!important;line-height:1.5;font-weight:600;margin:0 0 8px!important;color:var(--text)!important;text-transform:none;letter-spacing:normal;}
#det-body .crm-record-profile-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
#det-body .crm-record-profile-grid>div{min-width:0;overflow-wrap:anywhere;}
#det-body .crm-record-profile-grid>div:first-child>div>span:first-child{flex:0 0 84px;overflow-wrap:normal;}
#det-body .crm-record-profile-grid .finp{min-width:0;max-width:100%;}
#det-body .crm-record-profile-grid .crm-visit-row{flex-wrap:wrap;}
#det-body .crm-record-profile-grid .crm-visit-row>input{flex:1 1 100px!important;min-width:0;}
#det-body .crm-record-profile-grid button,#det-body .crm-record-profile-grid a.btn{white-space:normal;max-width:100%;}
@media(max-width:600px){#det-body .crm-record-profile-grid{grid-template-columns:minmax(0,1fr);}.crm-record-now{padding:12px;}}

/* ── crmAlert: a message that stays until dismissed (a refused change, 1.5), above KPM's windows and our dialogs, in
      the messages' place at the bottom of the screen, over crmToast's (the record's name and status stay in view) ── */
.crm-alert-region{display:flex;justify-content:center;max-width:100%;pointer-events:none;}
.crm-alert{pointer-events:auto;display:flex;align-items:flex-start;gap:12px;max-width:560px;background:var(--red-l);color:var(--red);border:1px solid var(--red);border-radius:8px;padding:10px 10px 10px 16px;font-size:13px;line-height:1.45;box-shadow:0 6px 20px rgba(0,0,0,.16);overflow-wrap:anywhere;}
.crm-alert-x{flex:none;background:none;border:0;border-radius:6px;color:inherit;font:inherit;font-size:14px;line-height:1;padding:3px 6px;cursor:pointer;}
.crm-alert-x:hover{background:rgba(163,32,30,.1);}
.crm-alert:has(>.crm-apify-open-settings){display:grid;grid-template-columns:minmax(0,1fr) auto;}
.crm-alert>.crm-apify-open-settings{grid-column:1;grid-row:2;justify-self:start;}

/* ── Said to screen readers only ("Not synced", 1.9) ─────────────────────────────────────────────────────────── */
.crm-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

/* ── KPM's windows as dialogs (UI/UX plan 2.4, U49): the sticky title bar never hides a field Tab reaches. local-crm.js
      sets each window's padding from its title bar's height when it opens; this is where it starts. ─────────────── */
.ov .modal{scroll-padding-top:80px;}

/* ── A way past the menus, the sign-in's labels, the brand form's words (UI/UX plan 2.5, U98, U3, U70) ─────────── */
.crm-skip{position:absolute;left:12px;top:-200px;z-index:var(--z-toast);background:var(--white);color:var(--green);border:2px solid var(--green);border-radius:var(--rs);padding:8px 14px;font-size:13px;font-weight:600;text-decoration:none;box-shadow:0 4px 16px rgba(0,0,0,.16);}
.crm-skip:focus{top:12px;outline:none;}
#content:focus{outline:none;} /* the skip link's target is the main region, not a control */
.crm-signin-lbl{font-size:12px;font-weight:600;color:var(--text2);margin-bottom:-6px;}
.crm-hint{font-size:var(--fs-xs);color:var(--text2);margin:-6px 0 13px;}
.crm-field{display:flex;flex-direction:column;gap:3px;min-width:0;}
.crm-field-lbl{font-size:var(--fs-xs);color:var(--text3);}
/* Click-only rows and spans of KPM's, reachable from the keyboard: the focus ring (3.1), rounded */
[data-crm-key]:focus-visible{border-radius:4px;}
/* The Dashboard's stacked visit rows: targets at least 24 px high (WCAG 2.5.8) */
#content div[onclick^="openDetail("]{min-height:24px;padding:2px 0;}

/* ── KPM's tables keep their buttons in view (UI/UX plan 2.2, U17) ───────────────────────────────────────────────────
      The table of creators (All Influencers, the Dashboard's Recent, a brand's list), the Archive and the Posted Report
      scroll sideways in their .tbl-wrap. The table of creators gets narrower: long handles wrap, a visit's date and time
      may take two lines, the campaign credit keeps one line with an ellipsis, the status chips sit in a wrapping row
      and its cells are less padded. On a desktop the last column (the row's buttons) stays at the right edge, white,
      outranking KPM's sticky header (z-index 5); on a phone the first column stays instead (2.3). local-crm.js marks a
      wrap that hides columns to the right or the left (crm-more-right, crm-more-left), as macOS shows no scrollbar
      until one scrolls: an edge shadow says there is more. */
#content .tbl-wrap > table.crm-creators > * > tr > :is(th,td){padding-left:6px;padding-right:6px;} /* (6 px since 6.7: the brand's
   decision reads "⏳ Brand deciding", a wider chip, and the row still fits at 1280 px) */
#content .tbl-wrap > table.crm-creators > tbody > tr > td:nth-child(2){min-width:128px;} /* (128 px since 6.7, as the padding) */
#content .tbl-wrap > table.crm-creators > tbody > tr > td:nth-child(2) > b{display:block;max-width:190px;overflow-wrap:anywhere;}
#content .tbl-wrap > table.crm-creators > tbody > tr > td:nth-child(3){min-width:100px!important;}
#content .tbl-wrap > table.crm-creators > tbody > tr > td:nth-child(3) span{white-space:normal!important;}
#content .tbl-wrap > table.crm-creators > tbody > tr > td:nth-child(4){min-width:100px;}
#content .tbl-wrap > table.crm-creators > tbody > tr > td:nth-child(4) > div[style*="color:var(--green)"]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:0;min-width:100%;}
#content .tbl-wrap > table.crm-creators > tbody > tr > td:nth-child(6){white-space:normal!important;min-width:86px;}
#content .tbl-wrap > table.crm-creators > thead > tr > th[style*="min-width:170px"]{min-width:128px!important;}
#content .tbl-wrap > table.crm-creators > tbody > tr > td:nth-child(9){max-width:128px!important;}
#content .tbl-wrap > table.crm-creators .badge{white-space:nowrap;margin-top:2px;}
#content .tbl-wrap > table.crm-creators .badge.crm-badge-long{white-space:normal;}
/* Measured again with 3.2's 12 px text: the row's buttons flow in rows 128 px wide (KPM's two rows of them, one
   after the other: IG Email View, then Invite Archive), and Last Activity's date in one piece, its age pill below it
   when the two don't fit side by side. */
#content .tbl-wrap > table.crm-creators > tbody > tr > td:last-child > div{flex-direction:row!important;flex-wrap:wrap;width:128px;}
#content .tbl-wrap > table.crm-creators > tbody > tr > td:last-child > div > div{display:contents!important;}
#content .tbl-wrap > table.crm-creators > tbody > tr > td:nth-child(9) > div:first-child{flex-wrap:wrap;row-gap:2px;}
#content .tbl-wrap > table.crm-creators > tbody > tr > td:nth-child(9) > div:first-child > span:first-child{white-space:nowrap;}
/* The filter bar, the count and the batch bar above the table stay in view while it scrolls sideways; the filter bar (its
   menus) over the batch bar and the table's sticky cells. A bar that stays put no longer scrolls its overflow into view,
   so the batch bar wraps where the box is narrower than its buttons (761–1000 px), rather than hide Export CSV and Clear. */
#content .tbl-wrap > div:not(.empty){position:sticky;left:0;z-index:var(--z-bar);}
#content .tbl-wrap > div:first-child{z-index:var(--z-filters);}
#content .tbl-wrap > #batch-bar{left:8px;flex-wrap:wrap;}
/* The white of a sticky cell (the last column on a desktop, the first on a phone) never squares off the card's rounded
   bottom corners: a table at the foot of its card is clipped to them. */
#content .card > .tbl-wrap:last-child{border-radius:0 0 calc(var(--r) - 1px) calc(var(--r) - 1px);}
@media (min-width:761px){
  #content .tbl-wrap > table > tbody > tr > td:last-child:not([colspan]){position:sticky;right:0;z-index:var(--z-cell);background:var(--white);}
  #content .tbl-wrap > table > thead > tr > th:last-child{position:sticky;right:0;z-index:var(--z-head);background:var(--white);}
  #content .tbl-wrap > table > tbody > tr[style*="background:#"] > td:last-child{background:inherit;}
  #content .tbl-wrap > table > tbody > tr:hover > td:last-child{background:#faf9f7;}
  #content .tbl-wrap.crm-more-right > table > tbody > tr > td:last-child:not([colspan]){box-shadow:-7px 0 7px -3px rgba(0,0,0,.13),inset 1px 0 0 var(--border);}
  #content .tbl-wrap.crm-more-right > table > thead > tr > th:last-child{box-shadow:inset 0 -1px 0 var(--border),-7px 0 7px -3px rgba(0,0,0,.13),inset 1px 0 0 var(--border);}
  #content .tbl-wrap.crm-more-left{box-shadow:inset 12px 0 10px -10px rgba(0,0,0,.22);}
}

/* ── A visit the creator asked for, in the record: what and "Confirm the visit", above the Visit row (UI/UX plan 2.8) ── */
.crm-visit-ask{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;background:var(--amber-l);color:var(--amber);border:1px solid #e8c89a;border-radius:var(--rs);padding:8px 10px;margin-bottom:8px;font-size:12.5px;}
.crm-visit-ask-what{font-weight:600;flex:1 1 100%;}
.crm-visit-ask-how{flex:1 1 auto;color:var(--text2);}
.crm-visit-ask .btn[aria-disabled="true"]{opacity:.6;cursor:progress;}

/* ── KPM's page on a phone and at 400% zoom (UI/UX plan 2.3, U1, decision 7) ──────────────────────────────────────────
      Below 760 px (a phone, or a laptop zoomed to 400%: 320 CSS px) the page scrolls as one column: KPM's fixed-height
      shell, main column and content box lose their height and hidden overflow, which kept a zoomed window from ever
      reaching the content. The sidebar and the top bar are each one row that scrolls sideways, of 44 px and 40 px
      buttons; Export and Restore Backup are in the ⚙ window instead (local-crm.js); windows are full screen; grids are
      one column, stat cards two per row; row buttons are 40 px; fields 16 px, so iPhones don't zoom into them. KPM's
      inline styles that push controls out (the record's Visit row) are overruled with !important or attribute rules.
      The tables keep their first column (and the tick before it) instead of the last. A banner says the workbench is
      made for phones, in the read-only strip's place; a viewer, whose strip already links there, gets that one only. */
.crm-phone-banner,.crm-backup{display:none;}
/* Descriptive action labels and a saved-time badge still fit one desktop row; long brand names can shrink. */
@media (min-width:761px){
  .topbar h1{flex:1 1 48px;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
}
/* The sign-in screen scrolls when it is taller than the window (a laptop at 400%: 320×200), centred while it fits */
@media (max-width:760px),(max-height:480px){
  #login-gate{overflow-y:auto;justify-content:flex-start!important;padding:16px;}
  #login-gate > :first-child{margin-top:auto;}
  #login-gate > #login-gate-msg{margin-bottom:auto;}
}
@media (max-width:760px){
  .crm-phone-banner{display:block;flex:none;background:var(--blue-l);color:var(--blue);border-bottom:1px solid var(--border);padding:9px 12px;font-size:13px;line-height:1.45;}
  .crm-phone-banner a{color:inherit;font-weight:600;}
  body.read-only .crm-phone-banner{display:none;}
  #read-only-banner{padding:9px 12px;}
  /* One column that scrolls as a whole: the strips (read-only, this banner) first, then the menu, the top bar, the view */
  .shell{flex-direction:column;height:auto;min-height:100vh;overflow:visible;}
  .main{display:contents;overflow:visible;} /* its strips, top bar and view become the column's own rows, ordered below (a box
     that draws nothing clips nothing; KPM's hidden overflow, kept, made tools such as axe skip the whole page) */
  .content{order:3;flex:none;overflow:visible;padding:14px 12px 40px;}
  /* The sidebar: one row of 44 px buttons that scrolls sideways; no logo, no labels (+ Add stays) */
  .sidebar{order:1;width:auto;min-width:0;flex-direction:row;align-items:center;overflow-x:auto;overflow-y:hidden;border-right:0;border-bottom:1px solid var(--border);}
  .sidebar .logo{display:none;}
  .sidebar .sb-section{display:flex!important;flex-direction:row!important;align-items:center;gap:4px;padding:6px 4px!important;flex:none!important;overflow:visible!important;}
  .sidebar .sb-label{font-size:0!important;letter-spacing:0;padding:0;} /* (!important: the display layer sizes it for Chinese) */
  .sidebar .sb-label button{font-size:13px!important;min-height:44px;padding:0 12px!important;margin:0!important;border-radius:var(--rs)!important;white-space:nowrap;}
  .sidebar .sb-clients{display:flex;flex:none;gap:4px;overflow:visible;padding:0;}
  .sidebar .nav-btn{flex:none;width:auto;min-height:44px;padding:0 12px;white-space:nowrap!important;}
  /* The top bar: one row that scrolls sideways, the title first */
  .topbar{order:2;flex-wrap:nowrap;overflow-x:auto;padding:8px 12px;gap:6px;}
  .topbar h1{flex:none;max-width:none;font-size:18px;white-space:nowrap;margin-right:4px;}
  .topbar > *{flex:none;}
  .topbar #sync-status{margin-left:8px!important;}
  .topbar button[onclick="exportData()"],.topbar button[onclick="document.getElementById('import-file-input').click()"]{display:none;}
  .crm-backup{display:block;margin-bottom:14px;padding-bottom:14px;border-bottom:1px solid var(--border);}
  .crm-backup-hd{font-size:var(--fs-xs);font-weight:600;color:var(--text3);margin-bottom:8px;text-transform:uppercase;letter-spacing:.04em;}
  :root[lang="zh-Hans"] .crm-backup-hd{letter-spacing:0;}
  .crm-backup-row{display:flex;flex-wrap:wrap;gap:6px;}
  body.read-only .crm-backup [data-crm-backup="restore"]{display:none;}
  /* Buttons a finger can press; fields iPhones don't zoom into */
  .btn-sm{min-height:40px;}
  .finp,#content input:not([type=checkbox]):not([type=radio]),#content select,#content textarea,.ov input:not([type=checkbox]):not([type=radio]),.ov select,.ov textarea,#qnr-text{font-size:16px!important;}
  #content input[type=checkbox],.ov input[type=checkbox]{width:18px;height:18px;}
  /* Windows full screen; .modal stays the scroll container (its scroll padding, 2.4) */
  .ov{padding:0;align-items:stretch;}
  .ov .modal,.ov .modal.wide,.ov .modal.narrow{width:100%;max-width:100%;height:100%;max-height:100%;border-radius:0;}
  .modal-hd{border-radius:0;flex-wrap:wrap;padding:12px 14px 10px;row-gap:6px;}
  .modal-hd h2{min-width:0;overflow-wrap:anywhere;font-size:19px;}
  #det-badges{order:3;flex-basis:100%;}
  .modal-body{padding:14px;overflow-wrap:break-word;} /* a long email address in a line of text */
  .modal-ft{padding:12px 14px;flex-wrap:wrap;}
  #qnr-popover{max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow-y:auto;}
  /* Grids one column, stat cards two per row */
  .g2,.g3{grid-template-columns:minmax(0,1fr);}
  .stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
  .card-hd{flex-wrap:wrap;padding:12px 14px;}
  .card-body{padding:14px;}
  /* KPM's inline styles: the record's Visit row wraps, so its Save stays on screen */
  #det-body .crm-visit-row{flex-wrap:wrap;}
  #det-body .crm-visit-row > input[type=date]{min-width:150px;}
  #det-body .crm-visit-row > input[type=time]{min-width:110px;}
  #det-body .finp{min-width:0;}
  #batch-bar{flex-wrap:wrap;}
  .tab-row{flex-wrap:wrap;} /* a record's brand tabs, which the display layer keeps on one line each in Chinese */
  #content div[style*="display:flex"]:not(td div){flex-wrap:wrap;} /* KPM's rows of a name, details and buttons (the Dashboard's follow-ups, the Posted Report's bars) */
  /* The tables: no inner height (the page scrolls), the tick and the creator stay at the left */
  .tbl-wrap{max-height:none;}
  #content .tbl-wrap > table > tbody > tr > td:first-child:not([colspan]){position:sticky;left:0;z-index:var(--z-cell);background:var(--white);}
  #content .tbl-wrap > table > thead > tr > th:first-child{position:sticky;left:0;z-index:var(--z-head);}
  #content .tbl-wrap > table.crm-tick > * > tr > :first-child{width:40px!important;min-width:40px;max-width:40px;padding-left:11px!important;padding-right:11px!important;}
  #content .tbl-wrap > table.crm-tick > tbody > tr > td:nth-child(2):not([colspan]){position:sticky;left:40px;z-index:var(--z-cell);background:var(--white);}
  #content .tbl-wrap > table.crm-tick > thead > tr > th:nth-child(2){position:sticky;left:40px;z-index:var(--z-head);}
  #content .tbl-wrap > table.crm-tick > * > tr > :nth-child(2){width:150px;min-width:150px!important;max-width:150px;}
  #content .tbl-wrap > table:not(.crm-tick) > * > tr > :first-child{width:150px;min-width:150px;max-width:150px;}
  #content .tbl-wrap > table > tbody > tr > td :is(b,a){overflow-wrap:anywhere;}
  #content .tbl-wrap > table.crm-tick > tbody > tr > td:nth-child(2) > div{flex-wrap:wrap;}
  #content .tbl-wrap > table > tbody > tr[style*="background:#"] > td:is(:first-child,:nth-child(2)){background:inherit;}
  #content .tbl-wrap > table > tbody > tr:hover > td:is(:first-child,:nth-child(2)){background:#faf9f7;}
  #content .tbl-wrap.crm-more-left > table:not(.crm-tick) > tbody > tr > td:first-child:not([colspan]),#content .tbl-wrap.crm-more-left > table:not(.crm-tick) > thead > tr > th:first-child,
  #content .tbl-wrap.crm-more-left > table.crm-tick > tbody > tr > td:nth-child(2):not([colspan]),#content .tbl-wrap.crm-more-left > table.crm-tick > thead > tr > th:nth-child(2){box-shadow:7px 0 7px -3px rgba(0,0,0,.13),inset -1px 0 0 var(--border);}
  #content .tbl-wrap.crm-more-right{box-shadow:inset -12px 0 10px -10px rgba(0,0,0,.22);}
}

/* ── Readable greys, visible fields and one focus ring (UI/UX plan 3.1, findings U58, U59) ─────────────────────────────
      The greys are the tokens at the top. Fields are white with an edge that can be seen: KPM's .finp, and the fields
      whose look KPM set inline (the Posted Report's numbers and Notes, the quick note), where !important outranks the
      inline style. One ring for every control that has the focus from the keyboard (and every field): 2 px with a 2 px
      gap, where KPM's fields only changed a 1 px border and those inline fields, with outline:none, showed nothing. The
      invitation card's grey is in KPM's card styles (LOCAL lines in public/index.html). */
.finp{background:var(--field-bg);border-color:var(--field-border);}
#qnr-text,#content :is(input,textarea)[oninput^="updatePostReport("]{background:var(--field-bg)!important;border-color:var(--field-border)!important;}
:focus-visible{outline:var(--focus-ring);outline-offset:var(--focus-offset);}
/* A date, month or time field's calendar button is a Tab stop of its own inside the field, where the field matches
   neither :focus nor :focus-visible (Chrome): the ring while any part of the field has the focus. */
:is(input[type=date],input[type=month],input[type=week],input[type=time],input[type=datetime-local]):focus-within{outline:var(--focus-ring);outline-offset:var(--focus-offset);}
/* (KPM's buttons and fields animate every property they change, which drew the ring in from black: the ring at once) */
:is(button,input,select,textarea,a,.btn,.nav-btn,.finp){transition-property:color,background-color,border-color,box-shadow,opacity;}
#qnr-text:focus-visible,#content :is(input,textarea)[oninput^="updatePostReport("]:focus-visible{outline:var(--focus-ring)!important;outline-offset:var(--focus-offset)!important;}
/* The Posted Report's Auto-Fetch, faded (2.5:1) while no Apify token is set though it still works (it opens ⚙): at full
   strength, as the notice above it says what is missing. */
#content button[data-fetch-all]{opacity:1!important;}

/* ── One type scale: no text people read under 12 px (UI/UX plan 3.2, findings U61, U66) ──────────────────────────────
      KPM's labels, column headers, badges and stat labels at 12 px, capitals .04em apart; and every size KPM wrote inline
      from 8 to 11.5 px at 12 px (!important outranks an inline style; both ways a browser writes one), in the page's own
      parts only, so the invitation card drawn for its picture keeps its own. In Chinese no letter-spacing (the display
      layer sets KPM's label classes in Chinese at 12 px, without capitals). Fields are 16 px on a phone (the phone
      stylesheet), so iPhones don't zoom into them. */
.sb-label,.flbl,th,.badge,.stat-lbl,.thread-meta,.connected-badge,.disconnected-badge{font-size:var(--fs-xs);}
.sb-label,.flbl,th{letter-spacing:.04em;}
:where(.shell,.ov,#qnr-popover) :is([style*="font-size:8px"],[style*="font-size: 8px"],[style*="font-size:9px"],[style*="font-size: 9px"],[style*="font-size:10px"],[style*="font-size: 10px"],
  [style*="font-size:10.5px"],[style*="font-size: 10.5px"],[style*="font-size:11px"],[style*="font-size: 11px"],[style*="font-size:11.5px"],[style*="font-size: 11.5px"]){font-size:var(--fs-xs)!important;}
:root[lang="zh-Hans"] :where(.shell,.ov) [style*="letter-spacing"]{letter-spacing:0!important;}

/* ── One button system (UI/UX plan 3.6, findings U64, U97) ────────────────────────────────────────────────────────────
      Every button at least 24 × 24 px (WCAG 2.5.8): KPM's row buttons (View, Email, Invite, Archive, the profile links,
      the Posted Report's 🔄 👤 🗑) were 17–19 px high with 10 px text; 4 px between those of a row. A chosen option
      (aria-pressed: Email in, a record's status, the Posted Report's periods, campaigns and "show selected") looks
      chosen, white with a 2 px green edge, not like the view's main action. What deletes or turns down is red text with
      a red-tinted edge. On a touch screen every button is 44 px high. */
.btn,.sb-label button{min-height:24px;}
.btn-sm{min-width:24px;} /* (KPM's wide ones, + Add Campaign and + Add Template, keep their words at the start) */
#content td div[style*="gap:3px"]{gap:4px!important;}
.btn[aria-pressed]{transition:none;} /* (marked a moment after KPM draws it filled: no fade from one look to the other) */
.btn[aria-pressed="true"]{background:var(--white);color:var(--green);border:1px solid var(--green);box-shadow:inset 0 0 0 1px var(--green);}
.btn[aria-pressed="true"]:hover{background:var(--green-l);}
.btn.crm-btn-danger,.btn-ghost:is([style*="color:var(--red)"],[style*="color: var(--red)"]){background:var(--white);color:var(--red);border:1px solid var(--red-line);}
.btn.crm-btn-danger:hover,.btn-ghost:is([style*="color:var(--red)"],[style*="color: var(--red)"]):hover{background:var(--red-l);border-color:var(--red);}
@media (pointer:coarse){
  .btn,.nav-btn,.tab,.sb-label button,.crm-toast-act{min-height:var(--tap);} /* (a message's Show or Undo too) */
  .btn-sm{min-width:var(--tap);justify-content:center;}
}

/* ── Our buttons in KPM's side menu, the address and Sign out at its foot (UI/UX plan 3.3, finding U62) ─────────────────
      local-crm.js moves our Workbench, Users and 📥 Inbox from the top bar into the menu, after KPM's own views (a line
      between), and the signed-in address (Your account), the EN / 中文 switch and Sign out into a foot under the brands:
      the top bar keeps KPM's own buttons, on one row at 1280 px, and our Workbench link no longer looks like the page's
      main action. On a phone the menu is one row that scrolls sideways (the phone stylesheet): ours follow KPM's views
      there, then the foot, then the brands. */
.crm-sb-ours{margin-top:6px;padding-top:6px;border-top:1px solid var(--border);}
.crm-sb-ours .nav-btn > .badge{margin-left:auto!important;}
.crm-sb-foot{flex:none;display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:10px 18px 14px;border-top:1px solid var(--border);background:var(--white);}
.crm-sb-foot #whoami{order:-1;flex:1 1 100%;min-width:0;padding:3px 0;font-size:var(--fs-xs)!important;color:var(--text2)!important;overflow-wrap:anywhere;border-radius:4px;} /* (a target 24 px high) */
.crm-sb-foot #whoami:hover{color:var(--text)!important;text-decoration:underline;}
@media (pointer:coarse){.crm-sb-foot #whoami{padding:13px 0;}}
.crm-sb-foot .crm-version{flex:1 1 100%;margin:2px 0 0;font-size:var(--fs-xs);color:var(--text3);font-variant-numeric:tabular-nums;}
.crm-sb-foot .crm-version:empty{display:none;}
@media (max-width:760px){
  .sidebar .crm-sb-ours{display:flex;flex:none;gap:4px;margin:0 0 0 4px;padding:0 0 0 8px;border-top:0;border-left:1px solid var(--border);}
  .sidebar .crm-sb-foot{order:1;flex-wrap:nowrap;padding:6px 8px;border-top:0;border-left:1px solid var(--border);background:none;}
  .sidebar .crm-sb-foot #whoami{flex:none;max-width:180px;padding:0;line-height:var(--tap);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .sidebar .crm-sb-foot .crm-version{display:none;} /* (on a phone the menu is one row: the workbench's account menu says it) */
  .sidebar > .sb-section ~ .sb-section{order:2;}
}

/* ── KPM's sign-in screen (UI/UX plan 4.8, findings U18, U51, U52) ──────────────────────────────────────────────────────
      During the 2-step step the password form stays hidden, whatever inline display showLoginGate gives it (local-crm.js
      puts the class on the gate when the step starts); the step's title; a button that reads as a link ("Use a different
      account", and the KPI block's Edit KPI); the line on a forgotten password while email is off. */
#login-gate.crm-two-step #login-form{display:none!important;}
.crm-two-step-title{font-family:'DM Serif Display',serif;font-size:var(--fs-2xl);font-weight:400;line-height:1.3;text-align:center;margin:0;}
#two-step-other{display:flex;margin:12px auto 0;}
.crm-signin-help{font-size:var(--fs-xs);line-height:1.45;color:var(--text2);text-align:center;text-wrap:balance;margin:0;}
#login-privacy{margin-top:14px;}
#login-privacy a{color:var(--green);} /* the privacy policy, in the CRM's link colour (green, 7.6:1 on the page) */
.crm-link{display:inline-flex;align-items:center;min-height:24px;padding:0 2px;background:none;border:0;border-radius:4px;color:var(--green);font:inherit;font-weight:600;text-decoration:underline;text-underline-offset:2px;cursor:pointer;}
.crm-link:hover{color:var(--green-m);}
@media (pointer:coarse){.crm-link{min-height:var(--tap);}}

/* ── The KPI block says what it counts (UI/UX plan 4.2, finding U19) ────────────────────────────────────────────────────
      "No target set" in the grey of secondary text, not in the green of KPM's "On track"; a campaign's count without a
      target a plain number at the bars' right edge, where its "n/—" was; a viewer, who can't change a target, has no
      Edit KPI there. */
.crm-kpi-none{color:var(--text2)!important;}
.kpi-bar-wrap.crm-kpi-count > :last-child{margin-left:auto;font-weight:600;}
body.read-only .crm-kpi-edit{display:none;}

/* ── Releases 5 and 6 of the UI/UX plan (local-crm.js, its section of the same name) ─────────────────────────────────── */
/* Stage tones are shared through tokens.css; CRM_STAGES.toneOf(stage) selects the class. */
/* The Stage block's first line: the stage, KPM's status badge after a hint, the Workbench link in the page's green */
#owner-block .crm-stage-row{display:flex;align-items:center;gap:6px 8px;flex-wrap:wrap;margin-bottom:8px;}
.crm-stage-hint{font-size:var(--fs-xs);color:var(--text2);}
.crm-stage-link{margin-left:auto;font-size:var(--fs-xs);font-weight:600;color:var(--green);text-decoration:none;border-radius:4px;}
.crm-stage-link:hover{text-decoration:underline;text-underline-offset:2px;}
.crm-stage-negotiation{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:12px;}
/* Consolidated 2.1r / 2.2: one person, with their collaboration rows on request. */
.crm-all-switch{display:flex;gap:4px;flex-wrap:wrap;margin-left:auto;}
.crm-all-switch [aria-pressed="true"]{background:var(--green-l);border-color:var(--green);color:var(--green);}
.crm-table-filter{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--text2);}
.crm-people-select-all{display:flex;align-items:center;gap:8px;padding:12px;font-size:13px;}
.crm-people-count{padding:10px 12px;color:var(--text2);font-size:13px;}
.crm-person{border-top:1px solid var(--border);}
.crm-person-head{display:grid;grid-template-columns:24px minmax(160px,1.3fr) minmax(120px,1fr) auto auto;gap:12px;align-items:center;padding:16px;}
.crm-person-who{display:flex;flex-direction:column;gap:4px;min-width:0;overflow-wrap:anywhere;}
.crm-person-who span{font-size:12px;color:var(--text2);}
.crm-person-brands{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0;}
.crm-person-brands .badge{white-space:normal;overflow-wrap:anywhere;}
.crm-person-brands details{font-size:12px;overflow-wrap:anywhere;}
.crm-person-brands summary{cursor:pointer;min-height:24px;}
.crm-person-count{font-size:13px;color:var(--text2);}
.crm-person-collaborations{border-top:1px solid var(--border);background:var(--bg);max-width:100%;overflow:auto;}
.crm-person-collaborations[hidden]{display:none;}
.crm-person-expand[aria-expanded="true"]>span{display:inline-block;transform:rotate(180deg);}
.crm-people-pages{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;padding:16px;}
@media(max-width:1000px){.crm-person-head{grid-template-columns:24px minmax(0,1fr) auto;}.crm-person-brands{grid-column:2;}.crm-person-count{grid-column:2;}.crm-person-expand{grid-column:3;grid-row:1/4;}}
@media(max-width:600px){.crm-person-head{grid-template-columns:24px minmax(0,1fr);padding:12px;gap:10px;}.crm-person-expand{grid-column:2;grid-row:auto;justify-self:start;}.crm-all-switch{margin-left:0;}.crm-person-brands summary{min-height:44px;display:flex;align-items:center;}}
/* Its fields in a row that wraps: the owner's list widest, so its first choice ("Mia Torres (brand lead)") is never cut */
.crm-stage-fields{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;}
.crm-stage-fields > label{flex:1 1 130px;min-width:0;}
.crm-stage-fields > label.crm-stage-owner{flex:1 1 210px;}
.crm-stage-fields > label.crm-stage-step{flex:2 1 160px;}
.crm-stage-fields > .btn{flex:none;}

/* Our chips (6.7, finding U92): on one line, the emoji with its word, in KPM's narrow Status column too, a little less
   padded than KPM's badges so that column stays narrow; the creator's move (a sentence with a date) may wrap. */
.badge.crm-chip{white-space:nowrap;padding-left:6px;padding-right:6px;}
.badge.crm-chip.crm-badge-long{white-space:normal;}

/* KPM's alerts in the page (6.1, finding U65): crmAlert in the toast's neutral colours, KPM's lines kept, a long one
   (an outreach preview) scrolling inside the message; gone at the next click elsewhere (local-crm.js). */
.crm-alert > span:first-child{white-space:pre-line;max-height:min(40vh,320px);overflow-y:auto;}
.crm-alert.crm-alert-note{background:var(--text);color:#fff;border-color:var(--text);}
.crm-alert.crm-alert-note .crm-alert-x:hover{background:rgba(255,255,255,.14);}
.crm-alert.crm-alert-note .crm-alert-x:focus-visible{outline-color:#fff;}

/* A field left empty (the brand's or the creator's name), marked under it; the boxes for a note and for a rejected
   link's reason, in the page instead of a browser prompt (6.1) */
.finp[aria-invalid="true"]{border-color:var(--red);}
.crm-field-err{display:block;color:var(--red);font-size:var(--fs-xs);font-weight:600;margin-top:4px;}
.crm-field-err:empty{display:none;}
.crm-note-box,.crm-reject{display:flex;flex-direction:column;gap:6px;margin:0 0 10px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--rs);background:var(--bg);}
.crm-reject{margin:8px 0 0;}
.crm-note-box textarea,.crm-reject textarea{margin:0;resize:vertical;min-height:56px;}
.crm-note-box-ft,.crm-reject-ft{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:6px;}
.crm-note-box-ft .crm-field-err{margin:0 auto 0 0;}
.crm-reject-q{font-size:var(--fs-sm);font-weight:600;color:var(--text);}
.crm-reject-hint{font-size:var(--fs-xs);color:var(--text2);}
.crm-reject .btn[aria-disabled="true"]{opacity:.6;cursor:progress;}
.crm-import-done{margin-left:10px;}

/* Empty, loading and filtered screens say why (6.6, findings U95, U71): KPM's empty messages in the darker grey at 14 px,
   centred; "Loading your CRM…" (or the error with Try again) in the same style; the line above a filtered table. */
.empty{font-size:var(--fs-md);line-height:1.5;color:var(--text2);text-align:center;}
#content .tbl-wrap td[colspan="10"]{color:var(--text2)!important;font-size:var(--fs-md);padding:20px 12px;}
.crm-loading p{margin:0 0 12px;}
.crm-loading-list{padding:6px 18px;font-size:var(--fs-xs);color:var(--text2);}
.crm-filtered{display:flex;align-items:center;flex-wrap:wrap;gap:4px 6px;padding:6px 8px 0;font-size:var(--fs-sm);color:var(--text2);}
.crm-filtered > span:first-child{font-weight:600;color:var(--text);}
.crm-visit-time{white-space:nowrap;}

/* ── The posting deadline in the brand's form (release dev plan 1.3) ── */
.crm-hours-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:var(--fs-sm);}
#nc-post-hours{width:110px;}
.crm-hours-row .crm-field-err{flex-basis:100%;order:1;} /* under the row: localFieldError puts it right after the field, which the unit follows */

/* ── ⚙ API settings: whether the server has an Apify token, under its box (review 19 Oct 2026, finding F2) ── */
.crm-apify-status{font-size:12px;color:var(--text2);margin-top:4px;}
.crm-apify-status p{margin:0;}
.crm-apify-status button{margin-top:6px;}
.crm-apify-error{color:var(--red);margin:0;}

/* ── The Posted Report: when a post's stats were collected, under its date (C17, product decision 20 Oct 2026) ── */
.crm-collected{font-size:var(--fs-xs);color:var(--text3);white-space:normal;margin-top:2px;}
.crm-report-coverage{font-size:var(--fs-sm);color:var(--text2);margin:0 0 14px;}
.crm-report-metric-coverage{display:block;font-size:var(--fs-xs);color:var(--text2);margin-top:4px;}
/* Consolidated plan U1.1: Dashboard rows align actions while long names and places stay readable. */
.crm-dash-card{container-type:inline-size;container-name:crm-dash}
.crm-dash-row{display:grid!important;grid-template-columns:minmax(9rem,.9fr) minmax(0,2fr) 18rem;align-items:start!important;gap:8px!important;padding:5px 0}
.crm-dash-name,.crm-dash-details{min-width:0;white-space:normal;overflow-wrap:anywhere}
.crm-dash-actions{display:grid;grid-template-columns:4.5rem minmax(0,1fr);align-items:start;gap:4px;min-width:0}
.crm-dash-actions .btn{max-width:100%;white-space:normal}
.crm-dash-actions-single{display:flex;justify-content:flex-end}
.crm-dash-footer{margin:8px 0 12px;display:flex;flex-wrap:wrap}
.crm-dash-overdue-heading{gap:6px;flex-wrap:wrap}
.crm-dash-upcoming{overflow-wrap:anywhere;line-height:1.6}
@container crm-dash (max-width:40rem){.crm-dash-row{grid-template-columns:minmax(0,1fr);gap:6px!important}.crm-dash-actions{display:flex;flex-wrap:wrap;justify-content:flex-start}}

/* The client pipeline comes right after the KPI card (issue 494ce275); before that, right under the section links
   (frontend review UX3.2) (2.3/K2.2). */
.crm-pipeline{margin-bottom:16px;}
.crm-pipeline .card-hd{flex-wrap:wrap;gap:12px;}
.crm-pipeline .card-body h3{margin:12px 0 8px;font-size:13px;}
.crm-pipeline-groups{display:grid;grid-template-columns:2fr 1fr;gap:16px;}
.crm-pipeline-counts{display:flex;gap:8px;flex-wrap:wrap;}
.crm-pipeline-count{display:flex;flex:1;min-width:160px;align-items:flex-start;flex-direction:column;gap:6px;text-align:left;white-space:normal;}
.crm-pipeline-count b{font-weight:600;font-size:12px;}
.crm-pipeline-count[aria-expanded="true"]{background:var(--green-l);border-color:var(--green);}
.crm-pipeline-records{list-style:none;margin:0;padding:0;}
.crm-pipeline-records li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid var(--border);}
.crm-pipeline-records li>div{display:flex;flex-wrap:wrap;align-items:center;gap:8px;min-width:0;overflow-wrap:anywhere;}
@media(max-width:640px){.crm-pipeline-groups{grid-template-columns:1fr;gap:0;}.crm-pipeline-count{min-height:44px;}}

.crm-selected-filter-wrap{max-width:100%;min-width:0;}
.crm-selected-filter{max-width:100%;white-space:normal!important;overflow-wrap:anywhere;text-align:left;}
.crm-person-tick{display:flex;align-items:center;justify-content:center;min-width:24px;min-height:24px;cursor:pointer;}
@media(pointer:coarse){.crm-person-head{grid-template-columns:44px minmax(0,1fr) auto;}.crm-person-tick{min-width:44px;min-height:44px;}}
@media(pointer:coarse) and (max-width:600px){.crm-person-head{grid-template-columns:44px minmax(0,1fr);}}

/* U2.1: staff destinations are real links, with the existing navigation treatment. */
.crm-sb-ours a.nav-btn{text-decoration:none;}
/* Remote Dashboard feedback: visit-only rows share the action rows' spacing and list separators. */
#content > .card > .card-body > :is(.crm-dash-row,.ui-dash-line){margin:0 -8px!important;padding:8px;min-height:44px;line-height:1.45}
#content > .card > .card-body > :is(.crm-dash-row,.ui-dash-line) + :is(.crm-dash-row,.ui-dash-line){border-top:1px solid var(--border)}
#content > .card > .card-body > :is(.crm-dash-row,.ui-dash-line) + :not(.crm-dash-row,.ui-dash-line){margin-top:16px!important}
@media (hover:hover){#content > .card > .card-body > :is(.crm-dash-row,.ui-dash-line):hover{background:#faf9f7}}
#content > .card > .card-body > :is(.crm-dash-row:has(:focus-visible),.ui-dash-line:focus-visible){background:#faf9f7}
@container crm-dash (max-width:40rem){#content > .card > .card-body > .crm-dash-row{padding:12px 8px}}
.crm-kpi-rule,.crm-kpi-campaign-gaps{font-size:12px;line-height:1.5;color:var(--text2);margin:8px 0;overflow-wrap:anywhere}

/* K3.3: archive is distinct from permanent deletion; its preview retains long creator names and exceptions. */
#client-modal-ft .crm-delete-client:has(+ .crm-brand-archive-action){margin-right:0;}
#client-modal-ft .crm-brand-archive-action{margin-right:auto;}
body.read-only .crm-brand-archive-action,body.read-only .crm-archive-banner button{display:none;}
.crm-archive-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 16px;margin-bottom:16px;border:1px solid var(--border);border-radius:var(--rs);background:var(--bg);font-size:14px;overflow-wrap:anywhere;}
.crm-archive-banner p{margin:4px 0 0;color:var(--text2);font-size:13px;}
.crm-archive-banner > div{min-width:0;flex:1 1 240px;}
.crm-archived-clients{margin-top:8px;border-top:1px solid var(--border);padding-top:6px;}
.crm-archived-clients summary{padding:8px 12px;cursor:pointer;color:var(--text2);font-size:13px;min-height:32px;}
#crm-archive-preview h3{font-size:14px;line-height:1.5;margin:14px 0 6px;}
#crm-archive-preview ul{margin:0 0 12px;padding-left:20px;}
#crm-archive-preview li{margin:4px 0;overflow-wrap:anywhere;}
#crm-archive-preview .crm-archive-summary{font-weight:600;color:var(--text);}
#crm-archive-preview .crm-archive-incomplete{color:var(--red);}
@media (max-width:760px){.crm-archived-clients{flex:none;margin:0;padding:0;border-top:0;border-left:1px solid var(--border);}.crm-archived-clients summary{min-height:44px;}}
.crm-flag-warnings{padding-left:20px;overflow-wrap:anywhere}
.crm-flag-warnings ul{padding-left:18px}
.crm-flag-warnings li{margin:8px 0}
.crm-flag-include{display:flex;align-items:center;gap:8px;min-height:44px;white-space:normal;font-size:13px}
.crm-flag-queue-detail summary{min-height:44px;align-content:center;cursor:pointer}
.crm-flag-excluded{color:var(--text2);font-size:12px}
.crm-flag-mass-note{font-size:13px;color:var(--text2)}

/* U6.2–4 operational roles. Keep outside the two phone/pixel-comparison sections. */
body{font-size:var(--fs-md)}
body :is(h1,h2,h3){font-family:var(--st-font-ui)!important;font-weight:600!important;line-height:1.3!important;letter-spacing:normal!important}
body h1{font-size:var(--fs-2xl)!important}body h2,body h3[aria-level="2"]{font-size:var(--fs-xl)!important}body h3{font-size:var(--fs-lg)!important}
body :is(.flbl,th,.sb-label){text-transform:none;letter-spacing:normal}
.btn-ghost{border-color:var(--st-color-control-border)}
/* Dense action clusters retain whitespace as their boundary; toolbars remain outlined. */
.crm-creators td:last-child .btn-ghost{border-color:transparent}
body :is(button,.btn)[disabled],body :is(button,.btn)[aria-disabled="true"]{opacity:1!important;background:var(--st-color-disabled-bg)!important;color:var(--st-color-disabled-text)!important;border-color:var(--st-color-control-border)!important;cursor:default}
.crm-chip{gap:4px}.crm-chip [data-ui-icon]{--ui-size:14px}
.crm-history{background:var(--history-bg)!important;color:var(--history-text)!important}
.crm-platform{background:var(--platform-bg)!important;color:var(--platform-text)!important}
.crm-platform-ink{color:var(--platform-text)!important}
.crm-numeric{text-align:right!important}
.crm-visit-zone,.crm-disabled-reason{font-size:var(--fs-xs);color:var(--text2);margin:4px 0;line-height:1.5}
.crm-age-review{color:var(--amber)!important}
.crm-dash-heading-error{color:var(--red)!important}.crm-dash-heading-review{color:var(--amber)!important}.crm-dash-heading-info{color:var(--blue)!important}.crm-dash-heading-success{color:var(--green)!important}
/* Scale the upstream fractional sizes without touching generated invitation artwork. */
#content [style*="font-size:12.5px"],#content [style*="font-size: 12.5px"],.modal [style*="font-size:12.5px"]{font-size:var(--fs-sm)!important}
#content [style*="font-size:13.5px"],#content [style*="font-size: 13.5px"],.modal [style*="font-size:13.5px"]{font-size:var(--fs-md)!important}
#content [style*="font-size:15px"],.modal [style*="font-size:15px"]{font-size:var(--fs-md)!important}
#content [style*="font-size:17px"],.modal [style*="font-size:17px"]{font-size:var(--fs-lg)!important}
#det-body .crm-record-heading{font-family:var(--st-font-ui);font-size:var(--fs-lg)!important;font-weight:600;line-height:1.3!important}
body :is(input,select,textarea):disabled{opacity:1!important;background:var(--st-color-disabled-bg);color:var(--st-color-disabled-text)}

body [role=heading]{font-family:var(--st-font-ui)!important;font-weight:600!important;line-height:1.3!important;letter-spacing:normal!important}
body [role=heading][aria-level="1"]{font-size:var(--fs-2xl)!important}
body [role=heading][aria-level="2"]{font-size:var(--fs-xl)!important}
body [role=heading][aria-level="3"]{font-size:var(--fs-lg)!important}
@media(min-width:641px) and (hover:hover) and (pointer:fine){#content :is(input,textarea)[oninput^="updatePostReport"]{min-height:var(--st-staff-control-mini)}}
/* The label already retains its original gap after the glyph, including icon-only controls. */
.btn:has(>.ui-visual-label){gap:0}
.btn-sm>[data-ui-icon]{--ui-size:14px}
.crm-report-table :is(th,td):nth-child(n+5):nth-child(-n+11),.crm-report-table input[type=number]{text-align:right!important}
.crm-dlg-body{font-size:var(--fs-md)}
#read-only-banner,.crm-visit-ask{font-size:var(--fs-sm)}

/* Frontend review CRM-02/03/04: one compact control surface; existing inputs stay mounted. */
.crm-people-views{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.crm-people-views .crm-card-layout{width:auto}.crm-people-filters{flex:1;min-width:0}.crm-people-filters>summary{display:none}.crm-people-filter-fields{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.crm-people-filters:not([open])>.crm-people-filter-fields{display:flex}
.crm-brand-sections{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px}.crm-brand-summary{margin:0 0 12px;color:var(--text2);font-size:13px}.crm-brand-reference-list{display:grid;gap:12px;margin:16px 0}.crm-brand-reference,.crm-brand-form-group{border:1px solid var(--border);border-radius:var(--rs);background:var(--white)}.crm-brand-reference>summary,.crm-brand-form-group>summary{padding:12px 14px;cursor:pointer;font-size:14px;font-weight:600;min-height:44px}.crm-brand-reference>.card{margin:0;border:0;box-shadow:none}.crm-brand-form-group{padding:0 12px;margin-bottom:12px}.crm-brand-form-group>summary{margin:0 -12px}.crm-brand-form-group[open]>summary{margin-bottom:12px;border-bottom:1px solid var(--border)}
#add-client-modal .modal{display:flex;flex-direction:column;max-height:calc(100dvh - 32px);overflow:hidden}#add-client-modal .modal-body{min-height:0;overflow:auto;scroll-padding-block:24px 80px}#client-modal-ft{position:sticky;bottom:0;flex:none;background:var(--white);z-index:2;flex-wrap:wrap}#add-client-modal .finp:focus-visible{scroll-margin-block:24px}
.crm-invite-treatment{display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:12px;margin:8px 0}.crm-invite-treatment select{width:auto;max-width:100%;margin:0}.crm-save-scope{font-size:12px;color:var(--text2);margin:6px 0;line-height:1.5}.crm-save-scope [role=status]{display:block;font-weight:600}.crm-save-scope[data-state=error]{color:var(--red)}.crm-save-scope button{margin:6px 0}.crm-record-profile-grid>div{min-width:0}
@media(max-width:760px){.crm-people-controls{gap:6px!important}.crm-people-controls>#tbl-search-inp{width:100%!important}.crm-people-filters{width:100%}.crm-people-filters>summary{display:list-item;cursor:pointer;padding:8px 6px;min-height:44px;color:var(--text2)}.crm-people-filters:not([open])>.crm-people-filter-fields{display:none}.crm-people-filter-fields{padding:8px 0}.crm-people-views{gap:6px;width:100%}.crm-people-views .crm-all-switch{width:auto}.crm-people-views button{padding-inline:10px!important}.crm-brand-sections .btn{flex:1 1 40%;min-height:44px}.crm-brand-summary{font-size:12px}#add-client-modal .modal{max-height:calc(100dvh - 16px)}#client-modal-ft{padding:12px}#client-modal-ft .btn{min-height:44px}}

/* Issue 494ce275: the KPI card first on a brand's page, full width; platform and campaign blocks side by side in rows
   that fill the width (three campaigns per row at 1280 px, two at about 1000 px, one on a phone; min() keeps a block
   inside the card at 320 px). Scoped to .crm-kpi-first, which only the brand page's wrapper sets (localKpiFirst), so
   the KPI Tracker's cards stay as they are. KPM's inline margin-bottom on each campaign block gives way to the row gap. */
#content .crm-kpi-first{margin:0 0 16px}
.crm-kpi-first .crm-kpi-platforms,.crm-kpi-first .crm-kpi-campaigns{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,17rem),1fr));column-gap:16px;align-items:start}
.crm-kpi-first .crm-kpi-platforms>:first-child,.crm-kpi-first .crm-kpi-campaigns>:first-child{grid-column:1/-1}
.crm-kpi-first .crm-kpi-campaigns{row-gap:10px}
.crm-kpi-first .crm-kpi-campaigns>div+div{margin-bottom:0!important;min-width:0;overflow-wrap:anywhere}
.crm-kpi-camp-when{font-size:12px;margin:-2px 0 6px}

/* Literal glossary labels have no legacy emoji for visuals.css to hide. */
.ui-visual-label.crm-literal-control::first-letter{font-size:inherit;color:inherit}.crm-literal-control{margin-left:6px}.crm-brand-actions{display:flex;gap:6px;flex-wrap:wrap;flex-basis:100%;min-width:0}.crm-brand-actions .btn{white-space:normal}.crm-save-scope button[hidden]{display:none!important}

/* ── Discovery without Apify (issue 435c9b3b): the Discover tab's Apify status, the source, the hand-found list and its
      preview (public/local-crm.js, “Discovery without Apify”). Which of KPM's parts show is the class crm-da-hand on
      #itab-discover: with it, the Platform field, the Instagram routes, the TikTok fields, Run, Stop, the log and the
      result give way to the list, Preview and Save and the preview; the filters and Assign to brand stay, all four
      filters showing (KPM's plPlatformToggle hides three for TikTok with inline styles). ─────────────────────────── */
.crm-da-status{border:1px solid var(--border);border-radius:var(--rs);background:var(--white);padding:10px 12px;margin:0 0 12px;font-size:13px;line-height:1.5;overflow-wrap:anywhere;}
.crm-da-status p{margin:0;}
.crm-da-status.crm-da-missing,.crm-da-status.crm-da-refused{border-color:#e5c07b;background:var(--amber-l);}
.crm-da-status-actions,.crm-da-blocked-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px;}
.crm-da-status-actions .btn,.crm-da-blocked-actions .btn{white-space:normal;text-align:left;}
.crm-da-source{border:0;margin:0 0 12px;padding:0;min-width:0;}
.crm-da-source legend{font-size:11px;font-weight:600;color:var(--text2);text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px;padding:0;}
:root[lang="zh-Hans"] .crm-da-source legend{letter-spacing:0;}
.crm-da-sources{display:flex;flex-wrap:wrap;gap:8px;}
.crm-da-sources label{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 12px;border:1px solid var(--border);border-radius:var(--rs);background:var(--white);font-size:13px;cursor:pointer;}
.crm-da-sources label:has(input:checked){border-color:var(--green);background:var(--green-l);}
.crm-da-sources input{accent-color:var(--green);margin:0;}
.crm-da-help{font-size:12px;color:var(--text2);margin:0 0 10px;line-height:1.5;}
#crm-da-list{min-height:120px;font-family:monospace;font-size:12px;}
.crm-da-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:4px 0 8px;}
.crm-da-actions .btn{white-space:normal;text-align:left;max-width:100%;}
#crm-da-save[hidden]{display:none!important;}
.crm-da-preview{margin-top:8px;min-width:0;}
.crm-da-summary{font-size:13px;font-weight:600;margin:0 0 6px;}
.crm-da-summary:empty,#crm-da-error:empty,.crm-da-result:empty{display:none;}
.crm-da-note{font-size:12px;color:var(--text2);margin:0 0 6px;overflow-wrap:anywhere;}
.crm-da-stale{color:var(--amber);font-weight:600;}
.crm-da-table-wrap{max-width:100%;overflow-x:auto;}
.crm-da-table{width:100%;border-collapse:collapse;font-size:12px;}
.crm-da-table caption{text-align:left;font-weight:600;font-size:13px;margin-bottom:6px;overflow-wrap:anywhere;}
.crm-da-table th,.crm-da-table td{border-bottom:1px solid var(--border);padding:6px;text-align:left;vertical-align:top;}
.crm-da-table th{font-size:11px;color:var(--text2);font-weight:600;white-space:nowrap;}
.crm-da-table td:is(:nth-child(1),:nth-child(2),:nth-child(5)){white-space:nowrap;}
.crm-da-table td:is(:nth-child(3),:nth-child(4),:nth-child(6)){overflow-wrap:anywhere;}
.crm-da-out-add .crm-da-outcome,.crm-da-out-saved .crm-da-outcome{color:var(--green);font-weight:600;}
.crm-da-out-dup .crm-da-outcome,.crm-da-out-repeat .crm-da-outcome,.crm-da-out-filtered .crm-da-outcome{color:var(--amber);}
.crm-da-out-dnc .crm-da-outcome,.crm-da-out-invalid .crm-da-outcome{color:var(--red);}
.crm-da-result{margin-top:8px;font-size:13px;}
.crm-da-result p{margin:0 0 6px;}
#itab-discover:not(.crm-da-hand) :is(#crm-da-hand,#crm-da-actions,#crm-da-preview){display:none;}
#itab-discover.crm-da-hand :is(.crm-da-apify-only,#pl-ig-section,#pl-tt-section,#pipeline-log,#pipeline-result){display:none!important;}
#itab-discover.crm-da-hand #pl-er-row{display:grid!important;}
#itab-discover.crm-da-hand #pl-biokw-row{display:flex!important;}
@media (pointer:coarse){.crm-da-sources label{min-height:var(--tap);}}
/* A phone: the source labels take the width, and the preview is one card per row (each cell its heading before it). */
@media (max-width:640px){
  .crm-da-sources label{flex:1 1 100%;}
  .crm-da-table,.crm-da-table tbody,.crm-da-table tr,.crm-da-table td{display:block;width:100%;}
  .crm-da-table caption{display:block;}
  .crm-da-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;}
  .crm-da-table tr{border:1px solid var(--border);border-radius:var(--rs);margin:0 0 8px;padding:4px 0;}
  .crm-da-table td,.crm-da-table td:is(:nth-child(1),:nth-child(2),:nth-child(5)){border:0;padding:3px 10px;white-space:normal;overflow-wrap:anywhere;}
  .crm-da-table td::before{content:attr(data-label) ' ';font-weight:600;color:var(--text2);}
  .crm-da-actions .btn{flex:1 1 auto;}
}
