/* Masters reference parity and the requested 20% narrower desktop rail. */
:root{--studio-rail:214px!important;--mr-paper:#F6F1E7;--mr-ink:#161512;--mr-clay:#C1613C;--mr-navy:#22344B;--mr-olive:#7A8B6F;--mr-amber:#BE8A34;--mr-red:#E0574C;--mr-border:#D9D5CD;--mr-muted:#6F7887}
@media(min-width:901px){
  body .art-sidebar,body.pdf-workflow .sidebar{width:214px!important;padding:0 12px!important}
  body .art-canvas{margin-left:214px!important;width:calc(100% - 214px)!important}
  body.pdf-workflow:not(.art-dashboard) .app-shell{grid-template-columns:214px minmax(0,1fr)!important}
  body .art-sidebar .art-wordmark,body .sidebar .logo.studio-wordmark{font-size:14px!important;letter-spacing:2.5px!important;padding-left:48px!important}
  body .art-sidebar .art-wordmark:before{font-size:38px!important;left:2px!important}
  body .art-sidebar nav>button,body .sidebar .nav>button,body .sidebar .workflow-utilities>button{gap:12px!important;padding:8px 12px!important;font-size:13px!important}
  body .sidebar #module-children{max-height:calc(100dvh - 330px);overflow:auto;scrollbar-width:thin;padding:4px 2px 18px!important;background:linear-gradient(90deg,#161512f5,#161512df)!important;border-radius:0 0 8px 8px!important}
  body .art-sidebar #master-side-submenu{position:relative!important;z-index:3;display:block!important;max-height:calc(100dvh - 315px);overflow:auto;scrollbar-width:thin;padding:6px 2px 18px!important;background:linear-gradient(90deg,#161512f7,#161512e7)!important;border-radius:0 0 8px 8px!important}
  body .sidebar #module-children section{margin:8px 0 12px}
  body .art-sidebar #master-side-submenu section{margin:8px 0 12px}
  body .sidebar #module-children section h2{color:#AFA99D!important;font:600 9px/1.2 ArtelRoboto,Arial,sans-serif!important;letter-spacing:1.35px!important;text-transform:uppercase;margin:0 10px 5px!important}
  body .art-sidebar #master-side-submenu section h2{color:#AFA99D!important;font:600 9px/1.2 ArtelRoboto,Arial,sans-serif!important;letter-spacing:1.35px!important;text-transform:uppercase;margin:0 10px 5px!important}
  body .sidebar #module-children .destination-link{min-height:31px!important;padding:5px 9px 5px 21px!important;color:#EEEAE0!important;font-size:11px!important}
  body .art-sidebar #master-side-submenu .destination-link{display:flex!important;align-items:center!important;width:100%!important;min-height:31px!important;padding:5px 9px 5px 21px!important;border:0!important;border-radius:5px!important;background:transparent!important;color:#EEEAE0!important;font:400 11px/20px ArtelRoboto,Arial,sans-serif!important;text-align:left!important}
  body .sidebar #module-children .destination-link[aria-current=page]{padding-left:18px!important}
  body .sidebar #module-children .destination-link.active,body .sidebar #module-children .destination-link[aria-current=page]{color:#1F3147!important}
}

body.master-reference-active{background:var(--mr-paper);color:var(--mr-navy);font-family:ArtelRoboto,Arial,sans-serif;overflow-x:hidden}
body.master-reference-active .sidebar #module-children{display:none!important}
body.master-reference-active .topbar{min-height:78px!important;padding:12px 22px!important;background:#FBF8F0!important;border-bottom:1px solid #E5E0D6!important;gap:18px}
body.master-reference-active .page-heading{min-width:280px}
body.master-reference-active .page-heading{min-width:330px}
body.master-reference-active .page-heading>div{min-width:178px}
body.master-reference-active .page-heading h1{font:700 27px/1.05 ArtelRoboto,Arial,sans-serif!important;letter-spacing:-.6px;color:#182D4C!important;text-transform:none!important;white-space:nowrap}
body.master-reference-active .page-heading #page-parent{font-size:12px;color:#6B4B38}
body.master-reference-active .top-actions{margin-left:0}
body.master-reference-active .main{max-width:none!important;padding:12px 22px 28px!important;background:var(--mr-paper)}
.mr-header-ai{height:48px;flex:1;max-width:410px;display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #E56C4D;border-radius:10px;padding:0 12px;box-shadow:0 4px 16px #C1613C16;color:#172D4C}
.mr-header-ai>span{font-size:24px;color:var(--mr-clay)}.mr-header-ai>b{font-size:13px;white-space:nowrap}.mr-header-ai>i{height:20px;border-left:1px solid #D8D5CE}
.mr-header-ai input{min-width:0;flex:1;height:42px!important;border:0!important;background:transparent!important;box-shadow:none!important;padding:0!important;font:13px ArtelRoboto,Arial,sans-serif!important;color:var(--mr-navy)}
.mr-header-ai button{border:0;background:transparent;color:#252525;font-size:25px;padding:3px 5px;cursor:pointer}

.mr-home{padding-top:0}.mr-home-tools{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:16px}
.mr-search{height:42px;display:flex;align-items:center;gap:10px;background:#fff;border:1px solid #BFC6D0;border-radius:5px;padding:0 12px;color:#173254;min-width:270px}
.mr-search svg{width:19px;height:19px;flex:none}.mr-search input{min-width:0;width:100%;height:38px!important;border:0!important;background:transparent!important;box-shadow:none!important;padding:0!important;font:13px ArtelRoboto,Arial,sans-serif!important;color:var(--mr-navy)}
.mr-home-tools .mr-search{width:510px;max-width:55%}.mr-home-tools>.btn{height:42px!important;background:#fff!important;color:#172D4C!important;border:1px solid #AEB7C5!important;font-weight:600!important}
.mr-home-group{margin:0 0 18px}.mr-home-group>header{display:flex;align-items:center;gap:16px;margin-bottom:10px}.mr-home-group>header h2{margin:0!important;color:#173254!important;font:700 12px/1 ArtelRoboto,Arial,sans-serif!important;text-transform:uppercase;letter-spacing:2px;white-space:nowrap}.mr-home-group>header i{height:1px;background:#CCD1D6;flex:1}
.mr-card-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.mr-home-group:nth-of-type(3) .mr-card-grid{grid-template-columns:repeat(5,minmax(0,1fr))}
.mr-master-card{min-height:84px;display:flex;align-items:center;gap:12px;background:#fff;border:1px solid #E1DED7;border-radius:7px;padding:11px 12px;text-align:left;color:var(--mr-navy);box-shadow:0 3px 12px #2C2A2510;cursor:pointer}
.mr-master-card:hover{border-color:#C1613C;transform:translateY(-1px)}.mr-master-card>span:nth-child(2){min-width:0;flex:1}.mr-master-card b{display:block;font:600 13px/1.25 ArtelRoboto,Arial,sans-serif}.mr-master-card small{display:block;margin-top:4px;color:#66748A;font:11px/1.3 ArtelRoboto,Arial,sans-serif}.mr-master-card>svg{width:17px;height:17px;flex:none}
.mr-card-icon{width:54px;height:54px;border-radius:50%;display:grid!important;place-items:center;color:#fff;flex:none;background:var(--mr-navy)}.mr-card-icon svg{width:27px;height:27px}.mr-card-icon.clay{background:var(--mr-clay)}.mr-card-icon.amber{background:var(--mr-amber)}.mr-card-icon.olive{background:var(--mr-olive)}.mr-card-icon.graphite{background:#555552}

.mr-list-screen{padding-top:14px}.mr-list-title{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:14px}.mr-list-title span{display:block;font:700 13px ArtelRoboto,Arial,sans-serif;color:#172D4C;letter-spacing:.8px}.mr-list-title p{margin:4px 0 0;color:#58677B;font-size:12px}.mr-list-title>.btn{background:var(--mr-clay)!important;border-color:var(--mr-clay)!important;color:#fff!important}
.mr-list-tools{display:flex;align-items:center;gap:8px;margin-bottom:10px}.mr-list-tools .mr-search{flex:1}.mr-list-tools select,.mr-list-tools>.btn{height:38px!important;min-height:38px!important;border:1px solid #BCC4CF!important;border-radius:4px!important;background:#fff!important;color:#172D4C!important;font:11px ArtelRoboto,Arial,sans-serif!important;padding:0 26px 0 10px!important;white-space:nowrap}.mr-list-tools #mr-archived{margin-left:auto}
.mr-table-wrap{border:1px solid #D7D8D8;border-radius:5px;background:#fff;overflow:auto}.mr-table{width:100%;border-collapse:collapse;color:#172D4C;font:11px/1.3 ArtelRoboto,Arial,sans-serif}.mr-table th{padding:10px 13px;background:#EDEBE5;border-right:1px solid #D9D8D2;text-align:left;font-weight:600;text-transform:uppercase;font-size:10px;letter-spacing:.2px}.mr-table td{padding:8px 13px;border-right:1px solid #E5E3DE;border-bottom:1px solid #E8E5DF;vertical-align:middle;height:43px}.mr-table tr:nth-child(even){background:#FAF8F3}.mr-table td:last-child,.mr-table th:last-child{width:94px;text-align:center}
.mr-entry{display:flex;align-items:center;gap:9px}.mr-entry>i{width:27px;height:27px;display:grid;place-items:center;border-radius:50%;background:#E9EBEC;color:#183150;font:600 8px ArtelRoboto,Arial,sans-serif;font-style:normal;flex:none}.mr-entry b{font-weight:600}.mr-tag{display:inline-block;margin:2px 4px 2px 0;border-radius:12px;background:#E6ECF5;color:#254A79;padding:3px 8px;font-size:9px;white-space:nowrap}.mr-tag.amber{background:#F7E8C9;color:#8A5B13}.mr-tag.navy{background:#E1E8F0;color:#213D5D}.mr-muted{color:#8B929C}.mr-inline-note{display:block;color:#687789;font-size:9px;margin-top:2px}
.mr-open{border:1px solid #8797AC;background:#fff;color:#183150;border-radius:3px;padding:5px 10px;font:600 10px ArtelRoboto,Arial,sans-serif;white-space:nowrap}.mr-open svg{width:12px;height:12px;vertical-align:-2px}.mr-list-footer{padding:9px 4px;color:#536278;font-size:10px}
.mr-empty{width:min(520px,100%);margin:110px auto 0;background:#fff;border:1px solid #DEDCD5;border-radius:6px;padding:44px 26px;text-align:center;color:#687383}.mr-empty>svg{width:48px;height:48px;color:#9AA1A5}.mr-empty h2{margin:10px 0 5px!important;font-size:17px!important;color:#26394F!important}.mr-empty p{margin:0 0 14px;font-size:12px}

.modal-card.master-ref-modal{width:min(910px,92vw)!important;max-width:910px!important;max-height:92vh!important;padding:0!important;overflow:auto!important;border-radius:7px!important;background:#F8F4EC!important;color:#172D4C!important;font-family:ArtelRoboto,Arial,sans-serif!important;box-shadow:0 18px 55px #0008!important}
.master-ref-modal>.modal-head{position:sticky;top:0;z-index:6;background:var(--mr-clay)!important;color:#fff!important;padding:13px 18px!important;margin:0!important;border:0!important}.master-ref-modal #modal-title{color:#fff!important;font:700 19px/1.2 ArtelRoboto,Arial,sans-serif!important}.master-ref-modal #modal-close{width:30px;height:30px;border-radius:50%;border:0;background:#F8F4EC;color:#172D4C}
.master-ref-modal #modal-body{padding:0!important}.master-ref-modal #master-form{padding:18px 20px 0!important;gap:12px!important}.master-ref-modal #master-fields>.form-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:13px 16px!important}
.master-ref-modal .field label,.master-ref-modal .mapping-editor>b{font:600 11px/1.2 ArtelRoboto,Arial,sans-serif!important;color:#172D4C!important;margin-bottom:5px}.master-ref-modal input,.master-ref-modal textarea,.master-ref-modal select,.master-ref-modal .select-trigger{min-height:35px!important;height:35px!important;border:1px solid #BCC5D0!important;border-radius:4px!important;background:#fff!important;color:#172D4C!important;font:11px ArtelRoboto,Arial,sans-serif!important;padding:7px 10px!important}.master-ref-modal textarea{height:74px!important;min-height:74px!important}.master-ref-modal .field.full{grid-column:1/-1}
.master-ref-modal .mapping-editor{min-width:0;background:#FFFDF9;border:1px solid #DDD8CF;border-radius:5px;padding:12px;align-self:stretch}.master-ref-modal .mapping-editor .field-help{font-size:9px;line-height:1.35;color:#6D7682;margin:3px 0 8px}.master-ref-modal .mapping-editor .btn.secondary{width:100%;min-height:31px!important;padding:6px!important;border:1px dashed #B8B4AB!important;background:#F7F2E9!important;color:#4C5B6D!important;font-size:10px!important}.master-ref-modal .mapping-row{margin:7px 0!important;padding:7px!important;background:#F4F0E8!important;border:1px solid #DED8CF!important;border-radius:4px!important}
.master-ref-modal #master-form>.toolbar{position:sticky;bottom:0;z-index:5;grid-column:1/-1;margin:4px -20px 0!important;padding:12px 20px!important;background:#ECE7DD!important;border-top:1px solid #DCD6CB!important;display:flex!important;gap:10px!important;justify-content:flex-start!important}.master-ref-modal #master-form>.toolbar .success{background:#446B53!important;border-color:#446B53!important;color:#fff!important}.master-ref-modal #master-form [data-cancel-form]{width:86px!important;min-height:35px!important;background:#fff!important;color:#2F343A!important}
.master-ref-modal[data-master-type="ADJUSTMENT"]>.modal-head,.master-ref-modal[data-master-type="BANK"]>.modal-head{background:var(--mr-navy)!important}.master-ref-modal[data-master-type="EMPLOYEE"]>.modal-head,.master-ref-modal[data-master-type="EMPLOYEE_DESIGNATION"]>.modal-head{background:var(--mr-amber)!important}
.master-ref-modal[data-master-type="TYPE_OF_WORK"]>.modal-head,.master-ref-modal[data-master-type="STAGE_OF_WORK"]>.modal-head,.master-ref-modal[data-master-type="TASK"]>.modal-head{background:#4E7257!important}
.master-ref-modal .notice{font-size:10px!important;padding:9px 11px!important;border-radius:4px!important}

.mr-relationships .section-title{margin-bottom:10px!important}.mr-relationships .tabs{display:flex;overflow:auto;border-bottom:1px solid #CFCFC9;margin-bottom:10px}.mr-relationships .tabs button{min-height:39px;border:0;border-bottom:3px solid transparent;background:transparent;color:#35455C;font-size:10px;white-space:nowrap;padding:7px 12px}.mr-relationships .tabs button.active{border-color:var(--mr-clay);color:#9D4726;font-weight:700}.mr-relationships #mapping-panel>.toolbar{margin:0 0 8px}.mr-relationships #add-mapping{background:var(--mr-clay)!important}.mr-rel-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:12px;align-items:start}.mr-source-pane{border:1px solid #DAD7CF;background:#fff;border-radius:5px;padding:10px}.mr-source-pane>b{display:block;font-size:11px;margin-bottom:8px}.mr-source-pane .mr-search{min-width:0;width:100%;height:34px;margin-bottom:7px}.mr-source-pane button{display:flex;justify-content:space-between;width:100%;border:0;background:transparent;color:#25394F;padding:6px 8px;border-radius:3px;text-align:left;font-size:10px}.mr-source-pane button.active{background:#E7E2D8;font-weight:600}.mr-source-pane button span{color:#8A5A3A}
.mr-relationships .data-table{font-size:10px!important}.mr-relationships .data-table th{background:#E9E7E1!important}.mr-relationships .data-table td{padding:8px!important}
.mr-archived .section-title{align-items:center}.mr-archived #archive-search{height:39px;border:1px solid #BCC4CE;border-radius:4px;background:#fff;padding:0 12px;margin:8px 0 14px;width:420px;max-width:100%}.mr-archived .empty{width:min(520px,100%);margin:90px auto;background:#fff;border:1px solid #DCD9D2;border-radius:6px;padding:50px;text-align:center;color:#657286}

/* CRM funnel labels: match approved copy, alignment, and outcome colors exactly. */
.cj-exit-row>button{min-width:126px!important;text-align:center!important;font:600 11px/1 ArtelRoboto,Arial,sans-serif!important;letter-spacing:0!important;padding:6px 10px!important;border-radius:4px!important;white-space:nowrap!important;color:#fff!important}
.cj-exit-row[data-tone="olive"]>button{background:#6F8064!important}.cj-exit-row[data-tone="gold"]>button{background:#B9812A!important}.cj-exit-row[data-tone="red"]>button{background:#D94F47!important}
.cj-exit-row[data-tone="olive"]>button::first-letter,.cj-exit-row[data-tone="gold"]>button::first-letter,.cj-exit-row[data-tone="red"]>button::first-letter{text-transform:uppercase}

@media(max-width:1180px){.mr-card-grid,.mr-home-group:nth-of-type(3) .mr-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.mr-header-ai{display:none}.mr-list-tools{flex-wrap:wrap}.mr-list-tools .mr-search{flex-basis:100%}.mr-rel-layout{grid-template-columns:1fr}}
@media(max-width:650px){.mr-card-grid,.mr-home-group:nth-of-type(3) .mr-card-grid{grid-template-columns:1fr}.mr-home-tools{align-items:stretch;flex-direction:column}.mr-home-tools .mr-search{max-width:none;width:100%}.mr-master-card{min-height:76px}.mr-list-title{align-items:flex-start;flex-direction:column}.mr-list-tools>*{width:100%}.master-ref-modal #master-fields>.form-grid{grid-template-columns:1fr!important}.master-ref-modal .mapping-editor,.master-ref-modal .field.full{grid-column:1}.mr-rel-layout{grid-template-columns:1fr}}

/* Footer actions keep whole labels and wrap to a new row on narrow screens. */
.master-ref-modal #master-form .toolbar>.btn{white-space:nowrap;flex:0 0 auto}
