/* ByAir CRM design layer v18.10 — implements tools/DESIGN_RULES.md. Loaded last on every app page. */

/* ---------- tokens ---------- */
:root{--studio-focus:#e0582d;--d-focus:#e0582d;--d-control-border:#7a817a;--d-btn2-bg:#2c332d;--d-btn2-hover:#384139;--d-tray:#1a201c;--d-sp-1:4px;--d-sp-2:8px;--d-sp-3:12px;--d-sp-4:16px;--d-sp-5:24px;--d-sp-6:32px;--d-sp-7:48px}
html[data-theme=light]{--studio-focus:#c4441b;--d-focus:#c4441b;--d-control-border:#7d857c;--d-btn2-bg:#e9e6dc;--d-btn2-hover:#dcd8cb;--d-tray:#e4e1d6}

/* ---------- R8 focus: one visible ring everywhere ---------- */
html[data-theme] body :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid var(--d-focus)!important;outline-offset:2px!important;box-shadow:none}
html[data-theme] body :is(input,select,textarea):focus-visible{outline-offset:1px!important}
html[data-theme] body .skip-link:focus-visible{outline-offset:0!important}

/* ---------- R2 buttons ---------- */
html[data-theme] body :is(.btn,.chip-btn,summary.btn){display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:40px;height:auto;padding:0 16px;border:1px solid var(--d-control-border);border-radius:999px;background:var(--d-btn2-bg);color:var(--ink);font-size:14px;font-weight:600;line-height:1.2;white-space:nowrap;text-decoration:none;box-shadow:none;cursor:pointer;transform:none;opacity:1}
html[data-theme] body :is(.btn,.chip-btn,summary.btn):hover{background:var(--d-btn2-hover);color:var(--ink);transform:none}
html[data-theme] body :is(.btn,.chip-btn).btn-sm{min-height:36px;padding:0 12px;font-size:13px}
html[data-theme] body .notification-head .ux-markall .btn{min-height:36px!important;font-size:13px!important;padding:0 12px!important}
html[data-theme] body .approval-actions .review-close{min-height:36px}
html[data-theme] body .btn.btn-primary{background:var(--ink);border-color:var(--ink);color:var(--canvas)}
html[data-theme] body .btn.btn-primary:hover{background:color-mix(in srgb,var(--ink) 86%,var(--canvas));border-color:color-mix(in srgb,var(--ink) 86%,var(--canvas));color:var(--canvas)}
html[data-theme] body .btn.btn-danger{background:color-mix(in srgb,var(--danger) 11%,transparent);border-color:var(--danger);color:var(--danger)}
html[data-theme] body .btn.btn-danger:hover{background:color-mix(in srgb,var(--danger) 20%,transparent);color:var(--danger)}
html[data-theme] body .btn.btn-teal{color:var(--ink)}
html[data-theme] body :is(.btn,.chip-btn)[disabled],html[data-theme] body :is(.btn,.chip-btn)[aria-disabled=true]{opacity:.5;cursor:not-allowed}
html[data-theme] body .btn>svg{width:16px;height:16px;flex:none}
/* buttons that sit in a row with form fields take the field height (R5) */
html[data-theme] body :is(form,.actions,.searchbar,.toolbar,.ex-filters,.suite-filter,.suite-inline-form,.ws-inline,.ws-form,.actions-inline,.quote-status-actions,.analytics-filters,.profile-photo-form,.inline-form):has(> :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]),select,textarea,.crm-combobox,label,.field)) > :is(.btn,button:not(.password-toggle):not(.crm-combobox-trigger)){min-height:44px}
html[data-theme] body :is(.searchbar,.toolbar,.ex-filters,.suite-filter,.suite-inline-form,.ws-inline,.ws-form,.actions-inline,.quote-status-actions,.analytics-filters){align-items:flex-end;gap:var(--d-sp-3)}
html[data-theme] body .profile-photo-form{display:flex;flex-wrap:wrap;align-items:flex-end;gap:var(--d-sp-3)}
html[data-theme] body input[type=file]{min-height:44px}
/* icon buttons */
html[data-theme] body .icon-btn{min-width:40px;min-height:40px;border-radius:999px}

/* ---------- R3 tabs and choices: one control ---------- */
html[data-theme] body :is(.tabs,.simple-module-nav,.ws-tabs,.wc-tabs,.px-drawer-tabs,.view-toggle,.px-segments,.suite-subtabs,.dashboard-tabs,.feature-tabs){display:flex;flex-wrap:nowrap;align-items:center;gap:4px;width:fit-content;max-width:100%;padding:4px;margin:0 0 var(--d-sp-5);border:1px solid var(--d-control-border);border-radius:999px;background:var(--d-tray);overflow-x:auto;scrollbar-width:none;box-shadow:none}
html[data-theme] body :is(.tabs,.simple-module-nav,.ws-tabs,.wc-tabs,.px-drawer-tabs,.view-toggle,.px-segments,.suite-subtabs,.dashboard-tabs,.feature-tabs)::-webkit-scrollbar{display:none}
html[data-theme] body :is(.tabs,.simple-module-nav,.ws-tabs,.wc-tabs,.px-drawer-tabs,.view-toggle,.px-segments,.suite-subtabs,.dashboard-tabs,.feature-tabs)>:is(a,button,.btn){display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:none;min-height:38px;padding:0 14px;margin:0;border:0;border-radius:999px;background:transparent;color:var(--muted);font-size:13px;font-weight:600;line-height:1.2;white-space:nowrap;text-decoration:none;box-shadow:none;transform:none}
html[data-theme] body :is(.tabs,.simple-module-nav,.ws-tabs,.wc-tabs,.px-drawer-tabs,.view-toggle,.px-segments,.suite-subtabs,.dashboard-tabs,.feature-tabs)>:is(a,button,.btn):hover{background:var(--d-btn2-hover);color:var(--ink)}
html[data-theme] body :is(.tabs,.simple-module-nav,.ws-tabs,.wc-tabs,.px-drawer-tabs,.view-toggle,.px-segments,.suite-subtabs,.dashboard-tabs,.feature-tabs)>:is(a,button,.btn):is(.active,.is-active,.selected,.btn-primary,[aria-current=page],[aria-current=true],[aria-selected=true],[aria-pressed=true]){background:var(--ink);color:var(--canvas)}
html[data-theme] body :is(.tabs,.simple-module-nav,.ws-tabs,.wc-tabs,.px-drawer-tabs,.view-toggle,.px-segments,.suite-subtabs)>:is(a,button,.btn) .tab-count{margin-left:2px;padding:1px 7px;border-radius:999px;background:color-mix(in srgb,currentColor 16%,transparent);font-size:11px}
/* page header comes first, tabs right under it (R1) */
html[data-theme] body .content>.simple-module-nav{margin-top:calc(-1 * var(--d-sp-2))}
html[data-theme] body .crm-context-actions{margin:0 0 var(--d-sp-4)}

/* ---------- R4 form fields ---------- */
html[data-theme] body :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=color]):not([type=submit]):not([type=button]),select):not(.material-picker *):not(.px-search-input):not([class*=ws-check]){min-height:44px;height:44px;padding-top:0;padding-bottom:0;border:1px solid var(--d-control-border);border-radius:14px;font-size:14px;line-height:1.2;box-sizing:border-box}
html[data-theme] body textarea:not(.material-picker *){min-height:100px;border:1px solid var(--d-control-border);border-radius:14px;font-size:14px}
html[data-theme] body :is(input,select,textarea)[aria-invalid=true]{border-color:var(--danger)}
html[data-theme] body input[type=number]{-moz-appearance:textfield;appearance:textfield}
html[data-theme] body input[type=number]::-webkit-inner-spin-button,html[data-theme] body input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
html[data-theme] body :is(input[type=checkbox],input[type=radio]){width:20px;height:20px;min-width:20px;accent-color:var(--accent);cursor:pointer}
html[data-theme] body label:has(> input[type=checkbox]),html[data-theme] body label:has(> input[type=radio]){cursor:pointer;min-height:24px}
/* password: eye inside the box, wrapper as wide as the box */
html[data-theme] body .password-field{display:block;position:relative;width:100%;max-width:100%}
html[data-theme] body .password-field:has(> input[style*=max-width]){width:fit-content}
html[data-theme] body .password-field>input{width:100%;padding-right:46px!important}
html[data-theme] body .password-field>.password-toggle{right:4px;width:36px;height:36px;min-width:36px;min-height:36px}

/* ---------- R6 spacing on common blocks ---------- */
html[data-theme] body .content :is(.page-hero,.cp-hero){margin-bottom:var(--d-sp-5)}
html[data-theme] body .page-hero .actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:var(--d-sp-2)}
html[data-theme] body .actions{gap:var(--d-sp-2)}
html[data-theme] body .form-grid{gap:var(--d-sp-4)}

/* ---------- R8 touch targets ---------- */
html[data-theme] body .wc-record>a,html[data-theme] body .cp-contact>a,html[data-theme] body a.record-link,html[data-theme] body .px-pipeline-legend>a{display:inline-flex;align-items:center;min-height:24px}
html[data-theme] body details>summary{min-height:24px}
@media (max-width:760px){
  html[data-theme] body :is(.btn,.chip-btn,summary.btn),html[data-theme] body :is(.btn,.chip-btn).btn-sm{min-height:44px}
  html[data-theme] body :is(.tabs,.simple-module-nav,.ws-tabs,.wc-tabs,.px-drawer-tabs,.view-toggle,.px-segments,.suite-subtabs,.dashboard-tabs,.feature-tabs)>:is(a,button,.btn){min-height:40px}
  html[data-theme] body header.topbar a.r18-brand{min-height:44px;display:inline-flex;align-items:center}
  html[data-theme] body .wc-record>a,html[data-theme] body .cp-contact>a,html[data-theme] body a.record-link{min-height:32px}
}

/* ---------- R7 type ---------- */
html[data-theme] body .content h1{font-size:30px;font-weight:700;line-height:1.15}

/* ---------- R9 tables ---------- */
html[data-theme] body .table td .btn:not(.btn-danger):not(.btn-primary){background:var(--d-btn2-bg);border-color:var(--d-control-border);color:var(--ink)}
html[data-theme] body .table td .btn:not(.btn-danger):not(.btn-primary):hover{background:var(--d-btn2-hover)}
html[data-theme] body .table-wrap:focus-visible{outline-offset:-3px!important}

/* ---------- date / time picker ---------- */
html[data-theme] body dialog.material-picker[open]{display:flex;flex-direction:column;max-height:calc(100dvh - 24px);overflow:hidden}
html[data-theme] body .material-picker>.picker-banner,html[data-theme] body .material-picker>.picker-footer,html[data-theme] body .material-picker>.picker-error{flex:none}
html[data-theme] body .material-picker>.picker-body{flex:1 1 auto;min-height:0;overflow:auto}
html[data-theme] body .material-picker .picker-footer{display:flex;justify-content:flex-end;gap:var(--d-sp-2);padding:var(--d-sp-3) var(--d-sp-4);border-top:1px solid var(--line)}
html[data-theme] body .material-picker .picker-footer>button{min-height:40px;padding:0 18px;border-radius:999px;font-weight:600;border:1px solid var(--d-control-border);background:var(--d-btn2-bg);color:var(--ink)}
html[data-theme] body .material-picker .picker-footer>button:last-child{background:var(--ink);border-color:var(--ink);color:var(--canvas)}
html[data-theme] body .material-picker :is(.picker-tabs,.picker-period){display:inline-flex;gap:4px;padding:4px;border:1px solid color-mix(in srgb,currentColor 45%,transparent);border-radius:999px;background:color-mix(in srgb,#000 18%,transparent)}
html[data-theme] body .material-picker .picker-period{flex-direction:column;border-radius:16px;align-self:center}
html[data-theme] body .material-picker :is(.picker-tabs,.picker-period)>button{min-height:34px;min-width:52px;padding:0 12px;border:0;border-radius:999px;background:transparent;color:inherit;font-weight:600;opacity:.85}
html[data-theme] body .material-picker .picker-period>button{border-radius:12px}
html[data-theme] body .material-picker :is(.picker-tabs,.picker-period)>button:is([aria-selected=true],[aria-pressed=true],.active,.selected){background:var(--ink);color:var(--canvas);opacity:1}
html[data-theme] body .material-picker .picker-time-row{display:flex;align-items:center;justify-content:center;gap:var(--d-sp-3)}
html[data-theme] body .material-picker .picker-time-part{display:flex;flex-direction:column-reverse;align-items:center;gap:6px;width:auto}
html[data-theme] body .material-picker .picker-time-part>label{font-size:12px;font-weight:600;color:var(--muted);margin:0}
html[data-theme] body .material-picker .picker-time-part>input{width:84px;height:60px;min-height:60px;text-align:center;font-size:28px;padding:0;border:1px solid var(--d-control-border);border-radius:14px}
html[data-theme] body .material-picker .picker-time-part.active>input{border-color:var(--d-focus);border-width:2px}
html[data-theme] body .material-picker .picker-time-colon{align-self:center;margin-top:-18px;font-size:28px}
@media (max-height:760px){html[data-theme] body .material-picker .picker-clock{zoom:.8}html[data-theme] body .material-picker .picker-banner{padding-top:14px;padding-bottom:12px}}

/* ---------- small fixes from the accessibility audit ---------- */
html[data-theme] body .signout-btn{min-height:40px}

/* ---------- mobile reflow (no sideways page scroll) ---------- */
html[data-theme] body .feature-list-row>*{min-width:0}
html[data-theme] body .feature-list-row>div{flex:1 1 auto}
html[data-theme] body .row-end{min-width:0;flex-wrap:wrap}
@media (max-width:760px){
  html[data-theme] body table.suite-journal-lines{display:block;max-width:100%;overflow-x:auto}
}
/* small text links get a 24px target */
html[data-theme] body :is(.section-head,.cp-section-head,.wc-inline)>a,html[data-theme] body a.text-link{display:inline-flex;align-items:center;min-height:24px}

/* ---------- R9 tables: words stay whole; phones scroll the table inside its frame ---------- */
html[data-theme] body :is(.table,.wc-table table) :is(td,th){overflow-wrap:break-word;word-break:normal}
html[data-theme] body :is(.table,.wc-table table) td :is(strong,.record-link,.money,.badge,time){white-space:nowrap}
@media (max-width:760px){
  html[data-theme] body :is(.table-wrap,.ex-table-scroll,.wc-table)>table:not(.mobile-record-table){min-width:760px}
  html[data-theme] body :is(.table-wrap,.ex-table-scroll,.wc-table)>table:not(.mobile-record-table) :is(td,th){min-width:104px}
}
/* long tab rows wrap on desktop instead of being cut off */
@media (min-width:761px){
  html[data-theme] body :is(.tabs,.simple-module-nav,.ws-tabs,.wc-tabs,.px-segments,.suite-subtabs,.dashboard-tabs,.feature-tabs){flex-wrap:wrap;border-radius:22px;overflow:visible}
}
/* month / week inputs have room for their value and icon */
html[data-theme] body :is(input[type=month],input[type=week]){min-width:170px!important}
/* trays and forms inside a toolbar row sit on the same centre line (R5) */
html[data-theme] body :is(.ex-toolbar,.toolbar,.px-dashboard-toolbar,.searchbar,.actions,.page-hero) > :is(.tabs,.simple-module-nav,.ws-tabs,.wc-tabs,.view-toggle,.px-segments,.suite-subtabs,.dashboard-tabs,.feature-tabs,form){margin:0}
html[data-theme] body :is(.ex-toolbar,.px-dashboard-toolbar){display:flex;flex-wrap:wrap;align-items:center;gap:var(--d-sp-3)}
html[data-theme] body .ex-toolbar .actions{align-items:center}
html[data-theme] body .ex-toolbar .actions>a.btn[aria-label]{min-width:44px;min-height:44px;padding:0 12px}
html[data-theme] body .ex-toolbar form{align-self:center}
html[data-theme] body :is(.ex-toolbar,.px-dashboard-toolbar) :is(.view-toggle,.px-segments){padding:3px}
html[data-theme] body :is(.ex-toolbar,.px-dashboard-toolbar) :is(.view-toggle,.px-segments)>:is(a,button,.btn){min-height:36px}
/* date-like inputs: value centred vertically */
html[data-theme] body input:is([type=date],[type=month],[type=week],[type=time],[type=datetime-local]){line-height:42px}
html[data-theme] body input:is([type=date],[type=month],[type=week],[type=time],[type=datetime-local])::-webkit-datetime-edit{padding:0;line-height:1.2}

/* label-wrapped fields in a row: no stray margins, so the button lines up with the box */
html[data-theme] body :is(.ws-form,.ws-inline,.ex-filters,.searchbar,.suite-filter,.suite-inline-form,.profile-photo-form,.actions-inline) > :is(label,.field){margin:0}
html[data-theme] body :is(.ws-form,.profile-photo-form) > :is(.btn,button){margin:0}
/* file inputs: same height as other fields, themed picker button, full file name */
html[data-theme] body input[type=file]{height:44px;min-width:min(260px,100%);width:100%;max-width:100%;padding:4px 12px 4px 4px!important;border:1px solid var(--d-control-border);border-radius:14px;font-size:13px;line-height:normal;color:var(--muted);display:block;box-sizing:border-box}
html[data-theme] body input[type=file]::file-selector-button{height:34px;margin:0 12px 0 0;padding:0 14px;border:1px solid var(--d-control-border);border-radius:999px;background:var(--d-btn2-bg);color:var(--ink);font:600 13px inherit;cursor:pointer}
html[data-theme] body input[type=file]::file-selector-button:hover{background:var(--d-btn2-hover)}
html[data-theme] body .profile-photo-form>.field{flex:1 1 240px;min-width:0}
html[data-theme] body .ws-form>label:has(input[type=file]){flex:1 1 320px;min-width:0}

/* ---------- part 2: sign-in and account ---------- */
html[data-theme] body main.login-wrap~.app-toast-host{display:none}
html[data-theme] body .login-card .login-step-title{font-size:22px;line-height:1.25;margin:18px 0 6px;text-align:left}
html[data-theme] body .login-card form>.btn-primary,html[data-theme] body .login-card .passkey-login-panel>.btn{width:100%;min-height:44px}
html[data-theme] body .login-card .flash.info{border:1px solid var(--d-control-border);background:var(--soft);color:var(--ink)}
html[data-theme] body .login-divider{display:flex;align-items:center;gap:12px;margin:16px 0 12px;color:var(--muted);font-size:12px}
html[data-theme] body .login-divider::before,html[data-theme] body .login-divider::after{content:"";flex:1;height:1px;background:var(--line)}
html[data-theme] body .login-help{margin-top:16px;text-align:center}
html[data-theme] body .login-card .otp-input{letter-spacing:.12em;font-size:18px;text-align:center}
html[data-theme] body .recovery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:8px;margin-top:12px}
html[data-theme] body .recovery-grid code{display:block;padding:10px 12px;border:1px solid var(--d-control-border);border-radius:10px;background:var(--soft);font-size:14px;letter-spacing:.04em;text-align:center;user-select:all}
html[data-theme] body .security-recovery-card{border-color:var(--d-focus)}

/* ---------- part 3: dashboard and shared components ---------- */
/* top bar: "+ New" create menu visible on desktop, first in the action group */
@media (min-width:1100px){
  html[data-theme] body .top-actions>.quick-add{display:block;order:-1}
  html[data-theme] body .top-actions>.quick-add>summary{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:0 16px;border:1px solid var(--ink);border-radius:999px;background:var(--ink);color:var(--canvas);font-weight:600;font-size:14px;cursor:pointer;list-style:none}
  html[data-theme] body .top-actions>.quick-add>summary::-webkit-details-marker{display:none}
  html[data-theme] body .top-actions>.quick-add>summary::before{content:"+";font-size:18px;line-height:1}
  html[data-theme] body .top-actions>.quick-add .quick-menu{position:absolute;right:0;top:50px;width:240px;display:flex;flex-direction:column;gap:2px;padding:8px}
  html[data-theme] body .top-actions>.quick-add .quick-menu a{padding:10px 12px;border-radius:10px;color:var(--ink);text-decoration:none}
  html[data-theme] body .top-actions>.quick-add .quick-menu a:hover{background:var(--d-btn2-hover)}
  html[data-theme] body .top-actions>.quick-add{position:relative}
}
/* notifications: heading first, inbox link last */
html[data-theme] body .notification-popover{display:flex;flex-direction:column}
html[data-theme] body .notification-popover>.notification-head{order:-1}
html[data-theme] body .notification-popover>a[href*="section=inbox"]{order:99;margin-top:8px;justify-content:center;border-top:1px solid var(--line);border-radius:0;padding-top:12px;font-weight:600}
/* search palette: name and detail on separate lines */
html[data-theme] body .ws-command a{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px 12px;border-radius:10px;color:var(--ink);text-decoration:none}
html[data-theme] body .ws-command a small{color:var(--muted);font-size:12px}
html[data-theme] body .ws-command a:is(:hover,:focus-visible){background:var(--d-btn2-hover)}
html[data-theme] body .ws-command h3{margin:12px 12px 4px;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
/* confirm dialog: reason label above a full-width box */
html[data-theme] body .confirm-reason{display:flex;flex-direction:column;gap:6px;margin:12px 0 16px}
html[data-theme] body .confirm-reason>label{font-size:13px;font-weight:600;position:static}
html[data-theme] body .confirm-reason>textarea{width:100%;min-height:84px;position:static;margin:0}
html[data-theme] body .app-confirm-modal .confirm-icon{display:grid;place-items:center;width:36px;height:36px;margin:0 0 8px;border-radius:999px;background:color-mix(in srgb,var(--danger) 16%,transparent);color:var(--danger);font-weight:700;font-size:18px}
html[data-theme] body .app-confirm-modal .app-modal-foot{display:flex;justify-content:flex-end;gap:8px}
/* dropdown empty message */
html[data-theme] body .crm-combobox-empty{padding:12px;color:var(--muted);font-size:13px}
/* dashboard: currency name not cut; KPI tiles fill the row whatever the count */
html[data-theme] body .px-currency-form select{min-width:220px;max-width:100%}
html[data-theme] body .px-metrics{grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
@media (max-width:760px){html[data-theme] body .px-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}html[data-theme] body .px-currency-form select{min-width:0}}
/* not-found / empty state */
html[data-theme] body .crm-empty-state{display:flex;flex-direction:column;align-items:flex-start;gap:12px;max-width:640px;margin:48px auto;padding:32px}
html[data-theme] body .crm-empty-state h1{font-size:28px;margin:0}
html[data-theme] body .crm-empty-state p{color:var(--muted);margin:0}
html[data-theme] body .crm-empty-code{font:600 12px/1 var(--mono,ui-monospace,monospace);letter-spacing:.1em;color:var(--muted)}

/* ---------- part 4: customers ---------- */
/* profile figures: rows always filled, whatever the number of tiles */
html[data-theme] body .cp-kpis{display:flex;flex-wrap:wrap;gap:12px}
html[data-theme] body .cp-kpis>*{flex:1 1 180px;min-width:0}
@media (max-width:760px){html[data-theme] body .cp-kpis>*{flex:1 1 calc(50% - 6px)}}
html[data-theme] body .crm-dup-notice{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin:0 0 16px;padding:12px 12px 12px 16px;border-radius:14px;border:1px solid var(--d-focus);background:var(--surface)}
html[data-theme] body .section-head{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px}
html[data-theme] body .section-head>div:first-child{flex:1 1 240px;min-width:0}
html[data-theme] body .cp-pending-pay{margin:8px 0 20px}
html[data-theme] body .cp-pending-pay h3{font-size:15px;margin:0 0 8px}

/* ---------- part 5: leads and sales ---------- */
html[data-theme] body details.crm-create-panel{margin:0 0 20px}
/* page title never shrinks below its own words */
html[data-theme] body .title-row>div:first-child{flex:1 1 auto}
html[data-theme] body .content h1{max-width:none}
/* table action column takes the width its buttons need, other columns wrap */
html[data-theme] body .followup-row-actions{display:flex;flex-direction:column;align-items:stretch;gap:6px;min-width:max-content}
html[data-theme] body .table:has(.followup-row-actions){min-width:0}
@media (max-width:760px){html[data-theme] body .table:has(.followup-row-actions){min-width:760px}}
html[data-theme] body details.crm-create-panel>summary{list-style:none;display:inline-flex;width:auto;margin:0 0 12px}
html[data-theme] body details.crm-create-panel>summary::-webkit-details-marker{display:none}
html[data-theme] body details.crm-create-panel>summary::before{content:"+";margin-right:6px;font-size:18px;line-height:1}
html[data-theme] body details.crm-create-panel[open]>summary::before{content:"−"}

/* ---------- part 6: bookings and travel ---------- */
/* booking form sections: one tray (R3), numbered */
html[data-theme] body .studio-booking-index{display:flex;flex-wrap:nowrap;gap:4px;width:fit-content;max-width:100%;padding:4px;margin:0 0 var(--d-sp-5);border:1px solid var(--d-control-border);border-radius:999px;background:var(--d-tray);overflow-x:auto;scrollbar-width:none;counter-reset:bstep;position:sticky;top:8px;z-index:5}
html[data-theme] body .studio-booking-index::-webkit-scrollbar{display:none}
html[data-theme] body .studio-booking-index>a{counter-increment:bstep;display:inline-flex;align-items:center;gap:8px;flex:none;min-height:38px;padding:0 14px;border-radius:999px;color:var(--muted);font-size:13px;font-weight:600;white-space:nowrap;text-decoration:none}
html[data-theme] body .studio-booking-index>a::before{content:counter(bstep);display:inline-grid;place-items:center;width:20px;height:20px;border-radius:999px;border:1px solid currentColor;font-size:11px}
html[data-theme] body .studio-booking-index>a:hover{background:var(--d-btn2-hover);color:var(--ink)}
html[data-theme] body .studio-booking-index>a[aria-current]{background:var(--ink);color:var(--canvas)}
/* ticket ledger: action buttons stacked, the table fits the page */
html[data-theme] body .ticket-row-actions{display:flex;flex-direction:column;align-items:stretch;gap:6px;min-width:max-content}
html[data-theme] body .table.ticket-register{min-width:0}
@media (max-width:760px){html[data-theme] body .table.ticket-register{min-width:760px}}
/* folded create forms with a header button */
html[data-theme] body details.crm-create-panel.has-trigger>summary{display:none}
html[data-theme] body details.crm-create-panel.has-trigger{position:relative;margin:0 0 var(--d-sp-5)}
html[data-theme] body details.crm-create-panel .crm-create-close{position:absolute;top:16px;right:16px;z-index:2}
html[data-theme] body .feature-grid-2.crm-grid-single{grid-template-columns:minmax(0,1fr)}
html[data-theme] body details.crm-create-panel>.feature-grid-2{margin:0}
/* page header actions start on the left on phones */
@media (max-width:760px){html[data-theme] body :is(.page-hero,.title-row,.feature-hero) .actions{justify-content:flex-start}}
/* visa and trip rows: icon centred, actions grouped on the right */
html[data-theme] body .feature-list-icon{display:inline-grid;place-items:center;color:var(--muted)}
html[data-theme] body .feature-list-row .task-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px}
html[data-theme] body .feature-list-row .task-actions form{display:flex;align-items:center;gap:6px;margin:0}

/* ---------- part 7: finance ---------- */
/* table action columns: buttons stacked, the table fits the card */
html[data-theme] body .crm-row-actions{display:flex;flex-direction:column;align-items:stretch;gap:6px;min-width:max-content}
html[data-theme] body .table.settlement-register{min-width:0}
/* payment review: which payment is being approved */
html[data-theme] body .approval-subject{display:flex;flex-direction:column;gap:2px;padding:12px 14px;margin:0 0 12px;border:1px solid var(--line);border-radius:12px;background:var(--d-btn2-bg)}
html[data-theme] body .approval-subject span{color:var(--muted);font-size:13px}
html[data-theme] body .approval-subject .approval-amount{font-size:18px}
/* void receipt: closed by default, opens on purpose */
html[data-theme] body details.crm-danger-zone{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
html[data-theme] body details.crm-danger-zone>summary{list-style:none;display:inline-flex;width:auto;color:var(--danger)}
html[data-theme] body details.crm-danger-zone>summary::-webkit-details-marker{display:none}
html[data-theme] body details.crm-danger-zone[open]>summary{margin-bottom:8px}
/* incentive filters: one row (R5) */
html[data-theme] body .incentive-filters{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px}
html[data-theme] body .incentive-filters>.field{flex:1 1 200px;margin:0}
html[data-theme] body .incentive-filters>.incentive-filter-action{flex:0 0 auto}
@media (max-width:760px){
  /* suite toolbars (cash book day, P&L dates): a wrapping row, not a narrow right-aligned column */
  html[data-theme] body .suite-filter{flex-direction:row;flex-wrap:wrap;align-items:flex-end;justify-content:flex-start}
  html[data-theme] body .suite-filter>label{flex:1 1 140px;min-width:0}
  html[data-theme] body .suite-filter>:is(.btn,button){flex:0 0 auto}
  /* small tables fit the phone, amounts visible without swiping */
  html[data-theme] body table.crm-table-compact{min-width:0!important;width:100%}
  html[data-theme] body table.crm-table-compact :is(td,th){min-width:0!important}
  /* wide finance tables: one card per row */
  html[data-theme] body table.crm-stack-table{display:block;min-width:0!important;width:100%}
  html[data-theme] body table.crm-stack-table>:is(tbody,thead){display:block;width:100%}
  html[data-theme] body table.crm-stack-table>thead,html[data-theme] body table.crm-stack-table tr.crm-stack-head{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}
  html[data-theme] body table.crm-stack-table tr:not(.crm-stack-head){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;padding:16px 4px;border-bottom:1px solid var(--line)}
  html[data-theme] body table.crm-stack-table tr:last-child{border-bottom:0}
  html[data-theme] body table.crm-stack-table td{display:block;min-width:0!important;padding:0;border:0;text-align:left;white-space:normal;overflow-wrap:anywhere}
  html[data-theme] body table.crm-stack-table td[data-label]::before{content:attr(data-label);display:block;color:var(--muted);font-size:12px;line-height:1.5;margin-bottom:2px;font-weight:500}
  html[data-theme] body table.crm-stack-table td:first-child,html[data-theme] body table.crm-stack-table td:has(.btn,form,details,input,select),html[data-theme] body table.crm-stack-table tr.crm-stack-wide>td{grid-column:1/-1}
  html[data-theme] body table.crm-stack-table td:first-child::before{display:none}
  html[data-theme] body table.crm-stack-table td:first-child{font-weight:600}
  html[data-theme] body table.crm-stack-table td:empty{display:none}
  html[data-theme] body table.crm-stack-table .crm-row-actions{flex-direction:row;flex-wrap:wrap;min-width:0}
}

/* ---------- part 8: business suite ---------- */
html[data-theme] body .suite-page h3>.crm-h3-text{flex:1 1 auto;min-width:0}
html[data-theme] body .crm-block-notice{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 16px;padding:14px 16px;border:1px solid color-mix(in srgb,var(--danger) 55%,var(--line));border-radius:14px;background:color-mix(in srgb,var(--danger) 10%,var(--surface))}
html[data-theme] body .crm-block-notice>span{flex:1 1 320px;min-width:0}

/* ---------- part 9: B2B ---------- */
html[data-theme] body table.crm-table-fit{min-width:0!important}
html[data-theme] body table.crm-table-fit :is(td,th){min-width:0!important}
html[data-theme] body table.crm-table-fit td.crm-break{overflow-wrap:anywhere}
html[data-theme] body table.crm-table-fit tr>td:last-child{width:1%;white-space:nowrap}
html[data-theme] body table.crm-table-fit tr>td:last-child>:is(.btn,form,.actions){display:flex;flex-direction:column;align-items:stretch;gap:6px;margin:0 0 6px}
html[data-theme] body table.crm-table-fit tr>td:last-child>:is(.btn,form,.actions):last-child{margin-bottom:0}
html[data-theme] body table.crm-table-fit tr>td:last-child .btn{white-space:nowrap}

/* ---------- part 10: studio, communication, record manager ---------- */
html[data-theme] body .crm-nowrap{white-space:nowrap}
html[data-theme] body .crm-manage-table tr>td:first-child{white-space:nowrap}
html[data-theme] body .crm-manage-table .crm-num{font-variant-numeric:tabular-nums}
/* nothing selected: show the access summary as one line, list right below */
html[data-theme] body .grid-2.crm-manage-idle{display:block;margin:0 0 var(--d-sp-4)}
html[data-theme] body .grid-2.crm-manage-idle>.card:first-child{display:none}
html[data-theme] body .grid-2.crm-manage-idle>.card:last-child{display:flex;flex-wrap:wrap;align-items:center;gap:6px 20px;padding:12px 16px}
html[data-theme] body .grid-2.crm-manage-idle>.card:last-child>h3{font-size:14px;margin:0}
html[data-theme] body .grid-2.crm-manage-idle>.card:last-child>p{margin:0;flex:1 1 260px}
html[data-theme] body .grid-2.crm-manage-idle .kpi-list{display:flex;flex-wrap:wrap;gap:6px 16px}
html[data-theme] body .grid-2.crm-manage-idle .kpi-row{display:inline-flex;gap:6px;padding:0;border:0;font-size:13px;white-space:nowrap}
/* filter panels with option groups line up at the top (pipeline workspace) */
html[data-theme] body form.ws-form:has(>fieldset){align-items:start}
/* phones: the meetings week reads top to bottom, one day after another */
@media (max-width:760px){
  html[data-theme] body .ws-calendar-scroll{overflow:visible}
  html[data-theme] body .ws-time-grid{grid-template-columns:minmax(0,1fr)!important;min-width:0!important}
  html[data-theme] body .ws-time-grid>.ws-time-day{min-height:0!important;display:grid;grid-template-columns:76px minmax(0,1fr);gap:4px 12px;align-items:start;padding:12px 0;border-bottom:1px solid var(--line)}
  html[data-theme] body .ws-time-grid>.ws-time-day>.ws-date-head{grid-row:span 9}
}

/* ---------- part 11: settings and owner tools ---------- */
html[data-theme] body .crm-sticky-save{position:sticky;bottom:0;z-index:5;display:flex;align-items:center;gap:12px;margin:16px 0 0;padding:12px 0;border-top:1px solid var(--line);background:var(--canvas,var(--surface))}
/* settings tabs show one panel at a time: use the full width */
html[data-theme] body .grid-2:has(>[data-px-panel]){grid-template-columns:minmax(0,1fr)}
html[data-theme] body .grid-2>[data-px-panel]{max-width:960px}
html[data-theme] body table.crm-stack-table{position:relative}
html[data-theme] body table.crm-stack-table :is(tr.crm-stack-head,thead){left:0;top:0}
@media (max-width:760px){html[data-theme] body table.crm-stack-table :is(select,input:not([type=checkbox]):not([type=radio])){min-width:0;max-width:100%;width:100%}html[data-theme] body table.crm-stack-table td :is(strong,a,.record-link){white-space:normal!important;overflow-wrap:anywhere}html[data-theme] body table.crm-stack-table :is(tr.crm-stack-head,thead){display:none}}

/* ---------- part 12: end-to-end fixes ---------- */
/* phones and tablets: the "Approve payment?" confirmation opened behind the Review payment panel, so it could not be pressed */
html[data-theme] body .app-modal.app-confirm-modal{z-index:2500}
/* tablets: same cards as phones, three values per row */
@media (min-width:761px) and (max-width:1024px){
  html[data-theme] body table.crm-table-compact{min-width:0!important;width:100%}
  html[data-theme] body table.crm-table-compact :is(td,th){min-width:0!important}
  html[data-theme] body table.crm-stack-table{display:block;min-width:0!important;width:100%}
  html[data-theme] body table.crm-stack-table>:is(tbody,thead){display:block;width:100%}
  html[data-theme] body table.crm-stack-table :is(tr.crm-stack-head,thead){display:none}
  html[data-theme] body table.crm-stack-table tr:not(.crm-stack-head){display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 18px;padding:16px 4px;border-bottom:1px solid var(--line)}
  html[data-theme] body table.crm-stack-table tr:last-child{border-bottom:0}
  html[data-theme] body table.crm-stack-table td{display:block;min-width:0!important;padding:0;border:0;text-align:left;white-space:normal;overflow-wrap:anywhere}
  html[data-theme] body table.crm-stack-table td[data-label]::before{content:attr(data-label);display:block;color:var(--muted);font-size:12px;line-height:1.5;margin-bottom:2px;font-weight:500}
  html[data-theme] body table.crm-stack-table td:first-child,html[data-theme] body table.crm-stack-table td:has(.btn,form,details,input,select),html[data-theme] body table.crm-stack-table tr.crm-stack-wide>td{grid-column:1/-1}
  html[data-theme] body table.crm-stack-table td:first-child::before{display:none}
  html[data-theme] body table.crm-stack-table td:first-child{font-weight:600}
  html[data-theme] body table.crm-stack-table td:empty{display:none}
  html[data-theme] body table.crm-stack-table .crm-row-actions{flex-direction:row;flex-wrap:wrap;min-width:0}
  html[data-theme] body table.crm-stack-table td :is(strong,a,.record-link){white-space:normal!important;overflow-wrap:anywhere}
  html[data-theme] body table.crm-stack-table :is(select,input:not([type=checkbox]):not([type=radio])){min-width:0;max-width:100%;width:100%}
}
/* header buttons are 40px on every screen above phone size (tablets had 42px, profile 48px) */
@media (min-width:761px){html[data-theme] body :is(.page-hero,.title-row,.feature-hero,.profile-hero) .actions>:is(.btn,details>summary.btn){min-height:40px}}
/* tab counts on inactive tabs: readable contrast in the light theme */
html[data-theme] body :is(.tabs,.simple-module-nav,.ws-tabs,.wc-tabs,.px-drawer-tabs,.view-toggle,.px-segments,.suite-subtabs)>:is(a,button):not(.active):not(.is-active):not(.selected):not(.btn-primary):not([aria-current=page]):not([aria-current=true]):not([aria-selected=true]):not([aria-pressed=true]) .tab-count{color:var(--ink)}

/* ---------- part 13 (18.10.12): motion, feedback and a richer Overview ---------- */
/* 1. sliding pill behind the active main tab and period switch */
html[data-theme] body :is(.r18-primary,.px-segments){position:relative}
html[data-theme] body .crm-tab-pill{position:absolute;left:0;top:0;z-index:0;border-radius:999px;background:var(--ink);pointer-events:none;opacity:0;transition:transform .38s cubic-bezier(.3,1.3,.5,1),width .38s cubic-bezier(.3,1.3,.5,1),opacity .2s}
html[data-theme] body :is(.r18-primary,.px-segments).crm-has-pill>a{position:relative;z-index:1;transition:color .25s}
html[data-theme] body :is(.r18-primary,.px-segments).crm-has-pill>a:is(.active,[aria-current],[aria-current=page]){background:transparent}
html[data-theme] body :is(.r18-primary,.px-segments).crm-has-pill>a:not(.crm-pill-on){color:var(--ink)}
html[data-theme] body .px-segments.crm-has-pill>a:not(.crm-pill-on){color:var(--muted)}
html[data-theme] body :is(.r18-primary,.px-segments).crm-has-pill>a:not(.crm-pill-on):hover{color:var(--ink)}
html[data-theme] body :is(.r18-primary,.px-segments).crm-has-pill>a.crm-pill-on,html[data-theme] body :is(.r18-primary,.px-segments).crm-has-pill>a.crm-pill-on:hover{color:var(--canvas);background:transparent}
/* 2 + 7. desktop sidebar stays a slim rail: labels show as tooltips, it no longer widens over page titles */
@media (min-width:821px){
  html[data-theme] body .sidebar:not(.open),html[data-theme] body .sidebar:not(.open):is(:hover,:focus-within){width:64px;border-radius:40px;overflow-x:hidden;overflow-y:auto;scrollbar-width:none}
  html[data-theme] body .sidebar:not(.open)::-webkit-scrollbar{display:none}
  html[data-theme] body .sidebar:not(.open) .nav-label{visibility:hidden;opacity:0}
  html[data-theme] body .sidebar:not(.open) .sep{height:1px;background:var(--line);overflow:hidden;font-size:0;margin:9px 8px;flex-shrink:0}
  html[data-theme] body .sidebar:not(.open) .nav-dot{display:none}
  html[data-theme] body .sidebar:not(.open) .nav a.crm-nav-on{background:var(--soft);color:var(--ink)}
  html[data-theme] body .sidebar:not(.open) .nav a.crm-nav-on::before{content:"";position:absolute;left:-8px;top:50%;width:3px;height:20px;margin-top:-10px;border-radius:0 3px 3px 0;background:var(--accent)}
}
html[data-theme] body .crm-nav-tip{position:fixed;z-index:3000;left:0;top:0;transform:translate(-4px,-50%);opacity:0;pointer-events:none;padding:7px 12px;border-radius:10px;background:var(--ink);color:var(--canvas);font-size:12px;font-weight:600;line-height:1.3;white-space:nowrap;box-shadow:0 10px 30px #0004;transition:opacity .12s,transform .12s}
html[data-theme] body .crm-nav-tip.is-on{opacity:1;transform:translate(0,-50%)}
/* 3. drawers and dialogs: blurred backdrop that fades in; menus scale in; finder results arrive one by one */
html[data-theme] body dialog.ex-modal::backdrop{background:rgba(8,12,10,.42);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
html[data-theme] body .app-modal-backdrop{backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
@keyframes crm-fade{from{opacity:0}to{opacity:1}}
@keyframes crm-pop{from{opacity:0;scale:.95}to{opacity:1;scale:1}}
@keyframes crm-rise{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}
@keyframes crm-sheet{from{translate:0 100%}to{translate:0 0}}
@media (prefers-reduced-motion:no-preference){
  html[data-theme]:not([data-motion=reduced]) body dialog.ex-modal[open]::backdrop{animation:crm-fade .25s ease-out}
  html[data-theme]:not([data-motion=reduced]) body :is(details.ux-menu[open] .ux-menu-list,details.quick-add[open] .quick-menu,details.notification-center[open] .notification-popover){animation:crm-pop .18s cubic-bezier(.2,.8,.3,1);transform-origin:top right}
  html[data-theme]:not([data-motion=reduced]) body .crm-stagger{animation:crm-rise .26s cubic-bezier(.2,.8,.3,1) both;animation-delay:calc(var(--crm-i,0) * 28ms)}
}
/* 4. phones: dialogs open as bottom sheets */
@media (max-width:760px){
  html[data-theme] body dialog.ex-modal:not(.ex-drawer){inset:auto 0 0 0;margin:0;width:100%;max-width:100%;max-height:92dvh;border-radius:24px 24px 0 0;border-bottom:0;padding-bottom:calc(24px + env(safe-area-inset-bottom))}
  html[data-theme] body dialog.ex-modal:not(.ex-drawer)::before,html[data-theme] body .app-modal.open .app-modal-panel::before{content:"";display:block;width:40px;height:4px;margin:-8px auto 14px;border-radius:4px;background:var(--strong)}
  html[data-theme] body .app-modal.open{place-items:end center;padding:0}
  html[data-theme] body .app-modal.open .app-modal-panel{width:100%;max-width:100%;max-height:92dvh;overflow:auto;border-radius:24px 24px 0 0;border-bottom:0;padding-bottom:calc(24px + env(safe-area-inset-bottom));animation:crm-sheet .32s cubic-bezier(.2,.8,.25,1)}
  html[data-motion=reduced] body .app-modal.open .app-modal-panel{animation:none}
}
@media (max-width:760px) and (prefers-reduced-motion:reduce){html[data-theme] body .app-modal.open .app-modal-panel{animation:none}}
/* 5. numbers flash when they change; finished items are struck through */
@keyframes crm-flash{0%{box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 55%,transparent)}100%{box-shadow:0 0 0 3px transparent}}
html[data-theme] body .crm-flash{animation:crm-flash .9s ease-out;border-radius:999px}
/* 6. loading skeleton */
html[data-theme] body .crm-skeleton{position:fixed;bottom:0;z-index:50;display:grid;gap:18px;align-content:start;padding:12px 32px 0 8px;overflow:hidden;pointer-events:none}
html[data-theme] body #main-content.crm-skel-on>*{visibility:hidden}
html[data-theme] body .crm-skeleton i{display:block;border-radius:18px;background:linear-gradient(90deg,var(--soft) 0,color-mix(in srgb,var(--soft) 50%,var(--surface)) 50%,var(--soft) 100%) 0 0/200% 100%;animation:crm-shimmer 1.2s linear infinite}
html[data-theme] body .crm-skeleton .sk-title{height:38px;width:min(320px,70%);margin-top:12px}
html[data-theme] body .crm-skeleton .sk-sub{height:14px;width:min(220px,50%);margin-bottom:12px}
html[data-theme] body .crm-skeleton :is(.sk-row,.sk-grid,.sk-lines){display:grid;gap:18px}
html[data-theme] body .crm-skeleton .sk-row{grid-template-columns:repeat(4,minmax(0,1fr))}
html[data-theme] body .crm-skeleton .sk-row i{height:118px}
html[data-theme] body .crm-skeleton .sk-grid{grid-template-columns:2fr 1fr}
html[data-theme] body .crm-skeleton .sk-grid i{height:300px}
html[data-theme] body .crm-skeleton .sk-lines i{height:56px}
@keyframes crm-shimmer{to{background-position:-200% 0}}
@media (max-width:820px){html[data-theme] body .crm-skeleton{padding:12px 16px 0}html[data-theme] body .crm-skeleton .sk-row{grid-template-columns:repeat(2,minmax(0,1fr))}html[data-theme] body .crm-skeleton .sk-grid{grid-template-columns:1fr}}
@media (prefers-reduced-motion:reduce){html[data-theme] body .crm-skeleton i{animation:none}}
html[data-motion=reduced] body .crm-skeleton i{animation:none}
/* 8. empty states get an icon; all notices share one toast style */
html[data-theme] body :is(.empty-state,td.empty,.crm-empty-state)::before{content:"";display:block;justify-self:center;width:46px;height:46px;margin:0 auto 6px;border-radius:50%;background:var(--soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a918a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 13h4l2 3h4l2-3h4'/%3E%3Cpath d='M5.5 6.5 4 13v5a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5l-1.5-6.5A2 2 0 0 0 16.6 5H7.4a2 2 0 0 0-1.9 1.5Z'/%3E%3C/svg%3E") center/22px no-repeat}
html[data-theme] body td.empty .crm-empty-action{margin-top:12px}
html[data-theme] body .empty-state .btn{justify-self:center;margin-top:4px}
html[data-theme] body :is(.ws-toast,.ex-toast,.px-toast,.crm-toast,.ux-toast){position:fixed;left:50%;right:auto;bottom:24px;transform:translateX(-50%);z-index:2600;display:flex;align-items:center;gap:10px;width:max-content;max-width:min(480px,calc(100vw - 32px));padding:11px 18px 11px 12px;border:0;border-radius:16px;background:var(--ink);color:var(--canvas);box-shadow:0 18px 50px #0006;font-size:14px;line-height:1.45}
html[data-theme] body :is(.ws-toast,.ex-toast,.px-toast,.crm-toast)::before{content:"✓";display:grid;place-items:center;flex:none;width:22px;height:22px;border-radius:50%;background:var(--success);color:#10201a;font-size:12px;font-weight:700}
html[data-theme] body :is(.ex-toast,.crm-toast).is-error::before{content:"!";background:var(--danger)}
html[data-theme] body :is(.ws-toast,.ex-toast,.px-toast,.crm-toast,.ux-toast)[hidden]{display:none}
html[data-theme] body .crm-toast{opacity:0;translate:0 14px;pointer-events:none;transition:opacity .2s,translate .32s cubic-bezier(.2,.8,.25,1)}
html[data-theme] body .crm-toast.is-on{opacity:1;translate:0 0;pointer-events:auto}
@media (prefers-reduced-motion:no-preference){html[data-theme]:not([data-motion=reduced]) body :is(.ws-toast,.ex-toast:not([hidden]),.px-toast,.ux-toast:not([hidden])){animation:crm-rise .3s cubic-bezier(.2,.8,.25,1)}}
@media (max-width:760px){html[data-theme] body :is(.ws-toast,.ex-toast,.px-toast,.crm-toast,.ux-toast){bottom:calc(84px + env(safe-area-inset-bottom))}}

/* header More menus on tablets were 42px: the 18.10.11 rule did not reach the summary inside its details */
@media (min-width:761px){html[data-theme] body :is(.page-hero,.title-row,.feature-hero,.profile-hero) .actions>details>summary.btn{min-height:40px!important;height:40px}}
/* ---------- Overview ---------- */
html[data-theme] body .px-bento.crm-bento{grid-auto-flow:row dense}
@media (min-width:1101px){
  html[data-theme] body .px-bento.crm-bento{grid-template-columns:repeat(12,minmax(0,1fr));align-items:stretch}
  html[data-theme] body .px-bento.crm-bento>*{grid-column:span 4!important}
  html[data-theme] body .px-bento.crm-bento>:is(.px-revenue,.px-pipeline-summary,.px-recent){grid-column:span 8!important}
  html[data-theme] body .px-bento.crm-bento>.r18-hot{grid-column:1/-1!important}
  html[data-theme] body .px-bento.crm-bento>details.px-focus-card:not([open]){align-self:start}
  html[data-theme] body .px-bento.crm-bento:not(:has(>.crm-team-card:not([hidden])))>.crm-activity{grid-column:span 8!important}
  html[data-theme] body .px-bento.crm-bento:not(:has(>.px-target-card:not([hidden])))>.px-recent{grid-column:1/-1!important}
}
/* 9. KPI trend lines */
html[data-theme] body .px-metric .crm-spark{display:block;width:100%;height:30px;margin:6px 0 10px;overflow:visible}
html[data-theme] body .px-metric .crm-spark-flat{height:30px;margin:6px 0 10px;border-bottom:1px dashed var(--line)}
html[data-theme] body .crm-spark-line{fill:none;stroke:var(--accent);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
html[data-theme] body .crm-spark-area{fill:color-mix(in srgb,var(--accent) 14%,transparent);stroke:none}
/* 12. Today */
html[data-theme] body .crm-today-head{display:flex;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted);margin-bottom:8px}
html[data-theme] body .crm-today-count{color:var(--ink);font-weight:600}
html[data-theme] body .crm-today-bar{display:block;height:6px;border-radius:6px;background:var(--soft);overflow:hidden;margin-bottom:10px}
html[data-theme] body .crm-today-bar i{display:block;height:100%;border-radius:6px;background:var(--success);transition:width .45s cubic-bezier(.2,.8,.25,1)}
html[data-theme] body .crm-today-list{list-style:none;margin:0;padding:0}
html[data-theme] body .crm-today-row{display:flex;align-items:center;gap:12px;padding:10px 2px;border-bottom:1px solid var(--line)}
html[data-theme] body .crm-today-row:last-child{border-bottom:0}
html[data-theme] body .crm-today-row>a{flex:1;min-width:0;display:grid;gap:2px;color:inherit;text-decoration:none}
html[data-theme] body .crm-today-row>a strong{display:inline;justify-self:start;font-weight:600;font-size:14px;overflow-wrap:anywhere;background:linear-gradient(currentColor,currentColor) 0 55%/0 1.5px no-repeat;transition:background-size .35s ease,color .2s}
html[data-theme] body .crm-today-row>a small{font-size:12px;color:var(--muted)}
html[data-theme] body .crm-today-row.is-overdue>a small{color:var(--danger)}
html[data-theme] body .crm-today-row.is-done>a small{color:var(--muted)}
html[data-theme] body .crm-today-row.is-done>a strong{background-size:100% 1.5px;color:var(--muted)}
html[data-theme] body .crm-check{position:relative;display:grid;place-items:center;flex:none;width:28px;height:28px;cursor:pointer}
html[data-theme] body .crm-check input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
html[data-theme] body .crm-check-box{display:grid;place-items:center;width:22px;height:22px;border:1.5px solid var(--strong);border-radius:7px;transition:background .2s,border-color .2s,transform .2s}
html[data-theme] body .crm-check input:checked+.crm-check-box{background:var(--success);border-color:var(--success)}
html[data-theme] body .crm-check input:checked+.crm-check-box::after{content:"✓";color:#10201a;font-size:13px;font-weight:800;line-height:1}
html[data-theme] body .crm-check input:focus-visible+.crm-check-box{outline:2px solid var(--accent);outline-offset:2px}
html[data-theme] body .crm-check input:active+.crm-check-box{transform:scale(.9)}
html[data-theme] body .crm-today-icon{display:grid;place-items:center;flex:none;width:28px;height:28px;border-radius:9px;background:var(--soft);color:var(--muted)}
html[data-theme] body .crm-today-icon svg{width:15px;height:15px}
html[data-theme] body .crm-today-more{display:inline-block;margin-top:10px}
/* 11. target ring */
html[data-theme] body .crm-ring{position:relative;display:grid;place-items:center;width:156px;height:156px;margin:6px auto 16px}
html[data-theme] body .crm-ring svg{position:absolute;inset:0;width:100%;height:100%}
html[data-theme] body .crm-ring circle{fill:none;stroke-width:11;stroke-linecap:round}
html[data-theme] body .crm-ring-track{stroke:var(--soft)}
html[data-theme] body .crm-ring-fill{stroke:var(--accent)}
html[data-theme] body .crm-ring>div{display:grid;text-align:center}
html[data-theme] body .crm-ring strong{font-size:30px;font-weight:600;letter-spacing:-.03em;line-height:1.1}
html[data-theme] body .crm-ring small{font-size:12px;color:var(--muted)}
@keyframes crm-ring{from{stroke-dasharray:0 100}}
@media (prefers-reduced-motion:no-preference){html[data-theme]:not([data-motion=reduced]) body .crm-ring-fill{animation:crm-ring 1s cubic-bezier(.2,.8,.25,1)}}
/* 13. activity feed */
html[data-theme] body .crm-feed{list-style:none;margin:0;padding:0;display:grid}
html[data-theme] body .crm-feed li{display:flex;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
html[data-theme] body .crm-feed li:last-child{border-bottom:0}
html[data-theme] body .crm-feed-avatar{display:grid;place-items:center;flex:none;width:32px;height:32px;border-radius:50%;background:var(--soft);color:var(--ink);font-size:13px;font-weight:700}
html[data-theme] body .crm-feed li>div{min-width:0}
html[data-theme] body .crm-feed p{margin:0;font-size:13px;line-height:1.45;color:var(--muted);overflow-wrap:anywhere}
html[data-theme] body .crm-feed p strong{color:var(--ink);font-weight:600}
html[data-theme] body .crm-feed p a{color:var(--ink);text-decoration:underline;text-underline-offset:2px}
html[data-theme] body .crm-feed small{font-size:12px;color:var(--muted)}
/* 14. stage mix */
html[data-theme] body .px-pipeline-legend.crm-stage-mix{grid-template-columns:repeat(2,minmax(0,1fr));gap:2px 28px;font-size:13px}
html[data-theme] body .px-pipeline-legend.crm-stage-mix>a{display:grid;grid-template-columns:10px minmax(0,1fr) 30px 42px minmax(70px,auto);align-items:center;gap:10px;min-height:38px;padding:4px 0;border-bottom:1px solid var(--line)}
html[data-theme] body .crm-stage-mix strong{margin:0;text-align:right;font-variant-numeric:tabular-nums}
html[data-theme] body .crm-stage-mix :is(.crm-mix-pct,.crm-mix-value){text-align:right;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap}
@media (max-width:560px){html[data-theme] body .px-pipeline-legend.crm-stage-mix{grid-template-columns:1fr}}

/* ---------- part 14 (18.10.13): Pipeline and Customers ---------- */
/* shared: summary strip, avatars */
html[data-theme] body .crm-stat-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:0 0 18px}
html[data-theme] body .crm-stat-strip>div{display:grid;gap:2px;align-content:start;padding:14px 16px;border:1px solid var(--line);border-radius:18px;background:color-mix(in srgb,var(--surface) 70%,transparent);min-width:0}
html[data-theme] body .crm-stat-strip small{font-size:12px;color:var(--muted)}
html[data-theme] body .crm-stat-strip strong{font-size:22px;font-weight:600;letter-spacing:-.02em;line-height:1.25;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
html[data-theme] body .crm-stat-strip em{font-style:normal;font-size:12px;color:var(--muted)}
html[data-theme] body .crm-stat-strip>.is-bad strong{color:var(--danger)}
html[data-theme] body .crm-stat-strip>.is-warn strong{color:var(--warning,var(--accent))}
html[data-theme] body :is(.crm-avatar,.crm-owner-chips i,.crm-assignee i,.crm-owner i){display:inline-grid;place-items:center;flex:none;border-radius:50%;background:hsl(var(--h,150) 38% 32%);color:#fff;font-weight:700;font-style:normal;letter-spacing:.02em}
@media (max-width:760px){html[data-theme] body .crm-stat-strip{grid-template-columns:repeat(2,minmax(0,1fr))}html[data-theme] body .crm-stat-strip strong{font-size:19px}}

/* 18. owner chips */
html[data-theme] body .crm-owner-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}
html[data-theme] body .crm-owner-chips a{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:3px 14px 3px 3px;border:1px solid var(--line);border-radius:999px;color:var(--ink);font-size:13px;font-weight:500;text-decoration:none;transition:background .15s,border-color .15s}
html[data-theme] body .crm-owner-chips a:first-child{padding-left:14px}
html[data-theme] body .crm-owner-chips a:hover{background:var(--soft)}
html[data-theme] body .crm-owner-chips a.is-on{background:var(--ink);border-color:var(--ink);color:var(--canvas)}
html[data-theme] body .crm-owner-chips i{width:30px;height:30px;font-size:11px}
/* 16/17. columns and cards */
html[data-theme] body .lead-kanban{scroll-snap-type:x mandatory;scroll-padding-left:2px}
html[data-theme] body .lead-kanban-column{scroll-snap-align:start}
html[data-theme] body .lead-kanban-head{display:flex;align-items:flex-start}
html[data-theme] body .lead-kanban-head>div{flex:1}
html[data-theme] body .crm-col-add{display:grid;place-items:center;flex:none;width:36px;height:36px;margin:-3px 0 0 6px;border:1px dashed var(--strong);border-radius:50%;background:transparent;color:var(--ink);font-size:18px;line-height:1;cursor:pointer;transition:background .15s,border-color .15s}
html[data-theme] body .crm-col-add:hover{background:var(--soft);border-style:solid}
html[data-theme] body .crm-lead-card{--stage:var(--muted);position:relative;border-top:0!important;overflow:visible}
html[data-theme] body .crm-lead-card::before{content:"";position:absolute;left:14px;right:14px;top:0;height:3px;border-radius:0 0 3px 3px;background:var(--stage)}
html[data-theme] body .crm-lead-card.crm-stage-new{--stage:var(--yellow)}
html[data-theme] body .crm-lead-card.crm-stage-contacted{--stage:#8eaa93}
html[data-theme] body .crm-lead-card.crm-stage-qualified{--stage:#3f8a76}
html[data-theme] body .crm-lead-card.crm-stage-quoted{--stage:var(--accent)}
html[data-theme] body .crm-lead-card.crm-stage-won{--stage:var(--success)}
html[data-theme] body .crm-lead-card.crm-stage-lost{--stage:#7d7772}
html[data-theme] body .crm-lead-card .lead-kanban-foot{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px 10px}
html[data-theme] body .crm-lead-card .lead-kanban-foot>strong{font-size:17px}
html[data-theme] body .crm-lead-card .v16-next-followup{grid-column:1/-1;font-size:12px;color:var(--muted)}
html[data-theme] body .crm-lead-card .v16-next-followup.is-overdue{color:var(--danger)}
html[data-theme] body .crm-assignee{grid-row:1;grid-column:2}
html[data-theme] body .crm-assignee i{width:30px;height:30px;font-size:11px}
html[data-theme] body .crm-card-actions{display:flex;align-items:center;gap:6px;margin-top:14px!important;padding-top:12px!important;border-top:1px solid var(--line)}
html[data-theme] body .crm-step,html[data-theme] body .crm-card-menu>summary{display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--line);border-radius:12px;background:transparent;color:var(--ink);font-size:18px;line-height:1;cursor:pointer;list-style:none;transition:background .15s}
html[data-theme] body .crm-card-menu>summary::-webkit-details-marker{display:none}
html[data-theme] body .crm-step:hover:not(:disabled),html[data-theme] body .crm-card-menu>summary:hover{background:var(--soft)}
html[data-theme] body .crm-step:disabled{opacity:.35;cursor:default}
html[data-theme] body .crm-card-menu{position:relative;margin-left:auto}
html[data-theme] body .crm-card-menu-list{position:absolute;right:0;bottom:calc(100% + 6px);z-index:30;display:grid;min-width:170px;padding:6px;border:1px solid var(--strong);border-radius:14px;background:var(--surface);box-shadow:0 18px 40px #0005}
html[data-theme] body .crm-card-menu-list button{display:block;width:100%;min-height:38px;padding:8px 12px;border:0;border-radius:9px;background:transparent;color:var(--ink);font:inherit;font-size:13px;text-align:left;cursor:pointer}
html[data-theme] body .crm-card-menu-list button:hover{background:var(--soft)}
html[data-theme] body .crm-native-move[hidden]{display:none!important}
@media (prefers-reduced-motion:no-preference){html[data-theme]:not([data-motion=reduced]) body details.crm-card-menu[open] .crm-card-menu-list{animation:crm-pop .16s cubic-bezier(.2,.8,.3,1);transform-origin:bottom right}}
/* 18. Won / Lost drop areas */
html[data-theme] body .crm-dropzones{position:fixed;left:50%;bottom:20px;z-index:2400;display:grid;grid-template-columns:repeat(2,minmax(0,220px));gap:14px;transform:translateX(-50%);opacity:0;translate:0 20px;transition:opacity .2s,translate .25s cubic-bezier(.2,.8,.25,1)}
html[data-theme] body .crm-dropzones.is-on{opacity:1;translate:0 0}
html[data-theme] body .crm-dropzones>div{display:grid;gap:2px;place-items:center;min-height:84px;padding:12px;border:2px dashed var(--strong);border-radius:20px;background:var(--surface);box-shadow:0 18px 50px #0006;text-align:center;transition:transform .15s,background .15s,border-color .15s}
html[data-theme] body .crm-dropzones strong{font-size:16px}
html[data-theme] body .crm-dropzones span{font-size:12px;color:var(--muted)}
html[data-theme] body .crm-dropzones [data-crm-drop=won].is-over{border-style:solid;border-color:var(--success);background:color-mix(in srgb,var(--success) 18%,var(--surface));transform:scale(1.04)}
html[data-theme] body .crm-dropzones [data-crm-drop=lost].is-over{border-style:solid;border-color:var(--danger);background:color-mix(in srgb,var(--danger) 14%,var(--surface));transform:scale(1.04)}
/* 19. lead panel */
html[data-theme] body .crm-close-actions{display:flex;flex-wrap:wrap;gap:8px;margin:-4px 0 18px}

/* ---------- Customers ---------- */
html[data-theme] body .crm-cust-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin:0 0 18px}
html[data-theme] body .crm-cust-bar :is(.px-segments,.view-toggle){margin:0}
html[data-theme] body .crm-cust-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:16px;margin-bottom:18px}
html[data-theme] body .crm-cust-card{display:grid;gap:14px;align-content:start;margin:0;padding:18px;transition:transform .18s,box-shadow .18s}
html[data-theme] body .crm-cust-card:hover{transform:translateY(-2px)}
html[data-theme] body .crm-cust-top{display:flex;align-items:center;gap:12px;min-width:0}
html[data-theme] body .crm-cust-top .crm-avatar{width:46px;height:46px;font-size:15px}
html[data-theme] body .crm-cust-name{flex:1;min-width:0;display:grid}
html[data-theme] body .crm-cust-name a{color:var(--ink);text-decoration:none}
html[data-theme] body .crm-cust-name strong{font-size:15px;font-weight:600;overflow-wrap:anywhere}
html[data-theme] body .crm-cust-name small{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[data-theme] body .crm-cust-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px;margin:0;padding:12px 0;border-block:1px solid var(--line)}
html[data-theme] body .crm-cust-meta div{min-width:0}
html[data-theme] body .crm-cust-meta dt{font-size:12px;color:var(--muted)}
html[data-theme] body .crm-cust-meta dd{margin:2px 0 0;font-size:13px;font-weight:600;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
html[data-theme] body .crm-cust-meta dd small{font-weight:500;color:var(--muted)}
html[data-theme] body .crm-cust-meta dd.crm-quiet{color:var(--muted);font-weight:500}
html[data-theme] body .crm-cust-foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px}
html[data-theme] body .crm-owner{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);min-width:0}
html[data-theme] body .crm-owner i{width:26px;height:26px;font-size:10px}
html[data-theme] body .crm-cust-actions{display:flex;gap:6px}
/* ---------- Customer 360 ---------- */
html[data-theme] body .crm-avatar-wrap{position:relative;display:grid;place-items:center;flex:none;width:84px;height:84px}
html[data-theme] body .crm-avatar-wrap .cp-avatar{border-radius:50%}
html[data-theme] body .crm-avatar-wrap:has(.crm-score-ring) .cp-avatar .ux-ring{display:none}
html[data-theme] body .crm-score-ring{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
html[data-theme] body .crm-score-ring circle{fill:none;stroke-width:6;stroke-linecap:round}
html[data-theme] body .crm-score-ring .t{stroke:var(--soft)}
html[data-theme] body .crm-score-ring.crm-tone-good .f{stroke:var(--success)}
html[data-theme] body .crm-score-ring.crm-tone-mid .f{stroke:var(--yellow)}
html[data-theme] body .crm-score-ring.crm-tone-low .f{stroke:var(--danger)}
@media (prefers-reduced-motion:no-preference){html[data-theme]:not([data-motion=reduced]) body .crm-score-ring .f{animation:crm-ring 1s cubic-bezier(.2,.8,.25,1)}}
@media (max-width:760px){html[data-theme] body .crm-avatar-wrap{width:64px;height:64px}}
html[data-theme] body .crm-score-info{position:relative;display:inline-block}
html[data-theme] body .crm-score-chip{display:inline-flex;align-items:center;min-height:24px;padding:2px 10px;border-radius:999px;border:1px solid var(--line);font-size:12px;font-weight:600;cursor:pointer;list-style:none;color:var(--ink)}
html[data-theme] body .crm-score-chip::-webkit-details-marker{display:none}
html[data-theme] body .crm-score-chip::before{content:"";width:8px;height:8px;margin-right:7px;border-radius:50%;background:var(--muted)}
html[data-theme] body .crm-score-chip.crm-tone-good::before{background:var(--success)}
html[data-theme] body .crm-score-chip.crm-tone-mid::before{background:var(--yellow)}
html[data-theme] body .crm-score-chip.crm-tone-low::before{background:var(--danger)}
html[data-theme] body .crm-score-pop{position:absolute;left:0;top:calc(100% + 8px);z-index:40;width:min(320px,calc(100vw - 32px));padding:16px;border:1px solid var(--strong);border-radius:16px;background:var(--surface);box-shadow:0 18px 50px #0006}
html[data-theme] body .crm-score-pop ul{list-style:none;margin:10px 0;padding:0;display:grid;gap:8px}
html[data-theme] body .crm-score-pop li{display:flex;justify-content:space-between;gap:12px;font-size:13px}
html[data-theme] body .crm-score-pop li span{display:grid}
html[data-theme] body .crm-score-pop li small,html[data-theme] body .crm-score-pop p{font-size:12px;color:var(--muted);margin:0}
html[data-theme] body .crm-score-pop b{white-space:nowrap;font-variant-numeric:tabular-nums}
html[data-theme] body .crm-cp-subtabs{display:flex;flex-wrap:wrap;gap:6px;margin:-8px 0 22px}
html[data-theme] body .crm-cp-subtabs a{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 14px;border:1px solid var(--line);border-radius:999px;color:var(--muted);font-size:13px;font-weight:600;text-decoration:none}
html[data-theme] body .crm-cp-subtabs a:hover{color:var(--ink);background:var(--soft)}
html[data-theme] body .crm-cp-subtabs a.active{color:var(--ink);border-color:var(--ink)}
html[data-theme] body .crm-cp-subtabs .tab-count{padding:1px 7px;border-radius:999px;background:var(--soft);font-size:11px;color:var(--ink)}
html[data-theme] body .cp-dl dd{display:flex;align-items:center;gap:8px;min-width:0}
html[data-theme] body .cp-dl dd>span{min-width:0;overflow-wrap:anywhere}
html[data-theme] body .crm-copy{display:grid;place-items:center;flex:none;width:36px;height:36px;margin:-4px 0;padding:0;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--muted);cursor:pointer;transition:background .15s,color .15s}
html[data-theme] body .crm-copy svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
html[data-theme] body .crm-copy:hover{background:var(--soft);color:var(--ink)}
html[data-theme] body .crm-copy.is-done{color:var(--success)}

/* ---------- part 15 (18.10.14): user notes ---------- */
/* 1. reminder popup keeps its shape (the change-flash is for small counters only) */
html[data-theme] body .lead-reminder-popup.crm-flash{animation:none}
/* 2. notifications marked as read */
html[data-theme] body .notification-item.is-read strong{font-weight:500}
html[data-theme] body .notification-dot.is-read{visibility:hidden}
/* 3. account button: avatar only, name in a tooltip */
@media (min-width:761px){
  html[data-theme] body .account-trigger{position:relative;display:grid;place-items:center;width:46px;height:46px;max-width:none;padding:0!important;gap:0;border-radius:50%;border:1px solid var(--line);background:var(--soft)}
  html[data-theme] body .account-trigger :is(.account-identity,.profile-chip-arrow){display:none!important}
  html[data-theme] body .account-trigger .avatar{width:38px;height:38px;flex-basis:38px;margin:0}
  html[data-theme] body .account-trigger:hover{border-color:var(--strong)}
  html[data-theme] body .account-menu:not([open]) .account-trigger:is(:hover,:focus-visible)::after{content:attr(data-crm-name);position:absolute;top:calc(100% + 8px);right:0;z-index:3000;padding:7px 12px;border-radius:10px;background:var(--ink);color:var(--canvas);font-size:12px;font-weight:600;white-space:nowrap;box-shadow:0 10px 30px #0004;pointer-events:none}
}
/* 4. clock: the hand never catches the click; the dial is scaled, not zoomed, on short screens */
html[data-theme] body .picker-clock :is(.clock-hand,.clock-center){pointer-events:none}
html[data-theme] body .picker-clock{cursor:pointer}
html[data-theme] body .picker-clock .clock-number{min-width:38px;min-height:38px}
@media (max-height:760px){html[data-theme] body .material-picker .picker-clock{zoom:1;transform:scale(.8);margin:0 auto -12px}}
/* 5. forms in dialogs */
html[data-theme] body dialog.crm-form-modal{width:min(780px,calc(100% - 32px));max-height:92dvh;padding:0;overflow:auto;overscroll-behavior:contain}
html[data-theme] body dialog.crm-form-modal.crm-form-page{width:min(1040px,calc(100% - 32px))}
html[data-theme] body dialog.crm-form-modal>header{position:sticky;top:0;z-index:6;display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0;padding:20px 24px 16px;border-bottom:1px solid var(--line);background:var(--surface)}
html[data-theme] body dialog.crm-form-modal>header h2{margin:2px 0 0;font-size:20px}
html[data-theme] body .crm-form-body{padding:20px 24px 24px}
html[data-theme] body .crm-form-body>.card,html[data-theme] body .crm-form-body>form>.card,html[data-theme] body .crm-form-body .card.studio-form-card{margin:0;padding:0;border:0;background:none;box-shadow:none}
html[data-theme] body .crm-form-body>.card>:is(h2,h3):first-child{display:none}
html[data-theme] body .crm-form-body :is(.form-grid,.grid-2){gap:14px 18px}
html[data-theme] body .crm-form-body :is(button[type=submit],.btn-primary):last-child{margin-top:6px}
html[data-theme] body.crm-form-loading{cursor:progress}
@media (max-width:760px){html[data-theme] body dialog.crm-form-modal,html[data-theme] body dialog.crm-form-modal.crm-form-page{width:100%;max-height:94dvh}html[data-theme] body .crm-form-body{padding:16px}html[data-theme] body dialog.crm-form-modal>header{padding:16px}}
/* 6. side panels */
html[data-theme] body dialog.ex-drawer{width:min(500px,100vw);padding:24px}
html[data-theme] body dialog.ex-drawer>header{position:sticky;top:-24px;z-index:6;margin:-24px -24px 18px;padding:20px 24px 16px;background:var(--surface);border-bottom:1px solid var(--line);align-items:flex-start}
html[data-theme] body .crm-dh{display:flex;align-items:center;gap:14px;flex:1;min-width:0}
html[data-theme] body .crm-dh>div{min-width:0}
html[data-theme] body .crm-dh h2{margin:2px 0 4px;font-size:21px;line-height:1.2;overflow-wrap:anywhere}
html[data-theme] body .crm-dh-avatar{position:relative;display:grid;place-items:center;flex:none;width:58px;height:58px;border-radius:50%;background:hsl(var(--h,150) 38% 32%);color:#fff;font-size:18px;font-weight:700}
html[data-theme] body .crm-dh-ring{position:absolute;inset:-7px;width:calc(100% + 14px);height:calc(100% + 14px);pointer-events:none}
html[data-theme] body .crm-dh-ring circle{fill:none;stroke-width:5;stroke-linecap:round}
html[data-theme] body .crm-dh-ring .t{stroke:var(--soft)}
html[data-theme] body .crm-dh-ring.crm-tone-good .f{stroke:var(--success)}
html[data-theme] body .crm-dh-ring.crm-tone-mid .f{stroke:var(--yellow)}
html[data-theme] body .crm-dh-ring.crm-tone-low .f{stroke:var(--danger)}
html[data-theme] body .crm-dh-sub{font-size:13px;color:var(--muted);overflow-wrap:anywhere}
html[data-theme] body .crm-dh-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
html[data-theme] body .crm-chip{display:inline-flex;align-items:center;gap:6px;min-height:24px;padding:2px 10px;border:1px solid var(--line);border-radius:999px;font-size:12px;font-weight:600;color:var(--ink)}
html[data-theme] body .crm-chip.crm-tone-good::before,html[data-theme] body .crm-chip.crm-tone-mid::before,html[data-theme] body .crm-chip.crm-tone-low::before{content:"";width:8px;height:8px;border-radius:50%}
html[data-theme] body .crm-chip.crm-tone-good::before{background:var(--success)}
html[data-theme] body .crm-chip.crm-tone-mid::before{background:var(--yellow)}
html[data-theme] body .crm-chip.crm-tone-low::before{background:var(--danger)}
html[data-theme] body .crm-chip.is-bad{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 50%,transparent)}
html[data-theme] body .crm-chip.crm-stage-chip::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--muted)}
html[data-theme] body .crm-chip.crm-stage-new::before{background:var(--yellow)}
html[data-theme] body .crm-chip.crm-stage-contacted::before{background:#8eaa93}
html[data-theme] body .crm-chip.crm-stage-qualified::before{background:#3f8a76}
html[data-theme] body .crm-chip.crm-stage-quoted::before{background:var(--accent)}
html[data-theme] body .crm-chip.crm-stage-won::before{background:var(--success)}
html[data-theme] body .crm-dh-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}
html[data-theme] body .crm-dh-actions .btn{min-height:38px}
html[data-theme] body .crm-dh-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:10px;margin:0 0 12px}
html[data-theme] body .crm-dh-kpis>div,html[data-theme] body .crm-dh-facts>div{display:grid;gap:2px;align-content:start;min-width:0;padding:12px 14px;border:1px solid var(--line);border-radius:16px;background:color-mix(in srgb,var(--soft) 55%,transparent)}
html[data-theme] body :is(.crm-dh-kpis,.crm-dh-facts) small{font-size:12px;color:var(--muted)}
html[data-theme] body :is(.crm-dh-kpis,.crm-dh-facts) strong{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
html[data-theme] body .crm-dh-facts span{font-size:12px;color:var(--muted)}
html[data-theme] body .crm-dh-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:0 0 18px}
html[data-theme] body .crm-drawer-foot{position:sticky;bottom:-24px;z-index:6;display:flex;gap:10px;margin:22px -24px -24px;padding:14px 24px calc(14px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--surface)}
html[data-theme] body .crm-drawer-foot .btn{flex:1;min-height:44px}
@media (max-width:760px){html[data-theme] body dialog.ex-drawer{padding:18px}html[data-theme] body dialog.ex-drawer>header{top:-18px;margin:-18px -18px 16px;padding:16px 18px 14px}html[data-theme] body .crm-drawer-foot{bottom:-18px;margin:20px -18px -18px;padding:12px 18px calc(12px + env(safe-area-inset-bottom))}html[data-theme] body .crm-dh-avatar{width:48px;height:48px;font-size:15px}}
/* 7. row menus */
html[data-theme] body .crm-row-menu{position:relative;display:inline-block;vertical-align:middle}
html[data-theme] body .crm-row-menu>summary{display:grid;place-items:center;width:36px;height:36px;border:1px solid var(--line);border-radius:12px;color:var(--ink);font-size:18px;line-height:1;cursor:pointer;list-style:none}
html[data-theme] body .crm-row-menu>summary::-webkit-details-marker{display:none}
html[data-theme] body .crm-row-menu>summary:hover{background:var(--soft)}
html[data-theme] body .crm-row-menu-list{position:absolute;right:0;top:calc(100% + 6px);z-index:60;display:grid;min-width:170px;padding:6px;border:1px solid var(--strong);border-radius:14px;background:var(--surface);box-shadow:0 18px 40px #0005}
html[data-theme] body :is(.crm-row-menu-list,.crm-card-menu-list) button{display:block;width:100%;min-height:38px;padding:8px 12px;border:0;border-radius:9px;background:transparent;color:var(--ink);font:inherit;font-size:13px;text-align:left;cursor:pointer}
html[data-theme] body :is(.crm-row-menu-list,.crm-card-menu-list) button:hover{background:var(--soft)}
html[data-theme] body :is(.crm-row-menu-list,.crm-card-menu-list) button.is-danger{color:var(--danger)}
html[data-theme] body td.crm-menu-cell,html[data-theme] body th.crm-menu-cell{width:52px;text-align:right}
html[data-theme] body .crm-removing{opacity:0;transform:translateX(12px);transition:opacity .25s,transform .25s}
html[data-theme] body :is(.actions,.crm-cust-actions,.followup-row-actions) .crm-row-menu{margin-left:2px}
/* 5b. long page forms (booking, invoice, payment, voucher, customer) run inside the dialog with all their tools */
html[data-theme] body dialog.crm-form-frame{width:min(1100px,calc(100% - 32px));height:min(90dvh,980px);max-height:none;display:none;overflow:hidden}
html[data-theme] body dialog.crm-form-frame[open]{display:flex;flex-direction:column}
html[data-theme] body dialog.crm-form-frame>header{position:static;flex:none}
html[data-theme] body dialog.crm-form-frame .crm-form-body{position:relative;flex:1;min-height:0;padding:0}
html[data-theme] body .crm-form-iframe{display:block;width:100%;height:100%;border:0;background:transparent;opacity:0;transition:opacity .2s}
html[data-theme] body .crm-form-body.is-ready .crm-form-iframe{opacity:1}
html[data-theme] body .crm-frame-loading{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted);font-size:14px}
html[data-theme] body .crm-form-body.is-ready .crm-frame-loading{display:none}
@media (max-width:760px){html[data-theme] body dialog.crm-form-frame{width:100%;height:92dvh}}
html.crm-embed body{background:var(--surface)!important;background-image:none!important}
html.crm-embed :is(.sidebar,.sidebar-backdrop,.topbar,.lead-reminder-popup,.approval-mini-toast,.crm-nav-tip,.r18-breadcrumb,.wl-license-banner){display:none!important}
html.crm-embed .main{margin:0!important;padding:0!important;min-height:0}
html.crm-embed .content{padding:18px 24px 40px!important;max-width:none!important;margin:0!important}
html.crm-embed #main-content :is(.page-hero,.title-row,.feature-hero):has(h1),html.crm-embed #main-content>:is(.simple-module-nav,.wl-company-line){display:none}
html.crm-embed :is(.ex-toast,.crm-toast,.ws-toast,.px-toast){bottom:16px}
@media (max-width:760px){html.crm-embed .content{padding:12px 14px 32px!important}}
html[data-theme] body .crm-row-menu.crm-menu-inline{float:right;margin:0 0 4px 10px}

/* ---------- part 16 (18.10.15): tables, filters, booking activity, calendar, charts ---------- */
/* 23a. sticky header rows */
html[data-theme] body .crm-sticky-wrap{overflow:visible!important}
html[data-theme] body table.crm-sticky-head tr.crm-sticky-row>th{position:sticky;top:0;z-index:4;background:var(--surface);box-shadow:0 1px 0 var(--line)}
/* 23c. filter chips */
html[data-theme] body .crm-filter-chips{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:-6px 0 18px}
html[data-theme] body .crm-filter-label{font-size:12px;color:var(--muted);margin-right:2px}
html[data-theme] body .crm-filter-chip{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:4px 8px 4px 12px;border:1px solid var(--strong);border-radius:999px;background:color-mix(in srgb,var(--soft) 60%,transparent);color:var(--ink);font-size:12px;text-decoration:none}
html[data-theme] body .crm-filter-chip span{color:var(--muted)}
html[data-theme] body .crm-filter-chip b{font-weight:600}
html[data-theme] body .crm-filter-chip i{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--soft);font-style:normal;font-size:13px;line-height:1}
html[data-theme] body .crm-filter-chip:hover{border-color:var(--ink)}
html[data-theme] body .crm-filter-chip:hover i{background:var(--ink);color:var(--canvas)}
html[data-theme] body .crm-filter-clear{font-size:12px;color:var(--muted);text-decoration:underline;text-underline-offset:2px;padding:6px 4px}
/* 23d. row hover actions */
html[data-theme] body td.crm-hover-cell{position:relative}
html[data-theme] body .crm-row-hover{position:absolute;right:6px;top:50%;z-index:3;display:flex;gap:6px;padding:4px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:0 8px 24px #0004;opacity:0;pointer-events:none;transform:translate(6px,-50%);transition:opacity .15s,transform .15s}
html[data-theme] body tr:is(:hover,:focus-within)>td>.crm-row-hover,html[data-theme] body .crm-row-hover:has(details[open]){opacity:1;pointer-events:auto;transform:translate(0,-50%)}
html[data-theme] body .crm-hover-btn{display:grid;place-items:center;width:36px;height:36px;padding:0;border:0;border-radius:9px;background:transparent;color:var(--ink);cursor:pointer}
html[data-theme] body .crm-hover-btn:hover{background:var(--soft)}
html[data-theme] body .crm-hover-btn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
@media (max-width:1024px){html[data-theme] body .crm-row-hover{display:none}}
/* 24. booking activity timeline */
html[data-theme] body .crm-timeline{list-style:none;margin:6px 0 0;padding:0;position:relative}
html[data-theme] body .crm-timeline::before{content:"";position:absolute;left:17px;top:8px;bottom:8px;width:2px;background:var(--line)}
html[data-theme] body .crm-tl{position:relative;display:flex;gap:14px;padding:10px 0}
html[data-theme] body .crm-tl-dot{position:relative;z-index:1;display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:50%;border:1px solid var(--line);background:var(--surface);color:var(--muted);font-size:15px;font-weight:700}
html[data-theme] body .crm-tl-payment .crm-tl-dot{background:var(--success);border-color:var(--success);color:#10201a}
html[data-theme] body .crm-tl-invoice .crm-tl-dot{border-color:var(--accent);color:var(--accent)}
html[data-theme] body .crm-tl-ticket .crm-tl-dot{border-color:var(--yellow);color:var(--ink)}
html[data-theme] body .crm-tl-void .crm-tl-dot{border-color:var(--danger);color:var(--danger)}
html[data-theme] body .crm-tl-upcoming .crm-tl-dot{background:var(--ink);border-color:var(--ink);color:var(--canvas)}
html[data-theme] body .crm-tl-body{display:grid;gap:2px;min-width:0;padding-top:2px}
html[data-theme] body .crm-tl-body strong{font-size:14px;font-weight:600;overflow-wrap:anywhere}
html[data-theme] body .crm-tl-body strong a{color:var(--ink);text-decoration:underline;text-underline-offset:2px}
html[data-theme] body .crm-tl-body span{font-size:13px;color:var(--ink);opacity:.85;overflow-wrap:anywhere}
html[data-theme] body .crm-tl-body small{font-size:12px;color:var(--muted)}
/* 25a. calendar legend and day popover */
html[data-theme] body .crm-cal-legend{display:flex;flex-wrap:wrap;gap:8px;margin:-4px 0 18px}
html[data-theme] body .crm-cal-kind{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:4px 14px;border:1px solid var(--line);border-radius:999px;background:transparent;color:var(--ink);font:inherit;font-size:13px;cursor:pointer}
html[data-theme] body .crm-cal-kind i{width:10px;height:10px;border-radius:50%;background:var(--k)}
html[data-theme] body .crm-cal-kind b{font-weight:600;color:var(--muted)}
html[data-theme] body .crm-cal-kind[aria-pressed=false]{opacity:.55;text-decoration:line-through}
html[data-theme] body .crm-cal-kind:hover{background:var(--soft)}
html[data-theme] body .ux-cal-legend.crm-legend-moved{display:none}
html[data-theme] body [data-ux-calendar].crm-hide-followup [data-kind=followup],html[data-theme] body [data-ux-calendar].crm-hide-task [data-kind=task],html[data-theme] body [data-ux-calendar].crm-hide-booking [data-kind=booking],html[data-theme] body [data-ux-calendar].crm-hide-meeting [data-kind=meeting],html[data-theme] body [data-ux-calendar].crm-hide-visa [data-kind=visa],html[data-theme] body [data-ux-calendar].crm-hide-document [data-kind=document]{display:none!important}
html[data-theme] body .ux-cal-more.crm-more-pill{display:inline-block;align-self:flex-start;width:auto;margin-top:2px;padding:1px 8px;border:1px solid var(--line);border-radius:999px;font-size:11px;font-weight:600;color:var(--ink)}
html[data-theme] body .crm-day-pop{position:fixed;z-index:2600;display:grid;gap:6px;width:min(300px,calc(100vw - 16px));padding:14px;border:1px solid var(--strong);border-radius:16px;background:var(--surface);box-shadow:0 18px 50px #0006;opacity:0;pointer-events:none;transition:opacity .12s}
html[data-theme] body .crm-day-pop.is-on{opacity:1}
html[data-theme] body .crm-day-pop strong{font-size:13px}
html[data-theme] body .crm-day-row{display:flex;align-items:flex-start;gap:8px;font-size:12px;line-height:1.4;color:var(--ink)}
html[data-theme] body .crm-day-row i{flex:none;width:8px;height:8px;margin-top:4px;border-radius:50%;background:var(--k)}
html[data-theme] body .crm-day-pop small{font-size:11px;color:var(--muted)}
/* 25b. chart hover: guide line, dots and a clearer value card */
html[data-theme] body .crm-chart-guide{opacity:0;pointer-events:none;transition:opacity .12s}
html[data-theme] body .crm-chart-guide.on{opacity:1}
html[data-theme] body .crm-chart-guide .crm-guide-line{stroke:var(--strong);stroke-width:1;stroke-dasharray:3 3}
html[data-theme] body .crm-chart-guide .crm-guide-dot{stroke:var(--surface);stroke-width:2.5}
html[data-theme] body .crm-chart-tooltip{display:grid;gap:4px;min-width:170px;padding:10px 12px;border:1px solid var(--strong);border-radius:12px;background:var(--surface);color:var(--ink);box-shadow:0 14px 40px #0005;font-size:12px}
html[data-theme] body .crm-chart-tooltip[hidden]{display:none}
html[data-theme] body .crm-chart-tooltip>strong{font-size:12px;margin-bottom:2px}
html[data-theme] body .crm-tip-row{display:grid;grid-template-columns:10px minmax(0,1fr) auto;align-items:center;gap:8px}
html[data-theme] body .crm-tip-row i{width:10px;height:10px;border-radius:3px}
html[data-theme] body .crm-tip-row span{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[data-theme] body .crm-tip-row b{font-variant-numeric:tabular-nums}
html[data-theme] body .crm-chart-tooltip small{color:var(--muted)}
html[data-theme] body .crm-row-hover .crm-row-menu>summary{width:36px;height:36px;border:0;border-radius:9px}
html[data-theme] body .ux-day:is(.is-today,[aria-pressed=true]) .ux-cal-more.crm-more-pill{color:#fff;border-color:#ffffff73}

/* 18.10.17: announcements from the provider, update / what's new cards */
.crm-announcements{display:grid;gap:12px;margin:0 0 22px}
.crm-announce{display:flex;gap:14px;align-items:flex-start;padding:16px 18px;border-radius:22px;border:1px solid var(--line);background:color-mix(in srgb,var(--surface) 92%,transparent)}
.crm-announce>div{flex:1;min-width:0}
.crm-announce strong{display:block;font-size:15px;margin:4px 0 2px}
.crm-announce p{margin:4px 0 0;font-size:14px;line-height:1.55;overflow-wrap:anywhere}
.crm-announce .crm-announce-meta{color:var(--muted);font-size:13px}
.crm-announce-tag{display:inline-block;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.crm-announce-maintenance{border-color:color-mix(in srgb,var(--danger) 45%,transparent);background:color-mix(in srgb,var(--danger) 10%,var(--surface))}
.crm-announce-warning{border-color:color-mix(in srgb,var(--warning) 45%,transparent);background:color-mix(in srgb,var(--warning) 10%,var(--surface))}
.crm-announce-update{border-color:color-mix(in srgb,var(--accent) 40%,transparent)}
.crm-announce-new{border-color:color-mix(in srgb,var(--success) 40%,transparent)}
.crm-announce-x{width:34px;height:34px;flex:0 0 auto;border-radius:50%;border:1px solid var(--strong);background:transparent;color:var(--ink);font-size:18px;line-height:1;cursor:pointer}
.crm-announce-x:hover{background:var(--soft)}
.crm-announce[hidden]{display:none}
.crm-announce a{text-decoration:underline;color:inherit;font-weight:500}
.crm-portal-link{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:10px 0}

/* 18.10.18 */
.crm-announce-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:10px 0 0}
.crm-announce-trial{border-color:color-mix(in srgb,var(--info,#1f5d86) 40%,transparent)}
