.register-relations .register-metrics,.register-relations .register-intro{display:none}
.register-relations .register-reference{display:none}
.rw-register-heading,.rw-toolbar,.rw-header,.rw-tools,.rw-pager{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.rw-register-heading{padding:8px 0 18px;font-size:14px;color:#52677e}

#workspace .register-relations .qw-heading{margin:8px 0 24px}
#workspace .register-relations .qw-heading h1{font-size:clamp(23px,3vw,30px);font-weight:600;color:#17334a}
#workspace .register-relations .qw-heading #register-results{font-size:14px}
#workspace .register-relations .rw-register-add{background:#17334a;color:#fff;border-color:#17334a;min-height:44px;font-weight:600}
#workspace .register-relations .rw-register-tools{margin-bottom:20px}
.rw-archive-tabs{display:flex;gap:6px;margin:0 0 16px}
#workspace .rw-archive-tabs button{min-height:44px;margin:0;background:transparent;border-color:transparent;color:#52677e}
#workspace .rw-archive-tabs button[aria-pressed="true"]{background:#e2eef9;color:#163f66;box-shadow:inset 0 -2px #2a5e8b}
#workspace .register-relations .rw-register-search{
 display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:0;
 width:min(100%,760px);margin:0;padding:0;background:transparent;border:0;box-shadow:none;
}
#workspace .register-relations .rw-register-search .register-field{min-width:0}
#workspace .register-relations .rw-register-search label{font-size:14px;font-weight:500}
#workspace .register-relations .rw-register-search input{
 min-height:44px;height:44px;border-radius:6px 0 0 6px;font-size:16px;
}
#workspace .register-relations .rw-register-search button{
 grid-column:2;grid-row:1;min-height:44px;height:44px;margin:0;border-radius:0 6px 6px 0;
 background:#17334a;border-color:#17334a;color:white;
}
#workspace .register-relations .rw-register-search .register-search-field{grid-column:1;grid-row:1}
#workspace .register-relations .rw-register-options{margin:8px 0 0;padding:0;border:0;background:transparent}
#workspace .register-relations .rw-register-options>summary{min-height:44px;padding:8px 0;margin:0;color:#52677e;cursor:pointer}
#workspace .register-relations .rw-register-options .register-filter-group{margin:4px 0 8px}
#workspace .register-relations .qw-heading-actions .resource-action-menu{flex:0 0 auto}
#workspace .register-relations .qw-heading-actions .resource-action-menu>summary>span:first-child{display:none}
#workspace .legal-register.register-relations #register-table th:not(:empty){
 background:#f4f7f9;color:#526b81;font-size:15px;font-weight:400;
 line-height:1.4;padding-block:19px;border-top:0;
}
#workspace .register-relations #register-table th:first-child{width:42%}
#workspace .register-relations #register-table th:nth-child(2){width:20%}
#workspace .register-relations #register-table th:last-child{width:38%}
#workspace .legal-register.register-relations #register-table :is(th,td){padding-inline:clamp(14px,2vw,25px)}
#workspace .legal-register.register-relations #register-table td{
 vertical-align:top;padding-block:14px;font-size:16px;line-height:1.4;color:#405a71;
}
#workspace .legal-register.register-relations #register-table td:nth-child(2){padding-block:25px}
#workspace .register-relations #register-table tbody tr:hover{background:#fff}
#workspace .legal-register.register-relations #register-table .register-record-link{
 display:flex;align-items:center;width:fit-content;min-height:44px;
 color:#17334a;font-size:18px;font-weight:700;line-height:1.35;
 white-space:normal;overflow:visible;overflow-wrap:anywhere;
}
#workspace .register-relations .rw-linked-matters{margin:0;padding:0;border:0;background:transparent}
#workspace .legal-register.register-relations #register-table .rw-linked-matters>summary{
 display:flex;align-items:center;gap:7px;width:fit-content;min-height:44px;
 margin:0;padding:0;border:0;background:transparent;color:#205a85;
 font-size:17px;font-weight:700;line-height:1.35;cursor:pointer;
}
#workspace .register-relations .rw-linked-matters>summary::after{content:none}
#workspace .register-relations .rw-linked-matters>summary::before{
 content:"";flex:none;border-block:5px solid transparent;border-inline-start:8px solid currentColor;
}
#workspace .register-relations .rw-linked-matters[open]>summary::before{transform:rotate(90deg)}
#workspace .register-relations .rw-linked-empty{display:flex;align-items:center;min-height:44px;color:#526b81}
#workspace .register-relations .rw-linked-list ul{list-style:none;padding:0;margin:0 0 8px}
#workspace .register-relations .rw-linked-list li{border-top:1px solid #e3eaf1}
#workspace .register-relations .rw-linked-list a{display:block;padding:13px 0;color:#17334a;font-weight:600;overflow-wrap:anywhere}
#workspace .register-relations .rw-linked-list small{display:block;color:#52677e;font-weight:400}
#workspace .register-relations :is(a,summary,button):focus-visible{outline:2px solid #28669b;outline-offset:2px}
@media(max-width:600px){
 #workspace .register-relations #register-table tbody{padding:0}
 #workspace .register-relations #register-table tbody tr{
  grid-template-columns:minmax(0,1fr);gap:3px;margin:0;padding:10px 14px;
  border:0;border-bottom:1px solid #e3eaf1;border-radius:0;
 }
 #workspace .legal-register.register-relations #register-table td,
 #workspace .legal-register.register-relations #register-table td:nth-child(2){padding:0;border:0}
 #workspace .register-relations #register-table td::before{display:none}
 #workspace .register-relations #register-table .register-record-link,
 #workspace .register-relations .rw-linked-matters>summary{min-height:44px;align-content:center}
}
.has-relation-workplace #workspace>.sidebar-shell>.sidebar-content>h1{display:none}
.has-relation-workplace #crm-panel{background:transparent;border:0;padding:0;box-shadow:none}
.relation-workplace{font-size:15px;color:#233e54;min-width:0}
.relation-workplace h1{font-size:clamp(22px,3vw,30px);font-weight:600;line-height:1.3;overflow-wrap:anywhere;margin:0;flex:1}
.rw-header{margin:18px 0 20px}.rw-header>p{flex-basis:100%;margin:0;font-size:14px}
.rw-tabs{display:flex;flex-wrap:wrap;gap:4px;border-bottom:1px solid #dbe4ed;padding-bottom:8px;margin-bottom:20px}
.rw-tabs button{border:0;border-radius:4px;background:transparent;color:#49647d;font-weight:500;min-height:44px;padding:10px 14px}
.rw-tabs button.active{background:#eaf1f8;color:#174b77;box-shadow:inset 0 -3px #285e8b;font-weight:600}
.rw-surface{background:white;border:1px solid #dbe4ed;border-radius:12px;padding:22px;min-width:0}
.rw-surface h2,.rw-dialog h2{font-size:20px;font-weight:600;margin:0 0 18px}.rw-toolbar h2{margin:0}
.rw-toolbar{margin-bottom:18px}.rw-facts{display:grid;grid-template-columns:minmax(130px,1fr) minmax(0,3fr);gap:12px 24px;margin:0 0 22px}
.rw-facts dt{font-size:14px;color:#62758b}.rw-facts dd{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.rw-table{border-collapse:collapse;width:100%;table-layout:fixed;margin:16px 0}
.rw-table th{text-align:left;font-size:13px;color:#60768a;background:#f7f9fc;font-weight:600}
.rw-table td,.rw-table th{padding:13px 12px;border-bottom:1px solid #e5ebf1;overflow-wrap:anywhere;vertical-align:middle}
.rw-table tbody tr:has(a){cursor:pointer}.rw-table tbody tr:hover{background:#f3f7fb}
.rw-table a{display:flex;align-items:center;min-height:44px;font-weight:600;color:#174b77;text-decoration:none;overflow-wrap:anywhere}
.rw-table a:focus-visible,.rw-tabs button:focus-visible{outline:2px solid #28669b;outline-offset:2px}
.rw-notes{white-space:pre-wrap;overflow-wrap:anywhere;margin-bottom:0}.rw-surface>input[type=search]{width:100%;max-width:680px}
.relation-workplace button,.relation-workplace input,.relation-workplace select,.relation-workplace summary,.rw-dialog button,.rw-dialog input,.rw-dialog select{min-height:44px;box-sizing:border-box}
.rw-dialog{width:min(600px,calc(100vw - 32px));max-height:calc(100dvh - 40px);overflow:auto;border:1px solid #cad8e4;border-radius:12px;padding:24px;color:#233e54;box-sizing:border-box}
.rw-dialog::backdrop{background:rgb(14 34 53 / 35%)}.rw-dialog form{display:grid;gap:14px}.rw-dialog input,.rw-dialog textarea{width:100%;box-sizing:border-box}.rw-dialog textarea{min-height:144px;resize:vertical}.rw-dialog>button{margin:6px 8px 0 0}
@media(max-width:900px){.rw-table thead{display:none}.rw-table,.rw-table tbody,.rw-table tr,.rw-table td{display:block;width:100%;box-sizing:border-box}.rw-table tr{border:1px solid #e2e9f1;border-radius:8px;margin-bottom:12px;padding:8px}.rw-table td{border:0;padding:6px 8px}.rw-table td:not(:first-child):before{content:attr(data-label);display:block;font-size:12px;color:#687f94;margin-bottom:4px}.rw-table td:first-child{border-bottom:1px solid #e8edf3}.rw-facts{grid-template-columns:1fr 2fr;gap:12px}}
@media(max-width:540px){.rw-header .rw-tools{width:100%}.rw-header .rw-tools button,.rw-register-heading>button{width:100%}.rw-header{gap:12px}.rw-surface{padding:16px}.rw-facts{grid-template-columns:1fr;gap:5px}.rw-facts dd{margin-bottom:10px}.rw-dialog{padding:18px}.rw-toolbar>*{max-width:100%}.rw-tools{justify-content:flex-start}.rw-tools button{flex:1;min-width:130px}}
.rw-business-details{grid-column:1/-1;max-width:100%;margin:10px 0;padding:12px;border:1px solid #dce5ee;border-radius:6px;background:#fafcfe}
.rw-business-details>summary{font-size:14px;font-weight:600;cursor:pointer}
.rw-business-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.rw-business-grid>label{display:flex;flex-direction:column;gap:5px;font-size:13px;min-width:0}
.rw-business-grid input{box-sizing:border-box;min-width:0;width:100%;min-height:40px;font-size:16px}
@media(max-width:540px){.rw-business-grid{grid-template-columns:1fr}.rw-business-grid input{min-height:44px}}

/* Contact editor: one compact surface; existing validation and permissions remain authoritative. */
.rw-dialog.rw-contact-dialog{width:min(560px,calc(100vw - 32px));padding:0;background:#fff;color:#183b59;box-shadow:0 18px 60px rgb(16 42 64 / 18%);border-radius:12px}
.rw-contact-dialog::backdrop{background:rgb(14 34 53 / 28%)}
.rw-contact-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px 22px 16px;border-bottom:1px solid #e3eaf2}
.rw-contact-header>div{min-width:0}.rw-contact-header h2{margin:0;font-size:20px;line-height:1.35;font-weight:600;color:#183b59}
.rw-contact-context{font-size:13px;line-height:1.5;color:#62758a;margin:5px 0 0;overflow-wrap:anywhere}
.rw-contact-dialog button.rw-contact-close{flex:0 0 36px;min-width:36px;min-height:36px;height:36px;width:36px;padding:0;margin:-4px -6px 0 0;border:0;background:transparent;font-size:24px;font-weight:400;color:#62758a;display:grid;place-items:center}
.rw-contact-dialog form.rw-contact-form{display:block;max-width:none;margin:0;padding:0}
.rw-contact-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding:20px 22px 0}
.rw-contact-fields>label{display:flex;flex-direction:column;gap:6px;min-width:0;margin:0;font-size:13px;font-weight:500;color:#344e65}
.rw-contact-fields input{width:100%;min-width:0;height:44px;min-height:44px;padding:9px 11px;font-family:inherit;font-size:16px;font-weight:400;line-height:1.4;border:1px solid #cbd8e6;border-radius:6px;background:#fff;color:#183b59;box-shadow:none;margin:0}
.rw-contact-fields input:focus{border-color:#285e8b;outline:2px solid rgb(40 94 139 / 18%);outline-offset:1px}
.rw-contact-hint{padding:0 22px;margin:12px 0 18px;font-size:12px;line-height:1.5;color:#62758a}
.rw-contact-actions{display:flex;justify-content:flex-end;align-items:stretch;flex-wrap:wrap;gap:8px;padding:14px 22px;border-top:1px solid #e3eaf2;background:#fafbfd}
.rw-contact-dialog .rw-contact-actions button{margin:0;min-height:40px;padding:8px 14px;font-size:14px;line-height:1.4;border-radius:6px;white-space:normal;max-width:100%}
.rw-contact-body{padding:20px 22px}.rw-contact-body .rw-facts{margin:0;gap:12px 16px;font-size:14px}
@media(pointer:coarse){.rw-contact-dialog .rw-contact-actions button,.rw-contact-dialog button.rw-contact-close{min-height:44px}.rw-contact-dialog button.rw-contact-close{height:44px;min-width:44px;width:44px}}
@media(max-width:540px){.rw-dialog.rw-contact-dialog{width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}.rw-contact-header{padding:18px 18px 14px}.rw-contact-fields{grid-template-columns:1fr;gap:14px;padding:18px 18px 0}.rw-contact-header h2{font-size:18px}.rw-contact-hint{padding:0 18px}.rw-contact-actions{padding:12px 18px}.rw-contact-dialog .rw-contact-actions button{min-height:44px;flex:1;min-width:0}.rw-contact-dialog button.rw-contact-close{min-height:44px;min-width:44px;width:44px;height:44px}}
