/* =========================================================
   TRV V41 — Stability pass
   Charts · guide · scroll · theme · overlay layering
   ========================================================= */
:root{
  --v41-bg:#071019;
  --v41-surface:#0c141d;
  --v41-surface-2:#101a24;
  --v41-border:rgba(255,255,255,.10);
  --v41-text:#f7f9fb;
  --v41-muted:#93a0ad;
}

/* One scroll owner. This prevents modules from becoming "stuck" after overlays. */
html,body{height:100%;overflow:hidden!important}
body{min-height:100dvh!important}
.app{height:100dvh!important;min-height:0!important;overflow:hidden!important}
.workspace{height:100dvh!important;min-height:0!important;display:grid!important;grid-template-rows:auto minmax(0,1fr)!important;overflow:hidden!important}
.main{min-height:0!important;height:100%!important;max-height:100%!important;min-block-size:0!important;max-block-size:100%!important;align-self:stretch!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior-y:contain!important;-webkit-overflow-scrolling:touch!important;scrollbar-gutter:stable}
.sidebar{height:100dvh!important;min-height:0!important;overflow:hidden!important}
.sidebar .nav{min-height:0!important;overflow-y:auto!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important}
body.guide-open,body.record-entry-open,body.assistant-open{overflow:hidden!important}

/* Theme button */
.theme-toggle{width:44px!important;height:44px!important;padding:0!important;display:grid!important;place-items:center!important;border:1px solid var(--glass-line,rgba(255,255,255,.15))!important;border-radius:14px!important;background:linear-gradient(180deg,rgba(255,255,255,.09),rgba(255,255,255,.025))!important;color:var(--text)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.09)!important;backdrop-filter:blur(18px) saturate(130%)!important;-webkit-backdrop-filter:blur(18px) saturate(130%)!important;font-size:17px!important}
.theme-toggle:hover{transform:translateY(-1px)}

/* ===== Executive chart: no more paths escaping the panel ===== */
.exec40-trend{overflow:hidden!important}
.exec40-chart{
  height:330px!important;
  min-height:330px!important;
  padding:18px 18px 8px!important;
  display:grid!important;
  grid-template-columns:46px minmax(0,1fr)!important;
  grid-template-rows:minmax(0,1fr) 28px!important;
  gap:0 8px!important;
  overflow:hidden!important;
  isolation:isolate;
}
.exec40-chart .v20-ylabels{grid-column:1!important;grid-row:1!important;display:flex!important;flex-direction:column!important;justify-content:space-between!important;align-items:flex-end!important;padding:4px 2px 5px 0!important;color:#758391!important;font-size:8px!important;line-height:1!important}
.exec40-chart svg{grid-column:2!important;grid-row:1!important;width:100%!important;height:100%!important;min-height:0!important;display:block!important;overflow:hidden!important;clip-path:inset(0)!important}
.exec40-chart .v20-xlabels{grid-column:2!important;grid-row:2!important;display:flex!important;justify-content:space-between!important;align-items:center!important;padding:6px 0 0!important;color:#758391!important;font-size:8px!important;line-height:1!important;white-space:nowrap!important}
.exec40-chart .grid path{stroke:rgba(255,255,255,.075)!important;vector-effect:non-scaling-stroke}
.exec40-chart .l{stroke-width:2.5!important;vector-effect:non-scaling-stroke!important;stroke-linecap:round!important;stroke-linejoin:round!important}
.exec40-trend>footer{position:relative!important;z-index:2!important;min-height:48px!important;flex-wrap:wrap!important;background:var(--v41-surface)!important}
.exec40-trend>footer button{margin-left:auto!important;min-width:250px!important;justify-content:flex-end!important}
/* All legacy SVG charts stay clipped to their cards. */
.v20-trend-panel,.v20-chart,.chart-card,.trend-chart{overflow:hidden!important}
.v20-chart svg,.chart-card svg,.trend-chart svg{overflow:hidden!important;display:block!important;max-width:100%!important}

/* ===== Overlay stacking ===== */
.leaflet-container{z-index:1!important}
.leaflet-pane{z-index:2!important}
.leaflet-control-container{z-index:20!important}
.floating-assist-stack{z-index:3600!important}
#assistant.assistant{z-index:6800!important}
body.assistant-open::before{z-index:6700!important}
.record-entry-layer{z-index:5200!important}
body.guide-open .guide-shade{z-index:7200!important}
body.guide-open .guide-focus{z-index:7250!important}
body.guide-open .guide-card{z-index:7300!important}

/* Help and Assistant remain usable while a record form is open. */
body.record-entry-open .floating-assist-stack{
  opacity:1!important;pointer-events:auto!important;
  right:26px!important;bottom:auto!important;top:118px!important;
  z-index:6400!important;
}
body.record-entry-open .floating-assist-stack button{box-shadow:0 14px 34px rgba(0,0,0,.30)!important}
body.assistant-open .floating-assist-stack{opacity:0!important;pointer-events:none!important}

/* Assistant always occupies a clean safe column and never sits behind maps. */
#assistant.assistant{
  right:22px!important;
  bottom:22px!important;
  width:min(760px,calc(100vw - 44px))!important;
  max-height:calc(100dvh - 44px)!important;
  border-radius:22px!important;
  box-shadow:0 34px 100px rgba(0,0,0,.48)!important;
}
#assistant .assistant-body,#assistant #messages{overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important}

/* ===== Guide rebuilt as a readable assistant, not a giant destructive mask ===== */
.guide-card{
  width:min(420px,calc(100vw - 32px))!important;
  max-height:calc(100dvh - 28px)!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  border-radius:18px!important;
  background:#0b1a27!important;
  border:1px solid rgba(125,173,214,.25)!important;
  box-shadow:0 30px 90px rgba(0,0,0,.52)!important;
}
.guide-card #guideText{max-height:none!important;overflow:visible!important}
.guide-card .guide-example{max-height:30dvh!important;overflow:auto!important;background:rgba(255,255,255,.035)!important;border-radius:12px!important}
.guide-card .guide-actions{position:sticky!important;bottom:0!important;margin-top:14px!important;padding-top:12px!important;background:linear-gradient(180deg,rgba(11,26,39,0),#0b1a27 24%)!important;z-index:4!important}
.guide-card .guide-actions button{min-height:48px!important}
.guide-focus{border-radius:12px!important;border:2px solid rgba(237,43,53,.92)!important;box-shadow:0 0 0 4px rgba(237,43,53,.10)!important}
body.guide-open .guide-shade{background:rgba(2,8,14,.48)!important;-webkit-backdrop-filter:blur(3px)!important;backdrop-filter:blur(3px)!important}

/* Record-specific guide: form and help sit side by side on iPad/desktop. */
body.record-guide-open .record-entry-card{
  width:min(900px,calc(100vw - 490px))!important;
  margin-right:450px!important;
}
body.record-guide-open .guide-card{
  right:18px!important;left:auto!important;top:50%!important;transform:translateY(-50%)!important;width:410px!important;
}
body.record-guide-open .guide-focus{border-radius:8px!important}
.guide-demo-writing{
  border-color:#ff4750!important;
  box-shadow:0 0 0 3px rgba(237,43,53,.17)!important;
  background:linear-gradient(90deg,rgba(237,43,53,.08),transparent),#0b151e!important;
  transition:border-color .18s ease,box-shadow .18s ease!important;
}

/* Record form: balanced layout and reliable independent scrolling. */
.record-entry-card{max-height:calc(100dvh - 32px)!important}
.record-entry-card .record-capture-shell{grid-template-columns:190px minmax(0,1fr) 245px!important;min-height:0!important}
.record-entry-card .record37-form{min-height:0!important;max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;padding:18px 20px 86px!important;scroll-padding-top:16px!important;scroll-behavior:smooth!important}
.record-entry-card .record-step-rail{min-height:0!important;overflow-y:auto!important}
.record37-actions{position:sticky!important;bottom:0!important;left:0!important;right:0!important;background:rgba(7,16,23,.96)!important;-webkit-backdrop-filter:blur(16px)!important;backdrop-filter:blur(16px)!important;border-top:1px solid rgba(255,255,255,.10)!important;box-shadow:0 -16px 32px rgba(0,0,0,.18)!important}
.record-step-panel{scroll-margin-top:16px!important}

/* Prevent hidden overlays from intercepting taps after switching modules. */
.record-entry-layer[hidden],body:not(.guide-open) .guide-card,body:not(.guide-open) .guide-focus,body:not(.guide-open) .guide-shade{pointer-events:none!important}

/* ===== LIGHT MODE ===== */
html[data-theme="light"]{
  --bg:#f3f5f7;--surface:#ffffff;--soft:#f5f7f9;--soft2:#e9edf1;--text:#151a20;--muted:#687480;--line:rgba(20,29,38,.12);--graphite:#46515d;
  --v41-bg:#f3f5f7;--v41-surface:#ffffff;--v41-surface-2:#f7f9fb;--v41-border:rgba(20,29,38,.12);--v41-text:#151a20;--v41-muted:#687480;
}
html[data-theme="light"] body,html[data-theme="light"] .workspace,html[data-theme="light"] .main{background:#f3f5f7!important;color:#151a20!important}
html[data-theme="light"] .sidebar{background:linear-gradient(180deg,#ffffff,#f7f9fb)!important;border-color:rgba(20,29,38,.12)!important}
html[data-theme="light"] .topbar{background:rgba(248,250,252,.90)!important;border-color:rgba(20,29,38,.12)!important}
html[data-theme="light"] .brand-copy strong,html[data-theme="light"] .page-title h1,html[data-theme="light"] .nav-item,html[data-theme="light"] .nav-copy strong{color:#151a20!important}
html[data-theme="light"] .demo-tag,html[data-theme="light"] .nav-code,html[data-theme="light"] .sidebar-shortcuts a{background:#f2f5f7!important;color:#25303b!important;border-color:rgba(20,29,38,.10)!important}
html[data-theme="light"] .nav-item.active{background:linear-gradient(90deg,rgba(237,27,36,.07),#fff 30%)!important;border-color:rgba(20,29,38,.12)!important}
html[data-theme="light"] .top-nav-glass,html[data-theme="light"] .scenario,html[data-theme="light"] .top-actions .button,html[data-theme="light"] .theme-toggle{background:rgba(255,255,255,.78)!important;color:#151a20!important;border-color:rgba(20,29,38,.13)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 8px 20px rgba(29,40,52,.07)!important}
html[data-theme="light"] .module-hero,html[data-theme="light"] .module-intel,html[data-theme="light"] .section,html[data-theme="light"] .panel,html[data-theme="light"] .kpi,html[data-theme="light"] .tool-card,html[data-theme="light"] .exec40-brief,html[data-theme="light"] .exec40-groups>article,html[data-theme="light"] .exec40-map,html[data-theme="light"] .exec40-inbox,html[data-theme="light"] .exec40-semaphore,html[data-theme="light"] .exec40-payables,html[data-theme="light"] .exec40-trend{background:#fff!important;border-color:rgba(20,29,38,.11)!important;color:#151a20!important;box-shadow:0 8px 24px rgba(31,43,55,.045)!important}
html[data-theme="light"] .module-hero h2,html[data-theme="light"] .module-intel strong,html[data-theme="light"] .kpi strong,html[data-theme="light"] .panel h3,html[data-theme="light"] .exec40-brief h2,html[data-theme="light"] .exec40-brief-counts b,html[data-theme="light"] .exec40-groups header b,html[data-theme="light"] .exec40-metric strong,html[data-theme="light"] .exec40-map h3,html[data-theme="light"] .exec40-inbox h3,html[data-theme="light"] .exec40-semaphore h3,html[data-theme="light"] .exec40-payables h3,html[data-theme="light"] .exec40-trend h3,html[data-theme="light"] .exec40-inbox button,html[data-theme="light"] .exec40-light,html[data-theme="light"] .exec40-payables b,html[data-theme="light"] .exec40-payables strong{color:#161c22!important}
html[data-theme="light"] .exec40-brief p,html[data-theme="light"] .exec40-metric small,html[data-theme="light"] .exec40-metric span,html[data-theme="light"] .exec40-map header p,html[data-theme="light"] .exec40-inbox header p,html[data-theme="light"] .exec40-light span small,html[data-theme="light"] .exec40-payables small{color:#697681!important}
html[data-theme="light"] .exec40-brief-counts{border-color:rgba(20,29,38,.10)!important}
html[data-theme="light"] .exec40-metric,html[data-theme="light"] .exec40-light,html[data-theme="light"] .exec40-payables>div>div,html[data-theme="light"] .exec40-inbox button{border-color:rgba(20,29,38,.09)!important}
html[data-theme="light"] .exec40-chart .grid path{stroke:rgba(20,29,38,.10)!important}
html[data-theme="light"] .exec40-trend>footer{background:#fff!important;border-color:rgba(20,29,38,.10)!important;color:#61707d!important}
html[data-theme="light"] .record-entry-backdrop{background:rgba(220,226,232,.72)!important}
html[data-theme="light"] .record-entry-card,html[data-theme="light"] .record-entry-card .record-capture-shell,html[data-theme="light"] .record-entry-card .record37-form{background:#fff!important;color:#151a20!important;border-color:rgba(20,29,38,.13)!important}
html[data-theme="light"] .record-entry-head{background:linear-gradient(90deg,rgba(237,27,36,.05),#fff 45%)!important;border-color:rgba(20,29,38,.10)!important}
html[data-theme="light"] .record-entry-head h3,html[data-theme="light"] .record-step-panel header strong,html[data-theme="light"] .record-field-title,html[data-theme="light"] .record-field-title b,html[data-theme="light"] .record40-summary h4{color:#151a20!important}
html[data-theme="light"] .record-entry-head p,html[data-theme="light"] .record-step-panel header small,html[data-theme="light"] .record40-summary p,html[data-theme="light"] .record40-summary li{color:#6c7884!important}
html[data-theme="light"] .record37-form input:not([type=file]),html[data-theme="light"] .record37-form select,html[data-theme="light"] .record37-form textarea,html[data-theme="light"] .collection-automation input:not([type=file]),html[data-theme="light"] .collection-automation select,html[data-theme="light"] .collection-automation textarea{background:#f8fafb!important;color:#151a20!important;border-color:rgba(20,29,38,.16)!important;caret-color:#151a20!important;color-scheme:light!important}
html[data-theme="light"] .record37-form input::placeholder,html[data-theme="light"] .record37-form textarea::placeholder{color:#87929c!important}
html[data-theme="light"] .record37-actions{background:rgba(255,255,255,.96)!important;border-color:rgba(20,29,38,.11)!important}
html[data-theme="light"] #assistant.assistant{background:#f9fbfd!important;color:#151a20!important;border-color:rgba(20,29,38,.14)!important}
html[data-theme="light"] #assistant .assistant-head,html[data-theme="light"] #assistant .assistant-composer{background:#fff!important;border-color:rgba(20,29,38,.10)!important}
html[data-theme="light"] #assistant .assistant-head h3,html[data-theme="light"] #assistant .message.ai,html[data-theme="light"] #assistant .ai-answer-direct p{color:#151a20!important}
html[data-theme="light"] #assistant .assistant-head p,html[data-theme="light"] #assistant .ai-meta{color:#6c7884!important}
html[data-theme="light"] #assistant .message.ai .ai-wrap,html[data-theme="light"] #assistant .message.ai .ai-thinking{background:#fff!important;border-color:rgba(20,29,38,.11)!important;color:#151a20!important}
html[data-theme="light"] #assistantInput{background:#f4f7f9!important;color:#151a20!important;border-color:rgba(20,29,38,.16)!important;caret-color:#151a20!important}
html[data-theme="light"] .guide-card{background:#fff!important;color:#151a20!important;border-color:rgba(20,29,38,.16)!important}
html[data-theme="light"] .guide-card h3,html[data-theme="light"] .guide-card p{color:#151a20!important}
html[data-theme="light"] .guide-card .guide-example{background:#f4f7f9!important;border-color:rgba(20,29,38,.10)!important}
html[data-theme="light"] .guide-card .guide-actions{background:linear-gradient(180deg,rgba(255,255,255,0),#fff 24%)!important}
html[data-theme="light"] body.guide-open .guide-shade{background:rgba(235,239,243,.62)!important}

@media(max-width:1180px){
  body.record-guide-open .record-entry-card{width:calc(100vw - 36px)!important;margin-right:0!important}
  body.record-guide-open .guide-card{top:auto!important;bottom:14px!important;right:14px!important;left:14px!important;width:auto!important;max-height:46dvh!important;transform:none!important}
  .record-entry-card .record-capture-shell{grid-template-columns:150px minmax(0,1fr)!important}
  .record40-summary{display:none!important}
}
@media(max-width:820px){
  .exec40-chart{height:270px!important;min-height:270px!important;grid-template-columns:38px minmax(0,1fr)!important;padding:14px 10px 6px!important}
  .exec40-trend>footer button{min-width:0!important;width:100%!important;margin-left:0!important;justify-content:space-between!important}
  #assistant.assistant{inset:10px!important;width:auto!important;max-height:none!important;height:calc(100dvh - 20px)!important}
  body.record-entry-open .floating-assist-stack{top:auto!important;bottom:20px!important;right:16px!important}
  .record-entry-card{width:calc(100vw - 18px)!important;max-height:calc(100dvh - 18px)!important}
  .record-entry-card .record-capture-shell{display:block!important}
  .record-step-rail{display:flex!important;overflow-x:auto!important;overflow-y:hidden!important}
  .record-step-button{min-width:150px!important}
}


/* V41.1 — guide footer: no collisions on iPad */
.guide-card .guide-actions{display:grid!important;grid-template-columns:minmax(78px,auto) minmax(0,1fr) auto!important;align-items:center!important;gap:10px!important}
.guide-card .guide-actions>.guide-pick{justify-self:center!important;min-width:0!important;max-width:100%!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;padding-inline:8px!important}
.guide-card .guide-actions>span{justify-self:end!important;display:flex!important;gap:8px!important;min-width:0!important}
.guide-card .guide-actions>span button{min-width:92px!important}
@media(max-width:720px){.guide-card .guide-actions{grid-template-columns:1fr 1fr!important}.guide-card .guide-actions>.guide-pick{grid-column:1/-1!important;grid-row:1!important;justify-self:start!important}.guide-card .guide-actions>span{grid-column:1/-1!important;grid-row:2!important;width:100%!important;justify-content:flex-end!important}.guide-card .guide-actions>#guideClose{grid-row:2!important;grid-column:1!important;justify-self:start!important;z-index:2!important}}


/* =========================================================
   TRV V42 · CONEXA guide + access governance + single conduit
   ========================================================= */
:root{
  --v42-line:color-mix(in srgb,var(--text) 13%,transparent);
  --v42-line-strong:color-mix(in srgb,var(--text) 22%,transparent);
  --v42-surface:color-mix(in srgb,var(--panel,#111820) 94%,#fff 6%);
  --v42-surface-2:color-mix(in srgb,var(--panel,#111820) 88%,#fff 12%);
  --v42-soft:color-mix(in srgb,var(--module-accent,#2d6cdf) 9%,transparent);
}
[data-theme="light"]{
  --v42-line:rgba(14,24,35,.12);
  --v42-line-strong:rgba(14,24,35,.20);
  --v42-surface:#fff;
  --v42-surface-2:#f5f7f9;
  --v42-soft:rgba(240,43,53,.055);
}
.access-user-chip{
  min-width:156px;min-height:48px;padding:6px 10px;border:1px solid var(--v42-line-strong);
  background:linear-gradient(180deg,color-mix(in srgb,var(--v42-surface-2) 82%,transparent),color-mix(in srgb,var(--v42-surface) 70%,transparent));
  color:var(--text);display:flex;align-items:center;gap:9px;border-radius:14px;backdrop-filter:blur(18px) saturate(130%);
  -webkit-backdrop-filter:blur(18px) saturate(130%);box-shadow:inset 0 1px rgba(255,255,255,.06);
}
.access-user-chip:hover{border-color:color-mix(in srgb,var(--module-accent) 45%,var(--v42-line-strong));}
.access-chip-avatar{width:31px;height:31px;border:1px solid color-mix(in srgb,var(--module-accent) 35%,var(--v42-line));background:var(--v42-soft);display:grid;place-items:center;border-radius:8px;color:var(--module-accent);font-size:10px;font-weight:900;letter-spacing:.08em}
.access-user-chip>span:last-child{display:grid;text-align:left;line-height:1.15}
.access-user-chip b{font-size:12px}
.access-user-chip small{font-size:9px;color:var(--muted);max-width:105px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Access control: structured, business-like, no dashboard clutter */
.access42{display:grid;gap:18px;max-width:1500px;margin:0 auto;padding:8px 0 54px}
.access42-head{display:grid;grid-template-columns:minmax(0,1.25fr) auto;gap:28px;border-top:2px solid var(--module-accent);border-bottom:1px solid var(--v42-line);padding:28px 26px;background:linear-gradient(100deg,var(--v42-soft),transparent 42%)}
.access42-head small,.access42-users header small,.access-editor-head small,.access-matrix header small{font-size:10px;font-weight:900;letter-spacing:.18em;color:var(--module-accent)}
.access42-head h2{font-size:clamp(28px,3.2vw,54px);line-height:.98;margin:8px 0 10px;max-width:760px}
.access42-head p{margin:0;color:var(--muted);max-width:800px;line-height:1.55}
.access42-summary{display:grid;grid-template-columns:repeat(3,minmax(110px,1fr));border-left:1px solid var(--v42-line)}
.access42-summary span{min-width:115px;padding:14px 18px;border-right:1px solid var(--v42-line);display:flex;flex-direction:column;justify-content:center}
.access42-summary b{font-size:25px}.access42-summary small{color:var(--muted);margin-top:5px}
.access42-role-strip{display:grid;grid-template-columns:repeat(6,1fr);border:1px solid var(--v42-line);background:var(--v42-surface)}
.access42-role-strip article{padding:17px 16px;min-height:126px;border-right:1px solid var(--v42-line)}
.access42-role-strip article:last-child{border-right:0}
.access42-role-strip small{color:var(--module-accent);font-size:9px;font-weight:900;letter-spacing:.14em;text-transform:uppercase}
.access42-role-strip strong{display:block;margin:9px 0 6px;font-size:14px}
.access42-role-strip p{font-size:11px;color:var(--muted);line-height:1.45;margin:0}
.access42-workspace{display:grid;grid-template-columns:310px minmax(0,1fr);border:1px solid var(--v42-line);min-height:560px;background:var(--v42-surface)}
.access42-users{border-right:1px solid var(--v42-line);padding:18px 0}
.access42-users header{padding:0 18px 14px;display:flex;justify-content:space-between;align-items:flex-end;border-bottom:1px solid var(--v42-line)}
.access42-users h3{margin:4px 0 0;font-size:22px}
.access42-users header button{border:0;background:none;color:var(--module-accent);font-weight:900}
.access42-users>div{display:grid}
.access-user{appearance:none;border:0;border-bottom:1px solid var(--v42-line);background:none;color:var(--text);display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:11px;padding:15px 18px;text-align:left}
.access-user:hover,.access-user.active{background:linear-gradient(90deg,var(--v42-soft),transparent)}
.access-user.active{box-shadow:inset 3px 0 var(--module-accent)}
.access-user-avatar{width:34px;height:34px;display:grid;place-items:center;background:var(--v42-surface-2);border:1px solid var(--v42-line);font-size:10px;font-weight:900}
.access-user>span:nth-child(2){min-width:0;display:grid;gap:3px}.access-user b{font-size:13px}.access-user small{font-size:10px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.access42-editor{min-width:0;padding:24px}
.access-editor-form{display:grid;gap:24px;max-width:1050px}
.access-editor-head{display:flex;justify-content:space-between;gap:20px;border-bottom:1px solid var(--v42-line);padding-bottom:18px}
.access-editor-head h3{font-size:28px;margin:6px 0}.access-editor-head p{color:var(--muted);margin:0;max-width:690px}
.access-role-badge{height:max-content;border:1px solid color-mix(in srgb,var(--module-accent) 35%,var(--v42-line));padding:8px 12px;color:var(--module-accent);font-size:11px;font-weight:900}
.access-person-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.access-person-grid label,.access-row{display:grid;gap:7px}.access-person-grid label>span{font-size:10px;color:var(--muted);font-weight:800;text-transform:uppercase;letter-spacing:.08em}
.access-person-grid input,.access-person-grid select,.access-row select{width:100%;min-height:44px;border:1px solid var(--v42-line-strong);border-radius:5px;background:var(--v42-surface-2);color:var(--text);padding:10px 12px}
.access-matrix{border-top:1px solid var(--v42-line);padding-top:20px}
.access-matrix>header{display:flex;justify-content:space-between;gap:15px;align-items:flex-end;margin-bottom:10px}.access-matrix h4{font-size:21px;margin:4px 0 0}
.access-level-legend{display:flex;gap:11px;color:var(--muted);font-size:9px}
.access-matrix-list{border-top:1px solid var(--v42-line)}
.access-row{grid-template-columns:minmax(0,1fr) 190px;align-items:center;padding:10px 0;border-bottom:1px solid var(--v42-line)}
.access-row>span{display:grid;gap:3px}.access-row b{font-size:12px}.access-row small{color:var(--muted);font-size:9px}
.access-editor-actions{display:flex;justify-content:flex-end;gap:9px;padding-top:5px}
.access-editor-actions button{min-height:44px;padding:0 17px;border:1px solid var(--v42-line-strong);border-radius:5px;background:var(--v42-surface-2);color:var(--text);font-weight:900}
.access-editor-actions button[type=submit]{background:var(--module-accent);border-color:var(--module-accent);color:white}
.access-editor-actions .danger-ghost{color:#ff6971;border-color:rgba(240,43,53,.32);margin-right:auto}
.access-editor-actions button:disabled{opacity:.35}
.access42-production-note{border-left:3px solid #e3a326;background:color-mix(in srgb,#e3a326 7%,transparent);padding:14px 17px;display:grid;gap:3px}
.access42-production-note p{margin:0;color:var(--muted);font-size:11px}
.access42-loading,.access42-denied{padding:50px 30px;border-top:2px solid var(--module-accent);background:var(--v42-surface)}.access42-loading h2,.access42-denied h2{font-size:34px}

/* Single conduct: history outside, one uninterrupted document inside */
.record42{border-radius:0!important;border:1px solid var(--v42-line)!important;background:var(--v42-surface)!important;overflow:hidden}
.record42>header{padding:22px 24px;border-bottom:1px solid var(--v42-line);display:flex;justify-content:space-between;gap:22px;align-items:flex-start}
.record42>header h3{font-size:26px;margin:4px 0}.record42>header p{max-width:840px;color:var(--muted);line-height:1.5}
.record-head-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.record-new,.record-export,.record-head-actions [data-record-refresh]{height:42px;border:1px solid var(--v42-line-strong);border-radius:5px;padding:0 14px;background:var(--v42-surface-2);color:var(--text);display:inline-flex;gap:7px;align-items:center;text-decoration:none;font-weight:900}
.record-new{background:var(--module-accent);border-color:var(--module-accent);color:white}
.module-record-engine{font-size:9px;color:var(--muted)}
.record42-principles{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid var(--v42-line)}
.record42-principles>span{padding:14px 18px;border-right:1px solid var(--v42-line);display:grid;grid-template-columns:auto 1fr;column-gap:9px;align-items:start}
.record42-principles>span:last-child{border-right:0}.record42-principles b{color:var(--module-accent);font-size:10px}.record42-principles strong{font-size:12px}.record42-principles small{grid-column:2;color:var(--muted);font-size:10px;margin-top:2px}
.record42-history{padding:0!important}.record42-history .module-record-history-head{padding:16px 20px;border-bottom:1px solid var(--v42-line)}
.record-entry-layer{position:fixed;inset:0;z-index:15000!important;display:grid;place-items:center;padding:20px;background:rgba(2,7,12,.48);backdrop-filter:blur(13px)}
.record-entry-layer[hidden]{display:none!important}.record-entry-backdrop{position:absolute;inset:0;border:0;background:transparent}
.record42-card{position:relative;width:min(1220px,calc(100vw - 44px));height:min(900px,calc(100dvh - 40px));z-index:1;background:var(--v42-surface);border:1px solid var(--v42-line-strong);border-top:3px solid var(--module-accent);box-shadow:0 30px 90px rgba(0,0,0,.34);display:grid;grid-template-rows:auto minmax(0,1fr);overflow:hidden;border-radius:8px!important}
.record-entry-head{padding:18px 22px;border-bottom:1px solid var(--v42-line);display:flex;justify-content:space-between;gap:22px}.record-entry-head h3{font-size:27px;margin:3px 0 4px}.record-entry-head p{font-size:11px;color:var(--muted);margin:0}
.record-entry-head-actions{display:flex;gap:8px;align-items:flex-start}.record-general-help,.record-entry-close{border:1px solid var(--v42-line-strong);background:var(--v42-surface-2);color:var(--text);min-height:40px;border-radius:5px}.record-general-help{padding:0 13px;display:flex;gap:7px;align-items:center}.record-general-help span{color:var(--module-accent);font-weight:900}.record-entry-close{width:40px;font-size:20px}
.record42-form{overflow:auto!important;min-height:0!important;padding:0!important;display:block!important;scroll-behavior:smooth}
.record42-commandbar{position:sticky;top:0;z-index:6;background:color-mix(in srgb,var(--v42-surface) 94%,transparent);backdrop-filter:blur(13px);display:grid;grid-template-columns:minmax(0,1fr) auto;border-bottom:1px solid var(--v42-line);padding:12px 22px;gap:20px}
.record42-commandbar label{max-width:550px;display:grid;grid-template-columns:auto minmax(180px,1fr);gap:12px;align-items:center}.record42-commandbar label>span,.record42-commandbar>div small{font-size:9px;color:var(--muted);font-weight:800;letter-spacing:.09em;text-transform:uppercase}.record42-commandbar select{min-height:38px;border:1px solid var(--v42-line-strong);background:var(--v42-surface-2);color:var(--text);padding:0 10px;border-radius:4px}.record42-commandbar>div{display:grid;text-align:right}.record42-commandbar strong{font-size:11px;color:var(--module-accent)}
.record42-jumps{position:sticky;top:63px;z-index:5;display:flex;gap:0;overflow:auto;background:var(--v42-surface);border-bottom:1px solid var(--v42-line);padding:0 22px}.record42-jumps button{flex:0 0 auto;border:0;border-right:1px solid var(--v42-line);background:transparent;color:var(--muted);padding:10px 13px;font-size:10px;font-weight:800}.record42-jumps button:first-child{border-left:1px solid var(--v42-line)}.record42-jumps button:hover{color:var(--text);background:var(--v42-soft)}.record42-jumps span{color:var(--module-accent);margin-right:6px;font-size:9px}
.record-form-top{display:grid!important;grid-template-columns:1fr 2fr!important;gap:14px!important;padding:20px 22px!important;border-bottom:1px solid var(--v42-line);background:linear-gradient(90deg,var(--v42-soft),transparent 40%)}
.record42-flow{display:block!important;padding:0 22px 90px!important}
.record-flow-section{display:block!important;padding:22px 0 26px!important;border-bottom:1px solid var(--v42-line)!important;background:transparent!important;opacity:1!important;visibility:visible!important}
.record-flow-section>header{margin-bottom:17px!important;padding:0!important}.record-flow-section>header>div{display:flex;gap:11px;align-items:start}.record-flow-section>header>div>span{width:28px;height:28px;border-left:2px solid var(--module-accent);display:grid;place-items:center;color:var(--module-accent);font-size:9px;font-weight:900;background:var(--v42-soft)}
.record-flow-section header strong{font-size:18px}.record-flow-section header small{display:block;color:var(--muted);font-size:10px;margin-top:3px}
.record-section-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:13px!important}
.record-field{display:grid!important;gap:7px!important;align-content:start!important}.record-field.wide,.record-files.wide{grid-column:1/-1}.record-field-title{display:flex;justify-content:space-between;align-items:center}.record-field-title b,.record-files>span{font-size:10px!important;letter-spacing:.02em!important;color:var(--text)!important}.record-field input,.record-field select,.record-field textarea,.record-files input{width:100%!important;min-height:46px!important;border:1px solid var(--v42-line-strong)!important;border-radius:5px!important;background:var(--v42-surface-2)!important;color:var(--text)!important;padding:11px 12px!important;box-shadow:none!important;pointer-events:auto!important;position:relative!important;z-index:1!important}
.record-field textarea{min-height:92px!important;resize:vertical}.record-field input:focus,.record-field select:focus,.record-field textarea:focus{outline:2px solid color-mix(in srgb,var(--module-accent) 45%,transparent)!important;outline-offset:1px!important;border-color:var(--module-accent)!important}
.record-files{border:1px dashed var(--v42-line-strong);padding:14px;display:grid;gap:8px}.record-files small{font-size:9px;color:var(--muted)}
.record42-savebar{position:sticky!important;bottom:0!important;z-index:8!important;background:color-mix(in srgb,var(--v42-surface) 95%,transparent)!important;backdrop-filter:blur(15px);border-top:1px solid var(--v42-line)!important;padding:12px 18px!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:9px!important}.record42-savebar>div{margin-right:auto;display:grid}.record42-savebar>div span{font-size:10px;font-weight:900}.record42-savebar>div small{font-size:9px;color:var(--muted)}
.record42-savebar button{min-height:42px;padding:0 16px;border:1px solid var(--v42-line-strong);border-radius:5px;background:var(--v42-surface-2);color:var(--text);font-weight:900}.record42-savebar .record-save-main{background:var(--module-accent);border-color:var(--module-accent);color:#fff}

/* CONEXA-inspired contextual guide: spotlight + calm assistant card */
.guide-card{z-index:22000!important;width:min(440px,calc(100vw - 34px))!important;border-radius:16px!important;border:1px solid rgba(126,176,220,.24)!important;border-top:0!important;background:linear-gradient(155deg,#0c2132 0%,#071724 100%)!important;color:#f7fbff!important;box-shadow:0 28px 80px rgba(0,0,0,.48)!important;padding:25px 25px 20px!important;overflow:visible!important}
.guide-card:before{content:"";position:absolute;left:25px;right:25px;top:0;height:3px;background:linear-gradient(90deg,#2d6cdf var(--guide-progress,30%),rgba(255,255,255,.12) var(--guide-progress,30%));border-radius:999px}
.guide-card>small{color:#b9cbe0!important;font-size:9px!important;font-weight:900!important;letter-spacing:.18em!important}.guide-card h3{font-size:26px!important;line-height:1.08!important;margin:14px 0 12px!important;color:white!important}.guide-card>p{color:#d7e2ed!important;line-height:1.55!important;font-size:14px!important}
.guide-example{margin:18px 0!important;border:1px solid rgba(148,185,215,.18)!important;border-radius:10px!important;background:rgba(255,255,255,.035)!important;padding:15px 16px!important}.guide-example small{color:#ff6670!important;font-size:9px!important;font-weight:900!important;letter-spacing:.15em}.guide-example p{margin:8px 0 0!important;color:#f0f5fa!important;line-height:1.5!important}
.guide-actions{border-top:1px solid rgba(255,255,255,.12)!important;padding-top:14px!important;display:flex!important;align-items:center!important;gap:8px!important}.guide-actions button{min-height:42px!important;padding:0 14px!important;border:1px solid rgba(255,255,255,.14)!important;border-radius:8px!important;background:#10283b!important;color:white!important;font-weight:900!important}.guide-actions .next{background:#2d6cdf!important;border-color:#2d6cdf!important}.guide-actions>span{margin-left:auto!important;display:flex!important;gap:8px!important}
.guide-focus{z-index:21990!important;border:2px solid #2d6cdf!important;border-radius:8px!important;box-shadow:0 0 0 4px rgba(240,43,53,.12),0 0 30px rgba(240,43,53,.18)!important}
.guide-shade{z-index:21980!important;background:rgba(1,7,13,.72)!important;backdrop-filter:blur(4px)}
.guide-demo-writing{box-shadow:0 0 0 2px rgba(240,43,53,.45)!important}
body.guide-open .floating-assist-stack{opacity:.14;pointer-events:none}

/* Access & forms in light theme */
[data-theme="light"] .guide-card{background:linear-gradient(155deg,#f9fcff,#ecf3f8)!important;color:#13212d!important;border-color:#c9d9e5!important;box-shadow:0 26px 70px rgba(8,28,43,.18)!important}
[data-theme="light"] .guide-card h3,[data-theme="light"] .guide-card .guide-example p{color:#101923!important}
[data-theme="light"] .guide-card>p{color:#40505e!important}
[data-theme="light"] .guide-card>small{color:#627b91!important}
[data-theme="light"] .guide-example{background:white!important;border-color:#d5e0e8!important}
[data-theme="light"] .guide-actions button{background:#e7eef4!important;color:#17222c!important;border-color:#c8d5df!important}
[data-theme="light"] .guide-actions .next{color:white!important}

/* Responsive: guide as bottom sheet and conduct stays one screen */
@media(max-width:1100px){
  .access-user-chip{min-width:48px;width:48px;padding:6px}.access-user-chip>span:last-child{display:none}
  .access42-head{grid-template-columns:1fr}.access42-summary{border-left:0;border-top:1px solid var(--v42-line)}
  .access42-role-strip{grid-template-columns:repeat(3,1fr)}.access42-role-strip article:nth-child(3n){border-right:0}
  .access42-workspace{grid-template-columns:245px minmax(0,1fr)}
  .record-section-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(max-width:760px){
  .access42-workspace{grid-template-columns:1fr}.access42-users{border-right:0;border-bottom:1px solid var(--v42-line);max-height:280px;overflow:auto}
  .access42-role-strip{grid-template-columns:1fr 1fr}.access42-role-strip article:nth-child(n){border-right:1px solid var(--v42-line)}.access42-role-strip article:nth-child(2n){border-right:0}
  .access-person-grid,.record-form-top,.record-section-grid{grid-template-columns:1fr!important}
  .access-row{grid-template-columns:1fr}.access42-editor{padding:17px}.access42-head{padding:22px 18px}
  .record-entry-layer{padding:0!important;place-items:end center!important}.record42-card{width:100%!important;height:94dvh!important;border-radius:14px 14px 0 0!important;border-left:0!important;border-right:0!important;border-bottom:0!important}
  .record-entry-head{padding:15px}.record-entry-head p{display:none}.record-general-help b{display:none}.record42-commandbar{grid-template-columns:1fr;padding:10px 14px}.record42-commandbar label{grid-template-columns:1fr}.record42-commandbar>div{display:none}.record42-jumps{top:81px;padding:0 14px}.record42-flow{padding:0 15px 95px!important}.record-form-top{padding:16px 15px!important}
  .guide-card{position:fixed!important;left:12px!important;right:12px!important;bottom:12px!important;top:auto!important;width:auto!important;max-height:min(68dvh,620px)!important;overflow:auto!important;transform:none!important;border-radius:16px!important}
  .guide-actions{position:sticky;bottom:-20px;background:inherit;padding-bottom:4px}
  .guide-focus{border-radius:6px!important}
}
